HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Search Trigger - Me failed :/

08-21-2006, 10:07 AM#1
Tidus
Ok, first I wanted to say, I tried it before, but I failed
I need a Trigger for a Whell, like you can find in some Escaper Maps ... I have added an example how it could look like ! So it would great if someone knows anything about what I am searching for. If you never seen what I meaning, here are some more information: Example Picture - 5 lines - 5 units at one line, at it turning right or left way, it does not matter, if the basics are clear, it doesn´t matter if there a 2-8 lines and 2-8 units added, (8 cause it cause lag if there is too much, right ?)
Attached Images
File type: jpgExample.jpg (16.4 KB)
08-21-2006, 10:18 AM#2
Daelin
You need a unit group variable (I called WGroup) and to know the center. I gave the location variable a point but you can change it to whatever fits your needs.

Trigger:
Creation Wheel
Collapse Actions
set center = (Target point of ability being Cast)
Collapse FOR (Integer A) from 1 to 5 do actions
Collapse FOR (Integer B) from 1 to 5 do actions
set TempPoint = (center offset by (Integer B)*100.00 towards (Integer A)*(360/5) degrees)
Unit - Create 1 Wisp at TempPoint
Custom Script: call RemoveLocation(udg_TempPoint)
Unit Group - Add (Last Created Unit) to WGroup
Trigger - Turn On Spin Wheel

Trigger:
Spin Wheel
Collapse Events
Timer - Every 0.05 seconds of the game
Collapse Actions
Collapse Unit Group - Pick Up Every Unit in WGroup and do actions
set TempPoint = (center offset by (Distance Between center and (Position of (Picked Unit)) towards (Angle Between center and (Position of (Picked Unit))+5.00)
Unit - Set Position of (Picked Unit) to TempPoint
Custom Script: call RemoveLocation(udg_TempPoint)

You may switch values to your needs. This is the main idea.

~Daelin
08-21-2006, 10:53 AM#3
Tidus
Unit - Set Position of (Picked Unit) to (center offset by (Distance Between center and (Position of (Picked Unit)) towards (Angle Between center and (Position of (Picked Unit))+5.00)

I do not have this option avaible in my Editor :/ Argh, also I hate my German shit Editor, cause there is half german and half english, and this really sucks, maybe someone can help - btw, thanks Daelin, you gave me the basic, now I have to take a look what exactly it should do - not working yet, but I am on it.
08-21-2006, 10:57 AM#4
Daelin
Well... Isn't there a trigger to set an unit's position to something? Then you can modify the point to a polar projection with the parameters I gave above (center, distance between blah blah and angle between blahblah). Distance and angle are both real functions. :) Good luck!

~Daelin
08-21-2006, 12:41 PM#5
Tidus
ok, it works, but I just need to know one more thing, cause I tried it by my own and I crashed my PC :/ mass lag, so what parameters exactly changes what ? Cause now I got the Trigger, thanks to Daelin, but I do not really get it, what´s going on, so please can anyone describe what stands for what, that would be great !

And please, do not explain me something like that :
Timer - Every 0.05 seconds of the game

Edit:What I need to know:
  • What changes numbers of lines
    What changes numbers of units in one line
    What changes the direction on how the wheel is turning around ( left/right)
08-21-2006, 01:32 PM#6
Daelin
Actually I forgot to mention that I did not include memory leaks removal into the coding so yeah, you have thousands of leaks there. My mistake. To remove the leak make a global variable "TempLoc". I modified the rest in the first post.

Number of lines is modified by the second value of the (For Integer A). Practically if you want six lines go from 1 to 6 but then change into the polar offset the angle to (Integer A)*(360/6). The number of wisps is influenced by the second for. Practically going from 1 to 6 for it would create 6 wisps per wheel.

The rotation is influenced by the second trigger, depending on how much you add or substract to the angle. Substracting makes the wheel rotate clockwise (anti-trigonometric) while adding makes the wheel rotate anti-clockwise (trigonometric). Hope it is clearer now and sorry for the leaks stuff. I completely forgot!

~Daelin
08-21-2006, 02:01 PM#7
Tidus
Quote:
Originally Posted by Daelin
Actually I forgot to mention that I did not include memory leaks removal into the coding so yeah, you have thousands of leaks there. My mistake. To remove the leak make a global variable "TempLoc". I modified the rest in the first post.

Number of lines is modified by the second value of the (For Integer A). Practically if you want six lines go from 1 to 6 but then change into the polar offset the angle to (Integer A)*(360/6). The number of wisps is influenced by the second for. Practically going from 1 to 6 for it would create 6 wisps per wheel.

The rotation is influenced by the second trigger, depending on how much you add or substract to the angle. Substracting makes the wheel rotate clockwise (anti-trigonometric) while adding makes the wheel rotate anti-clockwise (trigonometric). Hope it is clearer now and sorry for the leaks stuff. I completely forgot!

~Daelin

You forgot ? I do not care, cause you were the one who gave me hope that my map will be finished someday Ok, I going to fix and get some more experience, I hope there won´t be any understanding problems Again, thanks .
08-22-2006, 11:05 AM#8
Tidus
Trigger:
set TempPoint = (center offset by (Integer B)*100.00 towards (Integer A)*(360/5) degrees)

I can´t choose "Integer B" and "Integer A" in this function, what shall I do ?
Random real number between 0 and 5 ? I got a wheel, but the units aren´t in line, there were in random positions around center and moving around,but not in lines What´s the problem ? Can you help me again
08-23-2006, 12:16 PM#9
Daelin
Actually you can, but the expression allows only real values. Just go to Conversion - Integer to Real and use as a parameters (Integer A), respectively (Integer B).

~Daelin
08-23-2006, 02:19 PM#10
Tidus
Trigger:
Wheel
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Set center = ((Center of PlaceForWheel <gen>) offset by (0.00, 0.00))
Collapse For each (Integer A) from 1 to 2, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to 5, do (Actions)
Collapse Loop - Actions
Set TempLoc = (center offset by ((Real(Integer B)) x 100.00) towards ((Real(Integer A)) x (360.00 / 2.00)) degrees)
Unit - Create 1 Portal Guard for Player 12 (Brown) at TempLoc facing 360.00 degrees
Custom script: call RemoveLocation(udg_TempLoc)
Unitgroup - Add (Last created unit) to WGroup
Trigger - Turn on Spin Wheel <gen>

Trigger:
Spin Wheel
Collapse Events
Time - Every 0.08 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in WGroup and do (Actions)
Collapse Loop - Actions
Set TempLoc = (center offset by (Distance between center and (Position of (Picked unit))) towards ((Angle from center to (Position of (Picked unit))) + 5.00) degrees)
Unit- Move (Picked unit) instantly to TempLoc, facing center
Custom script: call RemoveLocation(udg_TempLoc)

Still not working, where is the bug ? Sorry, if there is a wrong translation :/
08-23-2006, 02:54 PM#11
Fireeye
I attached a working boulder system for you, btw. what i already mentioned in the first post Daelin, i won't ever use angle between 2 points, because the boulders goes crazy when they are blocked by an object or something else.
What my System contains:
- Unitgroup : To store the units
- 3 Real: So the units don't go crazy and to store the distance and angle
- 2 Point: To prevent leaks and to set the center
When you want to make more than 1 wheel replace the old one or use an array.
(In this example i used workers )
Attached Files
File type: w3xBouldersystem.w3x (13.3 KB)
08-23-2006, 04:24 PM#12
Tidus
Ok, thanks to Daelin, I finaly got it, yepppay !

Well,Fireeye - thanks for your map, maybe you can create an Tutorial for it, or anything else ! Thanks for it, too.

So thanks for HELP, now I may finsih my map :)