Very strange trigger problem? Expiring trigger?

WankerOne

New Member
Reaction score
0
Guys,

I have some sort of wierd phenomana going on with a trigger here.
There is no need to look to deeply into my trigger other then a couple things.

This trigger has 2 FOR loops in it... one with integer A and one with Integer B

IF you look at my trigger, it creates floating text at middle of the 500 loop, after the 24 loop.

So if I ran this trigger, I should get 500 different outputs on the screen

The code in the 24 loop computes alot of SIN and COS floating point calculations, so it is somewhat math intensive.


Whenver I run this code I dont get 500 outputs.....I only get like 60.....
If I change the 24 loop to 12 I get more outputs...If I raise the 24 loop to 50 or so....I get less outputs like 20.....

Basically.....Its like the trigger times out after awhile??? Can a trigger only run for a givin period of time before it expires?
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
Maybe the trigger runs too fast for you, and ends before you know it.

Might have to put in waits inbetween certain actions.

Post the trigger please.
 
W

WankerMan

Guest
Here is my trigger......
sorry my i couldnt get my email to work on my other account
 

Attachments

  • trigger.JPG
    trigger.JPG
    143 KB · Views: 253

seph ir oth

Mod'n Dat News Jon
Reaction score
262
A very messy trigger!

Yeh, I'm sure that's all run at the same time really quickly. Does it make any text at all?
 
W

WankerMan

Guest
yes it makes text...but for some reason the amount of text i get is depends on how big the FOR 50 loop is...... which should have absolutley NOTHING to do with it.
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
What's in the For 50 loop? Is it big?

If it's big, it slows down how fast the floating text is displayed due to the processing speed.

So anywho, wanna show me the WHOLE trigger? With the if/then/else's?

EDIT: And explain what you are tryin to do!
 
W

WankerMan

Guest
how can i post the trigger in a scrolling box...its kinda big
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
...its kinda big

Take more than one picture if needed.

My guess is that the trigger is timed out cause of your sin/cos calculations and how fast you are trying to process em, but I'll verify that when i see the code...
 
W

WankerMan

Guest
I am making a golf game... I am sampling the height of the terrain in a 360 degree ring around a golf ball
at a distance of 100 at 15 degree intervals.....
I loop the entire trigger 500 times becasue I want to see how long it takes to calculate all the data I need to make the gold ball roll down the hill realisitcally.....

After trying to view the floating text.. I am now wondering if the tirgger is even completely running.

I determine which direction the golf ball will roll by summing all the vectors after they are converted to rectangluar then converting the final vector back to polar.









Code:
Calculate Vector
    Events
        Whenever I type "GO"
    Conditions
        TerrainEngineOn Equal to 1
    Actions
        For each (Integer B) from 1 to 500, do (Actions)
            Loop - Actions
                Set FinalYRectangular = 0.00
                Set FinalXRectangular = 0.00
                Set HeightCalculatePoint = (Position of Wisp 0000 <gen>)
                Trigger - Run HeightCalculator <gen> (ignoring conditions)
                Set HeightAtWisp = CalculatedHeight
                For each (Integer A) from 1 to 24, do (Actions)
                    Loop - Actions
                        Set tempPoint = ((Position of Wisp 0000 <gen>) offset by 100.00 towards ((Real((Integer A))) x 15.00) degrees)
                        Set HeightCalculatePoint = tempPoint
                        Trigger - Run HeightCalculator <gen> (ignoring conditions)
                        Set tempheightOffset = (CalculatedHeight - HeightAtWisp)
                        Set XRectangulars[(Integer A)] = (tempheightOffset x (Cos(((Real((Integer A))) x 15.00))))
                        Set YRectangulars[(Integer A)] = (tempheightOffset x (Sin(((Real((Integer A))) x 15.00))))
                        Set FinalXRectangular = (FinalXRectangular + XRectangulars[(Integer A)])
                        Set FinalYRectangular = (FinalYRectangular + YRectangulars[(Integer A)])
                                                                Set FinalVectorPoint = (Point(FinalXRectangular, FinalYRectangular))
                Set FinalVectorAngle = (Atan((FinalYRectangular / FinalXRectangular)))
                Floating Text - Create floating text that reads (String((Integer B))) at ((Position of Wisp 0000 <gen>) offset by (((Real(counter)) x 20.00), 0.00)) with Z offset 0.00, using font size 4.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                Set FinalVectorStrength = (Square root(((Power(FinalXRectangular, 2.00)) + (Power(FinalYRectangular, 2.00)))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        FinalXRectangular Greater than 0.00
                        FinalYRectangular Greater than 0.00
                    Then - Actions
                        Set FinalVectorAngle = (180.00 + FinalVectorAngle)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        FinalXRectangular Greater than or equal to 0.00
                        FinalYRectangular Less than or equal to 0.00
                    Then - Actions
                        Set FinalVectorAngle = (180.00 + FinalVectorAngle)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        FinalVectorAngle Less than 0.00
                    Then - Actions
                        Set FinalVectorAngle = (360.00 + FinalVectorAngle)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        lastVectorAngle Not equal to 0.00
                        (Abs((FinalVectorAngle - lastVectorAngle))) Greater than or equal to 1.00
                    Then - Actions
                        Set FinalVectorAngle = lastVectorAngle
                        Set FinalXRectangular = lastFinalXRectangular
                        Set FinalYRectangular = lastFinalYRectangular
                        Game - Display to (All players) the text: Big Change
                    Else - Actions
                Set lastVectorAngle = FinalVectorAngle
                Set lastFinalXRectangular = FinalXRectangular
                Set lastFinalYRectangular = FinalYRectangular
                Set CurrentBallXVECTOR = FinalXRectangular
                Set CurrentBallYVECTOR = FinalYRectangular
                Unit - Set Wisp 0000 <gen> movement speed to 400.00
        Game - Display to (All players) the text: (String(FinalXRectangular))
        Game - Display to (All players) the text: (String(FinalYRectangular))
        Game - Display to (All players) the text: (String(FinalVectorAngle))
        Game - Display to (All players) for 0.10 seconds the text: (String((Current movement speed of Wisp 0000 <gen>)))
        Game - Display to (All players) the text: (String(FinalVectorStrength))
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
Whatever you are trying to do, there's probably a better way to process those if/then/else's...

Anywho, you say that it "times out"...Does that mean the smaller loop does work for a little bit, but not all the way through?

If so, add waits in front of any sin/cos/atan processes. Not big waits, just .1 to .2 waits and see what happens.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
I suggest you use game messages instead of floating text. At least to check if your trigger is running.

Problem with floating text, they can stack on top of each other. Although it might seem only to appears once, it might be 20 floating text stacked together. If your unit: Wisp 0000 <gen> moves leftwards, stacking of the text will happen.

In addition, if your Wisp 0000 <gen> is not moving, you would need a space of 10,000 units to cover your 500 floating text; that would be roughly 100 ziggurats lining up one after another... Hopefully your map is big enough to hold them.

ADD:
Make sure you do not have any "Skip remaining actions" in the triggers, that will simply stop the trigger.
 
W

WankerMan

Guest
I will write a MUCH simpler version of my trigger that illustrates the flaw with 2 or 3 lines of code.

OH guys..... Explain this


This loop should create 500 lines of 24 counts.....

Why does it quit barely through the loop and where the hell did 32 come from?

Calculate Vector
Events
Player - Player 1 (Red) types a chat message containing go as An exact match
Conditions
Actions
For each (Integer B) from 1 to 500, do (Actions)
Loop - Actions
For each (Integer A) from 1 to 24, do (Actions)
Loop - Actions
Floating Text - Create floating text that reads (String((Integer B))) at ((Center of (Playable map area)) offset by (((Real((Integer A))) x 20.00), ((Real((Integer B))) x 20.00))) with Z offset 0.00, using font size 6.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency

im think this is kinda the same phenomena I am seeing on my vector trigger
 

Attachments

  • trigger2.JPG
    trigger2.JPG
    168.5 KB · Views: 258

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
500x24 = 12000... just looping that much without any action is already over the thread execution limit.

Try adding a "wait 0.0 seconds" after the "24" loop.
If that doesn't do it either, use a periodic trigger that runs 500 times.
 
W

WankerMan

Guest
I experimented with my vector trigger.....
I can get it to loop 67 times and display DONE after it finishes


If I change the loop to 68 times.... it will not complete....?

Am I reaching a thread limit?
 

WankerOne

New Member
Reaction score
0
Question for Ace

Aceheart,

My Array is a 6000 Real type array.

I need to populate this array with data that is calculated with a somewhat intensive inner loop. I am using sin and cos ,converting a vector to rectangular so that a sample of vectors can be added then coverted back to polar to extract the resultant angle. I then need to store these calculated angles in my array

How would you recommend this be done?
All my loops seem to over exert the trigger engine
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
Could you post your trigger or...some sort of the trigger?

...and may I ask why you only refer to AceHart? :D
 

WankerOne

New Member
Reaction score
0
For each (Integer A) from 1 to 24, do (Actions)
Loop - Actions
Set tempPoint = ((Position of Wisp 0000 <gen>) offset by 100.00 towards ((Real((Integer A))) x 15.00) degrees)
Set HeightCalculatePoint = tempPoint
Trigger - Run HeightCalculator <gen> (ignoring conditions)
Set tempheightOffset = (CalculatedHeight - HeightAtWisp)
Set XRectangulars[(Integer A)] = (tempheightOffset x (Cos(((Real((Integer A))) x 15.00))))
Set YRectangulars[(Integer A)] = (tempheightOffset x (Sin(((Real((Integer A))) x 15.00))))
Set FinalXRectangular = (FinalXRectangular + XRectangulars[(Integer A)])
Set FinalYRectangular = (FinalYRectangular + YRectangulars[(Integer A)])



I need to make this loop more then 67 times
(perferebly 200)

=(
 

WankerOne

New Member
Reaction score
0
here is the height calculate engine

function Trig_SetHeightAtWisp_Actions takes nothing returns nothing
set udg_CalculatedHeight = GetLocationZ(udg_HeightCalculatePoint)
endfunction

//===========================================================================
function InitTrig_HeightCalculator takes nothing returns nothing
set gg_trg_HeightCalculator = CreateTrigger( )
call TriggerAddAction( gg_trg_HeightCalculator, function Trig_SetHeightAtWisp_Actions )
endfunction
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top