Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

XAS_Hero: how do i make an enemy variable

Im using XAS_Hero ABS and i dont know how to add a variable from killing an enemy.
example: killing 3 monsters triggering a door to open.
please help iv been stuck and confused about this for some time now =[
thank you.
 
You can't add variables without editing the script itself. But here's a work-around:

In the script, find the line "DEFEAT_SWITCH_IDS" (use Ctrl-F to make it easier).
Use the code "A=>B" to make the enemy you want to turn on a switch (replace A with the enemy ID and B with the switch ID).

Now go to Common Events, and create an "Autorun" event with the Condition switch # you turned on in the last code.
In this common event, add 1 to a variable and then use "Erase Event."

That's pretty much it. You can use Conditional Branches and whatnot for checking how much the variable is to open the door. Good luck with it.
 
thankyou =] finally can get on with the rest of my game.
Regi":1zgsxy7l said:
You can't add variables without editing the script itself. But here's a work-around:

In the script, find the line "DEFEAT_SWITCH_IDS" (use Ctrl-F to make it easier).
Use the code "A=>B" to make the enemy you want to turn on a switch (replace A with the enemy ID and B with the switch ID).

Now go to Common Events, and create an "Autorun" event with the Condition switch # you turned on in the last code.
In this common event, add 1 to a variable and then use "Erase Event."

That's pretty much it. You can use Conditional Branches and whatnot for checking how much the variable is to open the door. Good luck with it.
 
ok im still stuck after all this time. i have done everything you said but the 'common event - autorun' part keeps making it crash... so any idea why? thanks
Regi":3pnozh4c said:
You can't add variables without editing the script itself. But here's a work-around:

In the script, find the line "DEFEAT_SWITCH_IDS" (use Ctrl-F to make it easier).
Use the code "A=>B" to make the enemy you want to turn on a switch (replace A with the enemy ID and B with the switch ID).

Now go to Common Events, and create an "Autorun" event with the Condition switch # you turned on in the last code.
In this common event, add 1 to a variable and then use "Erase Event."

That's pretty much it. You can use Conditional Branches and whatnot for checking how much the variable is to open the door. Good luck with it.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top