Jump to content
l4z0rr0b0tz

Ski/Alpine Trooper Script

Recommended Posts

Hi!  I'm new to the forums.  If I'm in the wrong place please feel free to redirect me or move my post.  

I have a question.  Is there currently a script anyone has written to make it look like you are skiing?  I think this would be feasible.  If there is not already such a thing, I would love any help or suggestions as to how to do it.  I'm pretty much a novice scripter but I think I have some idea of how to accomplish it.  

The way I'm envisioning it, it would take a few parts:

-An addaction menu to put on/take off your skis
-A script to freeze the player's animations and attach something that looks like skis to your feet.  I've seen people do scripts to attach things like an axe or a shovel to your hand so I figure this must be possible somehow.
-A script to detect the player's heading and speed it up in that direction if it's downhill
-A way to stop/slow down

It would be really cool if you could ski and shoot at the same time.  Alpine style!  This could be great for Namalsk and similar maps.

Let me know if you have any advice for me!  I am not expecting someone else to write this script for me but I don't know what commands to call and stuff...

Share this post


Link to post
Share on other sites

The concept is easy and the script implementation is easy enough, the hard part is the actual animation, unless there is a vanilla Arma animation that could supplement (I don't know of any off the top of my head).

Share this post


Link to post
Share on other sites

I was thinking the same thing.  What I would propose is perhaps using the "Frozen Ragdoll" where the arms are spread out and the legs are shoulder width apart.  It might look a little wonky but it would be easiest to attach the skis that way.  

Share this post


Link to post
Share on other sites

Bumping for a question:  Is there a way to check what type of terrain a unit is standing on?  To check for snow...  or at the very least check if a unit is inside a building?  Thanks!

My script is coming along nicely, I'm working thru some funny glitches and learning a lot!

Share this post


Link to post
Share on other sites

Here's my current script open for critique.  It's still missing some elements but I've figured out some important things.  If you just use setvelocity with only x,y you will go flying off into the distance (I caused my first memory related crash this way!).  I'm trying to figure out how to use surfacenormal to set a negative Z velocity or a positive Z velocity for going up/down hills without flying off or using my "current workaround" which is just to set the player's altitude to 0.

I also figured out how to attach objects to the player's feet but I'm having trouble finding a model that looks like skis, and also the placeholder model I was using (sleeping bag) collides with the player and therefore makes the character look like they're on a flying carpet.  It's kind of cool actually but not what I'm going for.  

 

Also to call this script you need to put this into your player init.  This way you can start and stop skiing and your character will take no falling damage but can still be shot (I think in the end that this will be necessary)

player addaction ["Ski","ski2.sqf"];player addaction ["Stop Skiing","ski=false"];this addEventHandler ["HandleDamage", {if ((_this select 4) == "") then {0} else {_this select 2};}];

 

ski = true;  //whether unit is skiing or not
while {ski} do {
_vel = velocity player;
_dir = direction player;
_norm = surfacenormal (getpos Player);
_speed = 10; comment "Added speed";
_atl = getposatl player;
player setposatl [_atl select 0, _atl select 1, 0];
player setVelocity [
(_vel select 0) + (sin _dir * _speed), 
(_vel select 1) + (cos _dir * _speed), 
((_norm select 2) * 2)
];
sleep 1;
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×