Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Wandering Computer Units and Non-firing Trigs
Wandering Computer Units and Non-firing Trigs
Oct 29 2008, 12:06 pm
By: Elvang  

Oct 29 2008, 12:06 pm Elvang Post #1



Problem 1: I currently have a terrain maze made of square dirt on twilight, with the walls being a square from a water doodad. Within this maze I have 4 different units belonging to the same computer player and 1 location encompassing the entire maze; the maze is surrounded by water squares so nothing can leave it by walking. My current trigger is a Set Unit Order to: Junkyard Dog at location over maze, and it fires every 12 seconds. However, only 3 of the units will initially wander the maze and I have to use a move order to get the 4th to begin wandering. After a short period of time the units will stop wandering regardless of the Junkyard Dog order. What am I doing wrong here or is there a better way to have computer units wander an area randomly?

Problem 2: I have a trigger like so.
Code
Trigger("Player 2"){
Conditions:
    Deaths("Player 1", "Alexei Stukov (Ghost)", At least, 73);
    Switch("Fruit 1", not set);

Actions:
    Set Switch("Fruit 1", set);
    Preserve Trigger();
    Comment("Trigger Fruit 1 Spawn");
}

Simple enough, except once 73 deaths have been reached, nothing happens. I've made test triggers where the only condition was a death condition and I've changed the unit whose death count I am testing yet it still won't fire. Any idea whats wrong here? Theres only 2 triggers that increase the death count of the unit I chose, and only 2 triggers that test for it.

Did I use the trigger codes wrong or is it just my browser?

Post has been edited 2 time(s), last time on Oct 29 2008, 4:40 pm by Elvang.



None.

Oct 29 2008, 1:03 pm Devourer Post #2

Hello

as I see it everything is right....
but yunkard is... a bad idea... only sometimes attacks; causes lagg if there are "too" many units
you should make orders with random switches....

btw: I did not completly understood your problem.... some units aren't firing so fast, and some aren't moving??
hint: as more yunkard triggers, such more movement will they have...



Please report errors in the Staredit.Network forum.

Oct 29 2008, 2:11 pm Elvang Post #3



All the units in the maze are invincible, I meant the trigger was going off every 12 seconds. The problem is that they'd just stop in their tracks after a little bit of time and ignore further Junkyard Dog commands.

Post has been edited 1 time(s), last time on Oct 29 2008, 2:37 pm by Elvang.



None.

Oct 29 2008, 2:16 pm Devourer Post #4

Hello

ummm... I think as soon as you have activated yunkard, you won't be able to disable it



Please report errors in the Staredit.Network forum.

Oct 29 2008, 3:07 pm Elvang Post #5



I'll try out a randomized switch system and about 16 locations for the random movement problem. Any idea on problem number 2?



None.

Oct 29 2008, 3:10 pm Devourer Post #6

Hello

the trigger code is bugged... it also looks that... ugly... @ me

souu... explain "problem" nr2 more please... can't understand it...
what why when happens what?



Please report errors in the Staredit.Network forum.

Oct 29 2008, 3:22 pm Elvang Post #7



Basically I have a trigger that is increasing the death count of a unit everytime event a happens (fairly often). Then I have a trigger that tests for when that death count hits 73, except it never activates. I know the first trigger is working because it also does a bunch of other stuff. I've tried changing what unit the deaths are for, among other things.

Event A happens
Trigger 1 increase unit X death count by 1
The above happens 73 times
Trigger 2 tests unit x death count for 73
Nothing happens...?



None.

Oct 29 2008, 3:38 pm NudeRaider Post #8

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Basically if you can make certain the deaths reach 73 you can be sure a condition for at least 73 deaths WILL fire.
So either the trigger fires without you noticing (considering the severity of the action you chose this is unlikely :P - unless you chose wrong player or something like that)
or another trigger resets the deaths before the trigger can fire. Very likely when you say another trigger does stuff once reached.
For testing you could use minerals, score or gas as condition because you can see that ingame.
If all else fails use ScmDrafts text editor and copy all triggers to notepad where you can use "find" function to spot all triggers that might alter your death counter.

About junkyard dog:
Executing junkyard dog over and over can cause bad effects. Make sure this action is not preserved.




Oct 29 2008, 4:02 pm Elvang Post #9



I went through and did the notepad suggestion, the only triggers I found that mention the unit death in question were ones I knew about. I've also tried changing which unit death is being increased for only the trigger increasing it and the one checking it and it still doesn't detect when it hits 73. No need to add an increase mineral trigger as the one that increases the death count also removes a unit at the same time.

Incidentally though the one trigger that does set it to 0 has attracted my attention in the past. One of the conditions is a switch, and I know its not misfiring as it changes a large portion of the map. The first action that trigger performs is displaying the text "Generating level..."; for some reason it displays that text twice even though there is only one action that even uses that string. I know the trigger isn't firing twice because it also adds a single mineral for Player 1.

EDIT: Didn't think to do this before, but I've edited out this from the trigger mentioned above.
Code
Set Deaths("Player 1", "Alexei Stukov (Ghost)", Set To, 0);
Didn't make a difference. While I was at it I replaced the 0 with 73 and re-enabled it; I've tried setting the switch and the death count to something that should cause the trigger to fire and still nothing happens.

Post has been edited 2 time(s), last time on Oct 29 2008, 5:36 pm by Elvang.



None.

Oct 29 2008, 4:52 pm Biophysicist Post #10



Are you sure "Fruit 1" isn't being Set somewhere else by mistake?



None.

Oct 29 2008, 5:08 pm Elvang Post #11



Yea, I'm sure. Fruit 1 only gets set by the very trigger that isn't firing. I've even gone so far as to put a set switch to clear action for it in the initialization trigger.



None.

Oct 29 2008, 5:46 pm NudeRaider Post #12

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Well there sure is some mistake you're overlooking. You jsut have to find it.
Don't worry those things happen to me too sometimes.
What I do is narrow down the variables. I change triggers, add new ones to the point where i know exactly when what variable has which value.
To make sure a trigger is firing, when the actions are not necessarily obvious use extra text output. If the trigger is owned by a comp then create a unit over unwalkable terrain. The "cannot create unit" error is your indication that it fired. Renaming the unit is useful to determine which trigger just fired.
It's also a good idea to remove conditions so you know which condition causes the problem. Sometimes you get surprised. ;)
For example add 2 triggers:

C: Fruit is cleared
A: Display "Fruit clear!"
A: Preserve

C: Deaths of Alexei is at most 73
A: Display "Alexei has still one of his 73 lives"

Your screen will be spammed with messages, but you do know what is happening. Very useful.
Maybe you have to press screenshot in the right moment to get clarity whats going wrong when you have a lot of triggers with testoutput.

Or alter the condition to at least 0 deaths. The trigger should fire right when the map starts. Increase the number and check if it still fires.

Oh and don't be so sure when you say "I don't need to change x because I know blah." Testing is the ONLY way to find those bugs.




Oct 29 2008, 6:26 pm Elvang Post #13



I've gone through and somehow gotten to the point where I now know the trigger is firing but one of the actions isn't being completed. The kill all units action went off during the last test so the conditions are now being met, no problem. Now it won't complete a create unit command; first thought was maybe I couldn't spawn units(kerrigan) for that player(11) but I tried changing both of those and it still doesn't create the unit. Tried to get a 'cannot create unit at x,y' message with no luck. So now the trigger fires, except for the create unit action... Went back and re-enabled the kill all units action just to make sure it was still firing.

EDIT: I think I'm going to get some sleep, I'm making too many mistakes and they are taking more time than I'd like to fix. Still not sure what I did to partially fix that trigger; added some messages to see the state of the switch and the death count, and went over what triggers were related to this one again, then bam, it hit 73 and the trigger fired sans one create unit(???). Going to go over what I was trying to do with a fresh eye in a few hours.

E2: I also seem to be leaving words out as I type...

Post has been edited 3 time(s), last time on Oct 29 2008, 7:11 pm by Elvang.



None.

Oct 29 2008, 10:44 pm NudeRaider Post #14

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

You cannot create units for neutral players (players 9+).
Create them for any player 1-8 and give them to P11.




Oct 30 2008, 3:34 am Elvang Post #15



Alright, I've gone through and cleaned up my triggers; all the features of my map seem to be in working order. It appears I'm going to have to redo all of the triggers relating to the wander AI though to get satisfactory movement, which is going to take awhile.

Thanks for the help guys. :thumbup:



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
Please log in to shout.


Members Online: Zycorax