• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Loadaing a Saved Game disables a trigger/ability

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Greetings, Hive!

For a long while, a triggered (yet very simple) ability has been acting very inconsistently for me and I finally decided to do greater research about it after struggling with various fixes that have failed.

So, here is the premise: I have a boss, in whose chamber Rain of Fire should start falling down periodically every 5 seconds. You engage the boss -> a periodic trigger is turned on that spawns a dummy unit for the player that owns the boss and starts channeling Rain of Fire on a random hero in the region where the fight happens.

There have been 2 major bugs that have happened with this simple idea:

1) Rain of Fire got interrupted almost immediately after the dummy unit spawned, resulting in having only 0-1 waves. This has been fixed a few days ago in a different thread. If interested (and if it matters) you can take a look at it here.

2) Occasionally Rain of Fire didn't occur at all, or if it did it was very strange -> only 1 wave with 1 'shard' of the Rain of Fire fell down. After a long time of having no idea as to when exactly this does happen and what might cause it, one of the players that play the map noted that it happens if you save the game at some point and then load it. If you engage the boss after the save/load (I am talking about regular F10 Save and Load), then it either doesn't happen at all or acts super strange as I just explained.

I am posting the only trigger related to the boss fight, which is the one that spawns the dummy every 5 seconds (initially off, turned on at the end of the boss cinematic):

[trigger=""]
Cast Rain of Fire
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Set Kergaloth_Group = (Units in Final Boss Area <gen> matching ((((Matching unit) is A Hero) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Backpack)))
Set Kergaloth_Point = (Position of (Random unit from Kergaloth_Group))
Unit - Create 1 Dummy (Rain of Fire) for Player 12 (Brown) at Kergaloth_Point facing Default building facing degrees
AI - Ignore (Last created unit)'s guard position
Unit - Order (Last created unit) to Human Archmage - Blizzard Kergaloth_Point
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation (udg_Kergaloth_Point)
Custom script: call DestroyGroup(udg_Kergaloth_Group)
[/trigger]


I am almost certain the 2nd issue happens only after the game has been loaded. Is there any explanation for it? Can it be fixed? Thanks in advance!
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Save games are notorious for being bugged/not completely restoring the previous state. I think @Dr Super Good noted before that timers may lose their periodic flag (maybe this also applies to the periodic event). As for the unit cancelling orders, there can be a lot of reasons. I minimized the usage of dummy units in general but if you really need them, I would advise to not have them owned by CPU/AI but rather empty (neutral?). The AI is modeled for the standard game, having it inside your map often causes unforeseen predicaments or effects.
 
Saved game is loaded
UnitId2String and OrderId2String are bugged also periodic timers like WaterKnight said and also GetLocalPlayer reported by Wietlol. I'm sure Spasmaster you're using OrderId2String in something like this :
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (String((Issued order))) Equal to move
    • Actions
using integers will solve this, but other things needs some investigation in a map
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Or maybe try changing the order cast to Pitlord - Rain of Fire, although i doubt it matters.
I should have mentioned that my ability is actually Blizzard with the visuals of Rain of Fire.
As for the unit cancelling orders, there can be a lot of reasons.
Do you refer to the first bug I mentioned? It was fixed in the linked thread. :) It's the second one that I don't know how to fix.
UnitId2String and OrderId2String are bugged also periodic timers like WaterKnight said and also GetLocalPlayer reported by Wietlol. I'm sure Spasmaster you're using OrderId2String in something like this
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (String((Issued order))) Equal to move
    • Actions
using integers will solve this, but other things needs some investigation in a map
Apologies for the dumb question, but I am uncertain what these custom scripts correspond to in GUI.
I'd assume that UnitId2String is 'Convert Unit Name to String' and OrderId2String corresponds to 'Convert Issued Order to String'?
If so, then it means that any Conditions that check given order (like showcased in your trigger example) don't work?
using integers will solve this, but other things needs some investigation in a map
Using Integers? Do you mean if I get the Order ID instead of the order name?

Even if so, I spawn the dummy, and I order it to cast Blizzard. After the load, the order is not executed correctly. Should I give it the order with its respective ID?

This sounds weird, because I have countless of spells that use dummy units that cast spells, but this one is the only one that I've seen act buggy after a game load.
 
that UnitId2String is 'Convert Unit Name to String' and OrderId2String corresponds to 'Convert Issued Order to String'?
Convert Unit-Type to string = UnitId2String and yes, Convert Order to String = OrderId2String. These two are broken after saved game is loaded.
If so, then it means that any Conditions that check given order (like showcased in your trigger example) don't work?
Yes, after saved game is loaded-it won't work.
Because you said the problem appear only in loaded game thats leads me to this 2 broken natives. However its not directly related to your "blizzard" trigger. It should work well in loaded game.
If the problem is not related to loaded game then maybe your periodical trigger is turned off by other action?
edit: I see you said there are only 1 wave of fire or not at all. Can you canfirm that loaded game causes problems always?, Some debug messages may help to track dummy, etc. (And yes, I'm also not using computer occupied slot for dummy liek Waterknight said.)

Using Integers? Do you mean if I get the Order ID instead of the order name?
Yes but this requires custom script:GetIssuedOrderId() is an integer, can be compared by if GetIssuedOrderId()==851986 then this is "move" number for example. You cannot put this in trigger "condition" section but can be used in actions as custom script.
 
Last edited:
Status
Not open for further replies.
Top