Trigger Loop - CRASH

Shadowy Fear

I have returned
Reaction score
44
Hmm, for my as-of-now undisclosed WIP, I decided to create a third-person perspective, eye-level camera. As creating one for each of the ten players would be laggy and redundant, I decided to loop it all into one trigger. The trouble is, it crashes the whole game now. Can anyone explain why/fix the problem? :p
This is the variable setting trigger (only have player one - red set right now).
Code:
E:Time - Game Time Elapsed is 0.00 seconds
C: N/A
A: Set PlayerCameraTarget[1] = Paladin 0001 <gen>

This is the trigger that does the camera.
Code:
E: Time - Every 0.6 seconds of game
C: N/A
A:Camera - Pan camera for (Player((Integer A))) to (Position of PlayerCameraTarget[(Integer A)]) over 0.10 seconds
Camera - Set (Player((Integer A)))'s camera Distance to target to 450.00 over 0.10 seconds
Camera - Set (Player((Integer A)))'s camera Angle of attack to 80.00 over 0.10 seconds
Camera - Set (Player((Integer A)))'s camera Height Offset to (10.00 + (Current flying height of PlayerCameraTarget[(Integer A)])) over 0.10 seconds
Camera - Set (Player((Integer A)))'s camera Rotation to (Facing of PlayerCameraTarget[(Integer A)]) over 0.10 seconds
Any help would be appreciated :p :>) Or at least what I have done wrong here.

Oh, and I am going to change the paladin; each player will recieve a custom hero of mine (and a randomly picked one of those will have an extra, custom ability).
 
P

PwnThePanda

Guest
I think you have to change it to .01 or somthing greater then 0 for the variable trigger.
 

Cres

New Member
Reaction score
25
change time elapsed to 0.6 seconds i think, maybe im not very sure i remember reading something about not using 0.00 seconds elapsed (is that what you mean panda?)
 
P

PwnThePanda

Guest
Yeah, thats what I mean. Becuase wc crashes if it has like 7000 triggers at once. Like if you send a unit to a certain region but when they go to that region they go back to the other region so they keep on transporting back to each pther would make wc crash. Now if you have every 0 secounds, they would be basically less then .00000000000000000000000000000001 of a secound. It would do it to many times and cause it to crash. This is my Theory, notice its my THEORY. I have no clue if what I said is fact but I believe that is why its crashing.
 

Shadowy Fear

I have returned
Reaction score
44
Ok, thanks :>)

I'll go test it right now.

Lol, the variable - setting triger was only supposed to fire once :p Hmm ...

Wonder what would happen if I made it find the square root of pi LOL!
 

Cres

New Member
Reaction score
25
shadowy, just for the record, you cant pi is an imaginary number...(ish)
 

Shadowy Fear

I have returned
Reaction score
44
Lol, is it?

Grrr, still crashed >_<

Something like 'memory could not be accessed' on error acknowledgement popup.

Do I need to set the variables for all the other players (who aren't even included yet) so that the game can 'access' something?

Lolol, you will (hopefully) love my new WIP :p :>) It will be very ... spooky :p and the camera will play a critical role there.
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Shadowy Fear said:
Do I need to set the variables for all the other players (who aren't even included yet) so that the game can 'access' something?

Yes, or check the box "Automatically create unknown variables" in the Map Options menu.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
@SilverHawk: That's ONLY for copying / pasting triggers from one map to the other.

@SF: The crash ahs nothing to do with the initlization trigger, but the camera trigger. It's doing it over and over, and cmaera's tend to lag alot if your constantly doing it. So, every 0.06 seconds, it's setting it to a certain distance for 0.10 seconds, but then resets it. That's where the crash lies.
 

Cres

New Member
Reaction score
25
conan you r getting careless?
E: Time - Every 0.6 seconds of game
sry, I just needed to do that... bladestorm is really making me mad...
maybe the camera is kinda messed up though... try making it pan 0.01 seconds? just my idea...
 

Shadowy Fear

I have returned
Reaction score
44
Meh, that sort of defeats the entire purpose of MAKING an initilization trigger >_< Lol :p

I have it for 0.6 seconds, but I was hoping that by looping it into a trigger, I could reduce the lag.

Is there another way to do that without the lag? If I convert it to JASS as it is right now, will that help any? I'll change it to 0.01 or whatever instead.

This is just out of curiosity, but will converting ANY trigger to JASS make it run more efficiently? I mean just clicking on it and converting it to custom text, not rewriting it to be more efficient.

Hmm, do my [Interger A] things work ok? I am rather confused on variable array compatability ... :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> will converting ANY trigger to JASS make it run more efficiently?

Not in and by itself, since the game does that already anyway,
but you can work a bit on it.

For conditions, for example, I noticed a lot of things like:
IF not Function(Value) == true
THEN
return false
ENDIF
return true

Compare that with:
return Function(Value)

Guess which one runs faster?

Of course, the "win" is only ever some micro-seconds, or less.
But, if it's just running "often enough"...
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Well, if your waiting 0 seconds, then jsut set it to Map Initilization.

And another thing, I jsut looked at again, from skimming through it and I noticed you have things set to Integer A. Integer A and B are only used for loops, NOTHING else.
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Ok...Talked to you and figured out what you want...

Code:
Follow unit
    Events
        Time - Elapsed game time is 5.00 seconds [b]//Or whenever[/b]
    Conditions
    Actions
For each (Integer A) from 1 to 10, do (Actions)
    Loop - Actions
        Camera - Pan camera for (Player((Integer A))) to (Position of                   PlayerCameraTarget[(Integer A)]) over 0.10 seconds
        Camera - Set (Player((Integer A)))'s camera Distance to target to 450.00 over 0.10 seconds
        Camera - Set (Player((Integer A)))'s camera Angle of attack to 80.00 over 0.10 seconds
        Camera - Set (Player((Integer A)))'s camera Height Offset to (10.00 + (Current flying height of PlayerCameraTarget[(Integer A)])) over 0.10 seconds
        Camera - Set (Player((Integer A)))'s camera Rotation to (Facing of PlayerCameraTarget[(Integer A)]) over 0.10 seconds
        [b]Camera - Lock camera target for Player 1(Red) to (unit), offset by (0.00, 0.00) using Default rotation
        Camera - Lock camera target for Player 2(Blue) to (unit), offset by (0.00, 0.00) using Default rotation[/b]
[b]//Continue for all players / units[/b]
 

Shadowy Fear

I have returned
Reaction score
44
Already done :p I moved those into another variable setting trigger that runs after map initilization at .05 seconds (I will probably space out my init triggers over .5 seconds to reduce lag).

Grrr, for your testing, conan, something in Solta's blink lagged my system out so much I thought it had completly frozen. I naturally pressed ctrl alt delete to get out of it, but then that started ... copying itself over and over again every time I tried to close it, and I finally had to manually turn off my computer :/.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top