- Joined
- Sep 10, 2018
- Messages
- 3
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMMV
Okay so what I am trying to do is make it so that if the actor uses a magical attack then my Last Skill Type variable is set to 1 and if it is physical set it to 2. This seems to partially work but not really (I explain everything below). More specifically I'm trying to make an intro battle where the player challenges one of the commander's of the enemy's forces to a battle. The command is immune to all physical damage (I just gave him a REALLY high defense value) but he can be hit with magic. Depending on if the player uses a physical attack or a magic attack different things will happen. If the attack is physical you just get some dialogue between the two characters. If the attack is magic, the battle is aborted with the enemy fleeing. I thought I would handle this logic in a troop Battle Event. Here is the relevant parts of the event:
Battle Event in Troop Swordsman:
Conditions: Turn End Span: Turn
If: Marigold Town State = 3 (variable used to determine if this is the first battle the player is fighting in the intro sequence)
If: Last Skill Type = 1 (If the actor used magic)
(Do some text conversation stuff)
Control Variables: #0002 Marigold Town State = 4 (advance intro sequence after battle)
(More Conversation)
Change EXP: Entire Party, + 80 (Show Level Up)
Force Action: #1 Swordsman, Escape, Last Target
Control Variables: #0004 Last Skill Type = 0 (Reset last used skill to essentially a "null" value that does not represent any skill type for future use)
End
If: Last Skill Type = 2 (If actor used a physical attack)
(More Conversation Text)
End
End
Now here is how I attempt to update my variable Last Skill Type with the formulas in the skills tab:
0001 Attack: v[4] = 2; a.atk * 4 - b.def * 2
0009 Fire Formula: v[4] = 1; 100 + a.mat * 2 - b.mdf * 2
And now for all my variables:
0001: Player Gender
0002: Marigold Town State
0003: cutscene1 (For the abstract intro before the player even sees their character)
0004: Last Skill Type
And Now for what my problem actually is:
When I attack the commander with a physical attack I get the If: Last Skill Type = 2 (If actor used a physical attack) 'code' triggered as expected BUT this also triggers even if I use my fire attack. So the physical attack 'code' is executing regardless of whether I use a physical or a magic attack. I really am confused. I quadruple checked my variables. Any and all help is appreciated. I know I supplied a lot of information but that's so that I can make my problem as clear as possible. If this is not enough I'm happy to upload my entire project (which is very small at the moment) if necessary.
Battle Event in Troop Swordsman:
Conditions: Turn End Span: Turn
If: Marigold Town State = 3 (variable used to determine if this is the first battle the player is fighting in the intro sequence)
If: Last Skill Type = 1 (If the actor used magic)
(Do some text conversation stuff)
Control Variables: #0002 Marigold Town State = 4 (advance intro sequence after battle)
(More Conversation)
Change EXP: Entire Party, + 80 (Show Level Up)
Force Action: #1 Swordsman, Escape, Last Target
Control Variables: #0004 Last Skill Type = 0 (Reset last used skill to essentially a "null" value that does not represent any skill type for future use)
End
If: Last Skill Type = 2 (If actor used a physical attack)
(More Conversation Text)
End
End
Now here is how I attempt to update my variable Last Skill Type with the formulas in the skills tab:
0001 Attack: v[4] = 2; a.atk * 4 - b.def * 2
0009 Fire Formula: v[4] = 1; 100 + a.mat * 2 - b.mdf * 2
And now for all my variables:
0001: Player Gender
0002: Marigold Town State
0003: cutscene1 (For the abstract intro before the player even sees their character)
0004: Last Skill Type
And Now for what my problem actually is:
When I attack the commander with a physical attack I get the If: Last Skill Type = 2 (If actor used a physical attack) 'code' triggered as expected BUT this also triggers even if I use my fire attack. So the physical attack 'code' is executing regardless of whether I use a physical or a magic attack. I really am confused. I quadruple checked my variables. Any and all help is appreciated. I know I supplied a lot of information but that's so that I can make my problem as clear as possible. If this is not enough I'm happy to upload my entire project (which is very small at the moment) if necessary.
Last edited:

