The_Chosen_Oreo Corporal
| Subject: Why isn't my trigger working? Wed Aug 17, 2011 1:03 am | |
| Ok.. This is my Fixed Point Sliding System.. But it's not working D: This is the vJass Library for it: - Code:
-
globals rect array r real array f endglobals
library PresetSlideSystem function checkx takes real x, real xn returns boolean if (x != xn) then return false endif return true endfunction
function checky takes real y, real yn returns boolean if (y != yn) then return false endif return true endfunction
function checkequality takes real x, real y, real xn, real yn returns boolean local boolean b1 = checkx(x,xn) local boolean b2 = checky(y,yn) if (b1 != true) then return false endif if (b2 != true) then return false endif return true endfunction
function PresetSlide takes unit u, integer i returns nothing local real x = GetUnitX(u) local real y = GetUnitY(u) local real array xn local real array yn local integer int = 0 loop exitwhen(int == i) set xn[int] = GetRectCenterX(r[int]) set yn[int] = GetRectCenterY(r[int]) loop exitwhen(checkequality(x, xn[int], y, yn[int]) == true) call SetUnitX(u,x+4.00*Sin(0.017453278*f[int])) call SetUnitY(u,y+4.00*Sin(0.017453278*f[int])) endloop set x = GetUnitX(u) set y = GetUnitY(u) set int = int + 1 endloop endfunction endlibrary I then have a GUI Setup Trigger that the person can make for each fixed point sliding section: Thanks... -Oreo
Last edited by The_Chosen_Oreo on Wed Aug 17, 2011 2:01 am; edited 1 time in total | |
|
Serenity09 Moderator
| Subject: Re: Why isn't my trigger working? Wed Aug 17, 2011 1:52 am | |
| oreo when you ask for help you need to say a few things
i'm gonna make you a template and you need to fill it all in
Oreo's template for when he needs help:
1. What's it supposed to do?
2. What does it do?
3. What doesn't it do?
4. Explain what each function in it does (small explanations are fine) | |
|
The_Chosen_Oreo Corporal
| Subject: Re: Why isn't my trigger working? Wed Aug 17, 2011 1:55 am | |
| Ok..
1. It is supposed to slide the triggering unit to a region without letting it get orders (pause unit)
2. It is doing nothing when it is supposed to be sliding
3. It isn't sliding
4. function checkx - checks to see if the units x coordinate is equal to the regions center x coordinate
function checky - checks to see if the units y coordinate is equal to the regions center y coordinate function checkequality - checks both x and y coordinates using checkx and checky
function PresetSlide - slides the unit until checkequality returns true | |
|
Serenity09 Moderator
| Subject: Re: Why isn't my trigger working? Wed Aug 17, 2011 2:13 am | |
| | |
|
The_Chosen_Oreo Corporal
| Subject: Re: Why isn't my trigger working? Wed Aug 17, 2011 4:16 pm | |
| | |
|
Sponsored content
| Subject: Re: Why isn't my trigger working? | |
| |
|