Two weapon specials with nearly identical codes - one works, one doesn't
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
- DopeKiwiWarrior
- Posts: 30
- Joined: January 27th, 2013, 4:04 pm
- Location: Inside your mom, she ate me, send help before I dissolve.
Two weapon specials with nearly identical codes - one works, one doesn't
Hello,
I am creating two weapon specials that move units after they attack - recoil and leap. Recoil moves the unit backwards, leap moves it behind its opponent. It works alright until two units with the same special attack each other. I fixed it by adding another version of the special event. The one for leap works flawlessly but the one for recoil produces around 50 lines of "error engine: failed to auto-store $second_unit at (x,y)" in the error log without producing the right result despite the codes being identical only with different variables. Can you help me fix this?
I am creating two weapon specials that move units after they attack - recoil and leap. Recoil moves the unit backwards, leap moves it behind its opponent. It works alright until two units with the same special attack each other. I fixed it by adding another version of the special event. The one for leap works flawlessly but the one for recoil produces around 50 lines of "error engine: failed to auto-store $second_unit at (x,y)" in the error log without producing the right result despite the codes being identical only with different variables. Can you help me fix this?
Leap code (works)
Recoil code (bugs out)
MOVE_XP_GIVER macro just in case
Creator of Moonday Era, go check it out! (And critique the hell out of it, because it needs it.)
Re: Two weapon specials with nearly identical codes - one works, one doesn't
Sounds like race condition, one event tries to store unit that has already been moved away.
- DopeKiwiWarrior
- Posts: 30
- Joined: January 27th, 2013, 4:04 pm
- Location: Inside your mom, she ate me, send help before I dissolve.
Re: Two weapon specials with nearly identical codes - one works, one doesn't
It's really a problem of the succession? My god why haven't I tried that.
Creator of Moonday Era, go check it out! (And critique the hell out of it, because it needs it.)