Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: tutti on March 13, 2006, 09:34:57 PM
-
I have a skill that turns on a switch. I also have a common event set to auto-run with the switch as the trigger switch, that has all the coding of the skill. However, when I use the skill in battle (no, it's not set to allow field use), nothing happens. If I turn on the switch through an event outside of battle, or use the skill on the field, it works, but that's not quite what I'm looking for. I've looked through everything, I can't really see what's wrong.
Switches used: [0001: Steal Item], [0002: Steal Success], [0003: Steal Item Chance], [0004: Item to Steal]
Common event: Steal Item; Trigger: Auto-Start; Trigger switch: Steal Item
<>Message: Thieving in process...
<>Variable oper: [0002: Steal Success] set, Rnd [1 - 100]
<>Branch if var [0002: Steal Success] is V[0003] Less
- <>Message: Success!
- <>Variable oper: [0003: Steal Item Chance] Set, 0
- <>Change items: V[0004] add
- <>
: Else handler
- <>Message: Failure...
- <>
: End
<>Switch operation: [0001: Steal Item] OFF
<>
-
Parallel Process and Auto-Start Common Events don't run in battle. To make your system work, you'll have to set the event to Call, then call it from the steal event in-battle.
-
Ah, I see. Thank you ^_^
-
It tends to only work in battles, using the DBS I'm assuming, if it's set as a separate skillset (IE from the Battle Setting tab in the Database), and then for every monster group have a battle event, where its trigger is when that battle skillset is used. You know what I mean? Battle events are fairly volatile and calling common events from in-battle doesn't always work.
Switches used: [0001: Steal Item], [0002: Steal Success], [0003: Steal Item Chance], [0004: Item to Steal]
Common event: Steal Item; Trigger: Auto-Start; Trigger switch: Steal Item
<>Message: Thieving in process...
<>Variable oper: [0002: Steal Success] set, Rnd [1 - 100]
<>Branch if var [0002: Steal Success] is V[0003] Less
- <>Message: Success!
- <>Variable oper: [0003: Steal Item Chance] Set, 0
- <>Change items: V[0004] add
- <>
: Else handler
- <>Message: Failure...
- <>
: End
<>Switch operation: [0001: Steal Item] OFF
<>[/B]
I doubt that's all of the code, as variable number 3 is 0 at the moment... there's nothing there that defines it. Therefore, the steal has a 0% chance of success.
EDIT: Beaten...
-
The variables are set in the monster group tab. The point is that every battle can have an item you can steal, and the chance of stealing that item depends on the battle. I don't count that as part of the code, but that's just me.
Anyway, I don't really understand what you're saying above the quote -_-
-
Hey, don't worry. I was just mentioning that variable number 3 would be 0, given only that coding. It's fine if you've set it in the monster group tab :D
-
Okay. Well, thanks anyway. I wasn't really expecting an answer until tomorrow >_>
Though, to me, tomorrow is in 15 minutes, but meh. I'm going to bed. Thanks for your help, both of you :)