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.

Some trouble with the conditional branch for unarmed and level up

This matter has something related to the thread below, it was locked before I even knew it so I make another thread about it.

http://www.rmxp.org/forums/showthread.php?t=31928

Heres the code that I need help with
Code:
$game_actors[XXX].weapon_id != 0

I'll retrace my steps:
First, I set up a common event with a parallel process trigger
Then, set up a conditional branch and use the last option "script" to put in this code"
Then, I set up a command to make the actor equip a weapon which makes the common event looks like this:

@> Conditional Branch: Script: $game_actors[XXX].weapon_id != 0
@>Change Equipment: [Actor1], Weapon = [Sword]
@>
: Branch End
@>

When I turn ON the switch which triggers the parallel process of the common event, there comes the error.
The point I need the script is to make the actor equip the default weapon in case he wasn't holding any equipment, did I misused the script? :(

For the Level up script. I assign the codes to a common event that shows up a message as the actor level up, it did but all the time even when the actor didn't leveled up. Did I make any mistake again? :(

BTW, was the script not compatible with the SDK script? :-/
 

arev

Sponsor

Actually I think it should be $game_actors[XXX].weapon_id == 0
Now it changes any weapon actor holds to [Sword]. Although it shouldn't cause any errors. Tell us what the error message is.
 
Yeah, I knew there was a problem with the "!=".
No wonder it doesn't work since it says "Not equal to unarmed" :-/ lol :D
It works, the actor will automatically wield the Sword.
The usual error message "Error while running the script" came out.

Thanks, one down. Guess I will have to wait for someone else to help me with the Level Up message script. :-/
 

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