HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I wanna make this guy jump... Help!

06-25-2003, 08:13 PM#1
Markus3832
Ok... i kinda want to make a guy jump so i tryed by doing this. I ofcourse changed his movement type to hover so he couldfly up and down but it still doesent work... I suck at triggers... Help!

trigger 1:

Events:
Map init

Conditions:
-

Actions:
If ((issued order) equal to (order stop))) then do Run Trigger (Trigger 2) else do nothing




trigger 2:

Events:
-

Conditions:
-

Actions:
Animation - Change flying height for "unit" to "height" at rate "rate"
Wait - 0.5 seconds
Animation - Change flying height for "unit" to "height" at rate "rate"
06-25-2003, 08:23 PM#2
Mr. Thermistor
int flyheight
int buffer

Animation - change (unit) flying height to sin(real(buffer)) * real(flyheight)
wait 0.1 seconds
set buffer = buffer+1
if (buffer less than 90) then (trigger - run this trigger) else set buffer = 1
06-25-2003, 08:57 PM#3
Markus3832
i made a trigger that did exactly what you said to me but what does it do? How does it work? I made the two variables and excactly as you told me to but i don't understand how it works...
06-26-2003, 02:27 AM#4
Guest
Mr. Thermister is just using a sine curve to make it so the unit doesn't go up and down in a linear fashion, which would result in a sharp turn at the top. The sin curve is roughly illustrated in the attached picture. It goes up to 1 at 90, so that is basically interpreted as a percent and multiplied with the maximum height, leaving you with a nice curve.

If that didn't work, make sure you have the flyheight to something reasonable, like 200 or so, and buffer with an initial value of 1. Also check that you have events and conditions in place, namely "A unit owned by player 1-12 is issued an order with no target" and "issued order equal to stop"

So, the whole trigger:

Events:
A unit owned by player 1 is issued an order with no target
(Repeat this for players 1-12)

Conditions:
(Issued order) is equal to order(stop)

Actions:
Animation - change (unit) flying height to sin(real(buffer)) * real(flyheight)
wait 0.1 seconds
set buffer = buffer+1
if (buffer less than 90) then (trigger - run this trigger) else set buffer = 1


And in your variable editor, you'll have
Integer flyheight; Initial value=200
Integer buffer; Initial value=1
06-26-2003, 05:44 AM#5
c0nnick
Um yea... anyway, Id like to inform u that u cant change fly height on hovering units, only flying units
06-26-2003, 09:11 AM#6
Markus3832
ok i'll try that and... In the flying heights trigger it says you can only change it for hover and flying... When i tryed put the unit on fly i couldn't see it anymore... I don't know what happened to it...
06-27-2003, 04:31 AM#7
leppy
hmm i tried what you guys said, but i cant get it to work. i have...

unit is issued an order

order equal to stop

change unit fly height to sin(height x buffer) at 0.00
wait 0.1 seconds
set jump = jump+1
if jump less than 90 than do (run this trigger) else do set jump = 1

i did this with the hero as a flying unit, and then he is invisible at the start of the game, but once you press stop he becomes visible, but doesn't jump. i think i was raising up and down in the air when i walked after i pressed stop, but it wasnt doing it like it was supposed to, and only raised while i was moving.... so, i added:

order (ordered unit) to move to position of ordered unit offset by 256 degrees towards (ordered unit facing) degrees

this i thought would make him jump forward, but he still doesnt "jump" and now he just moves forward... emote_confused

let's get darklink in here, hes makin some cool jump effects with his SSBM map :D
06-27-2003, 04:52 AM#8
dataangel
OK here's the deal:

1. Hovering units can't have their flying height changed by triggers.

2. Some types of units, when made flying movement type, disappear. The solution is to change their flying height with triggers as soon as they're created; changing their flying height makes them appear.
06-27-2003, 04:54 PM#9
Mr. Thermistor
>change unit fly height to sin(height x
>buffer) at 0.00

No. Change height to (sin(jump)*height)

And you would need to reverse these actions to get the unit to fall.
06-27-2003, 06:27 PM#10
Dinadan87
Did anyone look at trigger one? that's the problem right there. You used a map initialization to check for the issued order (there is none yet) and then it never check again. Instead of map initialization event, use Unit is given order with no target, then make the condition of issued order equal to stop, then use whatever actions you want to make it jump. This way there will only be one trigger and the actions will work however you want. Also, if you only want a certain type of unit to be able to do this, add in a condition that sees if the unit type of the triggering unit is equal to whatever type you want it to be. The problem your having has nothing to do with the actions, it's in your events and conditions.
06-28-2003, 01:09 AM#11
l)ark_Link
HMMMMMMMMMMM.......Interesting how you guys are approaching this. I just made it so that in the event a player presses up, also known as a player moving the feild of view up on the Y-axis, the unit hight just changes to 5 different hights.....I tryed doing what you d00ds said, and for now, I feel like a newb.....What variable types are the flyingheight and buffer viables supposed to be? And what should they be set to in order to do this? Gawh, i feel so stupid....I either know all the answers, or I dont have a stinking clue.....
06-28-2003, 10:25 AM#12
Guest
If you want him to jump when u push esc?
If yes equal to true
you should do like this

Event:
Cinematic>Player1(red) skips an cinematic scene

Condition:
Boolean>(unit) is selected by player red equal to true

Action:
Animation>Change unit fly height to 40
wait for 0.10 sec
Animation>Change unit fly height to 80
wait for 0.10 sec
Animation>Change unit fly height to 120
wait for 0.10 sec
Animation>Change unit fly height to 80
wait for 0.10 sec
Animation>Change unit fly height to 40

Notes:
as dataangel said sometimes the unit dissapears, if it does just push the shadow and order it to jump(if u use this trigger with esc) and he will apear! TADAAA.

Try it!:foot:

If it dosen't work blame me:bangH: