OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ball Zack on 12 Jun 2003, 02:00:42

Title: Breakdancing Osama
Post by: Ball Zack on 12 Jun 2003, 02:00:42
I am creating a music video where Osama sings a song and then gets blown up...  anyway towards the end there is an instrumental part where I want Osama to start moonwalking like Michael Jackson.  I was thinking that it might be possible if I use a waypoint to make him walk in one direction, but then use a movement script to pull him backwards, making it appear as if he is moonwalking backwards.  Anyway if someone could please try this and send me a sample mission, I would be more than happy to include you in the credits for my music video...
Title: Re:Breakdancing Osama
Post by: RED on 12 Jun 2003, 17:50:03
I am not sure if this is what you want, but it is still pretty funny :D Set endmoonwalk to true to exit the moonwalk.

The script is:

Code: [Select]
_unit = _this select 0

#loop
_unit setpos [(getpos _unit select 0) + sin (getdir _unit + 180) * 0.08, (getpos _unit select 1) + cos (getdir _unit + 180) * 0.08,0]
~0.01
?endmoonwalk:exit
?!(alive _unit):exit
goto "loop"

You can find an example here:

http://www.red-dev.net/missions/test_moon.zip

RED
Title: Re:Breakdancing Osama
Post by: Ball Zack on 13 Jun 2003, 02:00:03
thanks Ill try it out.
Title: Re:Breakdancing Osama
Post by: Ball Zack on 13 Jun 2003, 02:45:07
YES!!! This is perfect this is exactly what I was talking about.  I modified it a little bit, here is my version...
Title: Re:Breakdancing Osama
Post by: RED on 13 Jun 2003, 08:59:43
Looks good, have fun :)

RED
Title: Re:Breakdancing Osama
Post by: Ball Zack on 14 Jun 2003, 04:46:25
I do have one question.  How do I make the script shut off after several seconds?
Title: Re:Breakdancing Osama
Post by: RED on 14 Jun 2003, 14:49:30
Code: [Select]
_unit = _this select 0
_timelimit = _this select 1
_pause = 0.005
_i = 0

#loop
_unit setpos [(getpos _unit select 0) + sin (getdir _unit + 180) * 0.08, (getpos _unit select 1) + cos (getdir _unit + 180) * 0.08,0]
_timelimit
~_pause
_i = _i + _pause
?_i >=  _timelimit
?endmoonwalk:exit
?!(alive _unit):exit
goto "loop"

Execute the script with [unitname, timeinseconds for script to work for] or you could just set endmoonwalk to true.

RED
Title: Re:Breakdancing Osama
Post by: Ball Zack on 14 Jun 2003, 22:35:43
ok thanks