Skip to content

Landmines and Traps

Pheonix KageDesu edited this page Jan 1, 2020 · 7 revisions

⚠️ Available since Build 1090

Demo project: Demo Link

See Enemy Spawning

1. Create a new Event on Spawn Map

This event used in <landmineEventId:X> ABS parameter (see below)

First Event Page

Event must have minimum 2 pages. First page is empty. Second page starts when landmine activated
⚠️ Required: Event Priority Below Character

Second Event Page

⚠️ Required: Conditions Self Switch A
In second page you can add some logic, but i prefer add command Erase Event for delete landmine from map
Also, set event trigger: Parallel or Autorun

Example: In Demo project, landmine event with ID 4 uses logic with 3 event pages


2. Create landmine explosion ABS skill

This skill uses by landmine, when it's activated
This skill used in <landmineSkillId:X> ABS parameter (see below)

ABS:0 skill with some special settings:
<radius:X> - landmine damage radius (optional), by default 1 - damage only who step on

Occasion - Never - try to not use landmine skills like skills for actors or enemies
Scope:

  • 1 Enemy - this landmine against enemies only
  • 1 Ally - this landmine against player and allies
  • All enemies - this landmine against all (player, allies, enemies)

Also, recommended set parameters MP cost, TP cost, speed to 0


3. Create landmine place on ground ABS skill

This skill uses by player or enemy for placing landmines

ABS parameters for landmine place skill

REQUIRED:

  • <landmineSkillId:X> - X - landmine skill ID (see above)
  • <landmineEventId:X> - X - landmine event ID on SpawnMap (see above)
    OPTIONAL:
  • <landmineTime:X> - X - time in frames for landmine activation (60 = 1 second)
  • <landmineTimeOnly:Z> - if 1 - landmine not been activated by step on it, only by timer (default 0)
  1. Place landmine below skill user

Skill type ABS:0
Scope: The user

  1. Place landmine on distance (under cursor)

Skill type ABS:2
Scope: 1 Enemy
<range:X> - X - max distance to place (in map cells)


4. Using uAPI for placing landmines

Using uAPI script calls you can place landmines on map, activate it, set timers, delete it. It's allow you create some kinds of traps.

uAPI.setLandmine(index, eventId, skillId, x, y);

  • index - any number
  • eventId - landmine event ID on SpawnMap
  • skillId - landmine skill ID (explosion skill)
  • x and y - coordinates on map

Example: uAPI.setLandmine(0, 10, 33, 20, 30)

Or, if you want use values from Variable, use $gameVariables.value(number), where number - variable number
Example: uAPI.setLandmine(0, 10, 33, $gameVariables.value(144), $gameVariables.value(254));

uAPI.setTimerForLandmine(index, time, onlyTimerExplosion);

  • index - number of landmine for which you set the timer
  • time - time in frames (60 = 1 second)
  • onlyTimerExplosion - if true, then landmine will activated only by timer, if false - by timer and step on it

Example: uAPI.setTimerForLandmine(0, 120, false);

uAPI.deleteLandmine(index); - remove landmine from map (without activation and landmine event run)
uAPI.explodeLandmine(index); - activate landmine on map (explode and landmine event run)

Clone this wiki locally