HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

y doesnt this work

04-01-2008, 03:03 AM#1
gallin
i was wondering y this doesnt work
Trigger:
movement trigger
Collapse Events
Time - Every 0.04 seconds of game time
Conditions
Collapse Actions
Unit - Move Planet near sun 0002 <gen> instantly to ((Position of Sun 0001 <gen>) offset by (Distance between (Position of Sun 0001 <gen>) and (Position of Planet near sun 0002 <gen>)) towards ((Angle from (Position of Sun 0001 <gen>) to (Position of Planet near sun 0002 <gen>)) + 3.00) degrees), facing Default building facing degrees
04-01-2008, 03:05 AM#2
Ammorth
Whats happening? You have to tell us more than "this doesn't work".
04-01-2008, 03:07 AM#3
gallin
o well its sopposed to be an orbiting trigger that makes the planet orbit the sun GASP WHO WOULD TIHNG A PLANET ORBITS A SUN well when i try and test it the planet just goes poof and disappears
04-01-2008, 10:04 AM#4
Gorman
please use the [GUI ] wraps when posting code, it makes it a lot easier to understand
04-02-2008, 01:12 AM#5
gallin
does that help?
04-02-2008, 06:57 AM#6
The Elite
Quote:
y doesnt this work
y0\/ phA1| 3ng|1sH S1r
04-02-2008, 07:05 AM#7
Alexander244
Is the movement speed of the 'Planet near sun' zero?

Try pasting this in your map header:
Collapse JASS:
function MovePlanet takes unit sun, unit planet returns nothing
    local real x = GetUnitX(sun)
    local real y = GetUnitY(sun)
    local real xd = GetUnitX(planet)-x
    local real yd = GetUnitY(planet)-y
    local real d = SquareRoot(xd*xd+yd*yd)
    local real a = Atan2(yd, xd)+0.05236
    call SetUnitX(planet, x+Cos(a)*d)
    call SetUnitY(planet, y+Sin(a)*d)
endfunction
And then under actions do:
Trigger:
Custom script: call MovePlanet(sun value, planet value)
Where the sun value and planet value can be got from converting your original to JASS. They will be something like gg_unit_h000_0000.
04-02-2008, 08:57 AM#8
Gorman
I dont see why u dont just use a variables and do it like:

Trigger:
Collapse Events
Time - Every 0.04 seconds of game time
Conditions
Collapse Actions
Set Angle = Angle + 3
Unit - Move Planet near sun 0002 <gen> instantly to ((Position of Sun 0002) offset by (Radius) towards (Angle) degrees), facing Default building facing degrees
04-04-2008, 12:09 PM#9
[VDM]Amn
i did that on my map

http://www.epicwar.com/maps/48394/

Example:

Trigger:
event - Every 0.4 seconds
actions
set r_Circle = Angle between Sun_unit and Planet_Unit + 1.00
Unit - Move Planet_Unit instantly to (position of(Sun_Unit) offset by 300 towards r_Circle degrees)