• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Need Help Understanding

Status
Not open for further replies.
Level 2
Joined
Aug 24, 2005
Messages
15
I need help understand the "wheel trigger".

Ill give u guys an example of what i mean, lets say i want a wisp a row of wisps rotate around a selected unit.

Heres a drawing.
o= Wisp
x = object they rotate around

Begining > x o o o o

then the wisps move down slowly rotating around X.

1st quater >
x
o
o
o
o

and it keeps going aroudn the unit until it returns to its start point. then, it loops itself.

I tried to learn using Woots22's tutorial on the "Wheel" but i didnt seem to understand his explanation. Thank you.
 
Level 3
Joined
Nov 5, 2006
Messages
32
Variables. I use WispSpin, a real variable.

Event
Time - Every 0.0X seconds

Condition

Action
Unit - Move XUnitX Instantly to (Position With Polar Offset, Position is the Object, Angle is the WispSpin, Offset is the distance you want the wisp at.
Set WispSpin = WispSpin + X

Repeat that little movement bit for each wisp. If you want them to be ahead of eachother, do WispSpin + X on the angle, or if you want them to be spinning in opposite directions, WispSpin x -1.00

That's what I use anyway. Since you're going clockwise, you might want to replace WispSpin + 1 to - 1 instead.
 
Level 2
Joined
Aug 24, 2005
Messages
15
ok i still need some help. I dont understand how to use variables yet, therefore it might be the reason i dont understand how to do this but, where do i find WispSpin, if it is a real variable, or how do i create it.

also i cannot find Move unit Instantly to position with polar offset.
The closest i have gotten too would be

Action :
Unit - Move (Triggering unit) instantly to (Center of (Region 098 <gen> offset by (0.00, 0.00))), facing (Position of (Triggering unit))

Edit: Nevermind, i have figured out the variable, and i figured out how to get hte action. now i just need to figure out how to make it work. ill post again if i hav any problems

---------------------------------------------------------------------------
Edit 2: since i've encountered a problem again, ill just post it here in the edit

Events
Time - Every 0.05 seconds of game time

Actions
Unit - Move Wisp 0074 <gen> instantly to ((Position of Wisp 0070 <gen>) offset by 256.00 towards WispSpin degrees)

I think i am having troubles with wispin, cause the wisp is not rotating around the main wisp, but its going to the right location.

The wispin is real under variable types and the initial value is -1
 
Last edited:
Level 1
Joined
Jan 9, 2007
Messages
4
Try this... (PS. since this will be leaking a lot of points, I threw in the fix also)

Events
Time - Every 0.05 seconds of game time

Actions
Set zPoint = ((Position of Wisp 0070 <gen>) offset by 256.00 towards WispSpin degrees)
Unit - Move Wisp 0074 <gen> instantly to zPoint
Custom script: call RemoveLocation(udg_zPoint)
Set WispSpin = (WispSpin - 5.00)


In yours I think the only problem was WispSpin wasn't getting set correctly.

{edit for grammar, keyboard is skipping keystrokes =( }
 
Level 8
Joined
Sep 13, 2006
Messages
431
kk it all works, but the custom script is giving me a error, if i remove that action, the trigger works, but im expecting there to b a leak or osmething similar without it. or will it run properly.

Ok, first of all, check to make sure that your variable name matches exactly the name that is in the custom script, following the "udg_"
EX: variable = point , trigger = call RemoveLocation(udg_point)

Next, without the leak fix, your map will most likely lag, even when it is not being played online. Polar offsets are particularly bad. Anyway, the custom script suggested by Tineshia should work.
 
Level 11
Joined
Jul 12, 2005
Messages
764
Keep in mind that the lowest wait time possible in game is 0.27 seconds, and in multiplayer games, it can be substnatially longer, depending on lag, etc.

Uhh... A periodical trigger's engine is not based on waits!! Triggers with the event 'Every x seconds of the game' will shoot accurately, without delay or lag.
 
Level 8
Joined
Sep 13, 2006
Messages
431
Triggers with the event 'Every x seconds of the game' will shoot accurately, without delay or lag.

I assure you that periodic functions, especially ones working with such small periods, will lag if not handled properly.
But you are right, the periodic functions do not rely on waits. My mistake. Good job...

+rep for correcting me
 
Last edited:
Level 2
Joined
Aug 24, 2005
Messages
15
k sorry i had exams and i hav to bring this post back up. the customscript is Still not working.

Untitled Trigger 002
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Set Point = ((Position of Circle of Power 0070 <gen>) offset by 256.00 towards WispSpin degrees)
Unit - Move Wisp 0100 <gen> instantly to Point
Custom script: RemoveLocation(udg_Point)
Set WispSpin = (WispSpin - 5.00)

thats my trigger and i the variable has the exact same name as the text following the udg_

and the wait part is just there for now. i will modify it. i just want the custom script to start working properly then ill test and find the right speed
 
Last edited:
You are missing the "call" in your custom script.

Code:
Untitled Trigger 002
Events
  Time - Every 0.50 seconds of game time
Conditions
Actions
  Set Point = ((Position of Circle of Power 0070 <gen>) offset by 256.00 towards WispSpin degrees)
  Unit - Move Wisp 0100 <gen> instantly to Point
  Custom script: [COLOR="Red"]call[/COLOR] RemoveLocation(udg_Point)
  Set WispSpin = (WispSpin - 5.00)
 
Status
Not open for further replies.
Top