[Solved] Unexplainable Bugs

Status
Not open for further replies.
Level 26
Joined
Oct 2, 2011
Messages
2,490
Hi!
I have been developing my project for some time now, and recently I started having troubles with maps that has been finished and fully working for a long time. Things doesn't go wrong when you launch the map itself, it goes wrong when you transfer to a map via the campaign.

The first time, Bonechiller Burrow recieved a weird bug that when a text message was entered, one out of five functions didn't launch. This function was supposed to open a gate. I added a debug message to see if the trigger itself was even launched, and this is what happened: The debug message showed up, but the gate didn't open. I managed to fix that by adding another function doing the exact same as the last one (this time using a destructible group to open the gate, instead of picking the specific desctructible itself).

Now, there sems to be some issue with the patrolling owls in anther map, called Solen's Sanctuary. I went in game myself, and saw that they indeed did not patrol, so I checked the trigger and tried to see if something had went wrong. Here it is:
  • Start Up
    • Events
      • Player - Player 1 (Red) types a chat message containing debug as An exact match
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Shield (Patrol)))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Set (Picked unit) movement speed to (Life of (Picked unit))
          • Set Pos1 = (Position of (Picked unit))
          • Set Pos2 = (Pos1 offset by (Mana of (Picked unit)) towards ((Facing of (Picked unit)) + 0.00) degrees)
          • Unit - Order (Picked unit) to Patrol To Pos1
          • Custom script: call RemoveLocation (udg_Pos1)
          • Custom script: call RemoveLocation (udg_Pos2)
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Blade (Patrol)))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Set (Picked unit) movement speed to (Life of (Picked unit))
          • Set Pos1 = (Position of (Picked unit))
          • Set Pos2 = (Pos1 offset by (Mana of (Picked unit)) towards ((Facing of (Picked unit)) + 0.00) degrees)
          • Unit - Order (Picked unit) to Patrol To Pos1
          • Custom script: call RemoveLocation (udg_Pos1)
          • Custom script: call RemoveLocation (udg_Pos2)
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Patroler))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Set (Picked unit) movement speed to (Life of (Picked unit))
          • Set Pos1 = (Position of (Picked unit))
          • Set Pos2 = (Pos1 offset by (Mana of (Picked unit)) towards ((Facing of (Picked unit)) + 0.00) degrees)
          • Unit - Order (Picked unit) to Patrol To Pos1
          • Custom script: call RemoveLocation (udg_Pos1)
          • Custom script: call RemoveLocation (udg_Pos2)
      • Custom script: call DestroyGroup (udg_UnitGroup)
I'm pretty sure there is nothing messed up with that trigger, yet, it doesn't work.
Any ideas on what might be wrong?
Any long term solutions to stop this from happening in the future?
 
Any long term solutions to stop this from happening in the future?
I have one solution but you aren't going to like it: you're going to need to stop making them patrol to their current position.

  • Set Pos1 = (Position of (Picked unit))
  • Set Pos2 = (Pos1 offset by (Mana of (Picked unit)) towards ((Facing of (Picked unit)) + 0.00) degrees)
  • Unit - Order (Picked unit) to Patrol To Pos1
  • -------- ^ Pos1 should be Pos2 --------
You will want to apply this change to all 3 unit group loops.
 
Level 26
Joined
Oct 2, 2011
Messages
2,490
What. Whaaaaaaaaaaaaaat. What the hell. This is embarrasing. :oops:
Really, this trigger has worked before, when it shouldn't have worked instead?
Is the campaign actually messing up the triggers as I save it?
Thanks for pointing this out! I will change it and make it right. My confusion why this has worked before though is now even greater; How the hell did it work with the wrong position? Was it changed in a random save?
I gotta investigate.
 
Level 26
Joined
Oct 2, 2011
Messages
2,490
Yeah, it did work. Thanks!
So, this fixed this problem for the moment, but I'm afraid stuff like this may happen again.
This partcular one must have been a mistake from my side. I don't think the campaign editor could happen to edit small snippets of a function like that.
I'll update this thread if it does. :)
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,551
Sorry for the intromission, but did you find out why the gates were not opening? It's probably unrelated, but I remember (nearly a decade ago :xxd:) that sometimes the action to open a gate would fail to actually open the gate, even if the trigger actually ran. The project stopped and I never made sense of it.
 
Level 26
Joined
Oct 2, 2011
Messages
2,490
@Rui
...that sometimes the action to open a gate would fail to actually open the gate, even if the trigger actually ran. The project stopped and I never made sense of it.
This is what happened, yes. The strangepart is though, that it wrkedfine when not being part of the campaign,but as soon it was included, this stopped working.
Sorry, but your guess is as good as mine. :/
 
  • Like
Reactions: Rui
Level 16
Joined
Mar 25, 2016
Messages
1,327
You're using 3 of the same (Unit_Groups) in 1 execution, have the idea in mind that a trigger fires instantly so it will be overlapped.
Trigger actions are sequential. In fact no action from any trigger can run at the exact same time as another action from any trigger.
A trigger must pause/finish, before another trigger can run. A trigger is paused, when you use some kind of waits(wait,timer,...) or if another trigger is executed by "run trigger" or because its event was triggered.
 
Status
Not open for further replies.
Top