Author Topic: Causant & Cause conditionals  (Read 726 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Causant & Cause conditionals
« on: December 30, 2020, 04:53:28 PM »
Causant allows to check which "other" thing triggered the current cp
For example, imagine an enemy hurt cp
Code: [Select]
//Enemy - Hurt CP
if causant = projectile 3
kill enemy
This will check if the enemy was actually hurt by a projectile with id 3, you can also do this
Code: [Select]
//Projectile - Strike Target
if causant = enemy 4
{
with causant
enemy = jump
}
Causant would allow player 1, player 2, any object id (character, item, block, enemy, projectile)
also would allow none or null which only works if the "second thing" isn't actually any of the before mentioned. One example for none would be Projectile Strike Surface, where the surface striked is a normal grass wall.

Ok, now cause conditional. This will check how the CP was actually triggered. One example of use is this
Code: [Select]
//Enemy - Hurt CP
if cause = head attack
kill enemy
Literally, its checking if the way the enemy was hurt was by jumping on it.
This, however, would have different options depending on the cp.
Another example
Code: [Select]
//Projectile - Create CP
if cause = enemy proj cmd
//Do
This basically checks if the projectile was spawned by a command, and in this case, spawned with the spawn projectile and not the spawn char projectile.

Additional to these stuff, it would be useful to have these both additional things
Code: [Select]
any <object> //For a causant command prompt, this would check if actually the causant is an specific type of object but with no specific id. A good use would be triggering the commands inside a causant conditional only when its harmed by an enemy for example, or stuff like that.

with causant //Triggers the following commands with the specific object that triggered the CP.
Sorry because my English is not very good because I'm Spanish ;) :P