Jump to content
Sign in to follow this  
HamishUK

Scripting problems..still

Recommended Posts

I am still having troubles with scripts. My fault though.

I am trying to ask a unit to sit down. I am not sure if I have placed the request in the right place or done it right?

I am using the AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground

scrrenshot:

http://i57.photobucket.com/albums/g230/BlitzPig_Ham/Move.jpg

I have a static unit (no WP set) and entered it into the Init line but nothing seems to be happening.

I know I have done somethong wrong and my knowledge of scripts is 0 so any help is very much appreciated.

Share this post


Link to post
Share on other sites

Change unit to this. Your code tells "unit" (which probably does not exist) to play an animation. You can use "this" within the initialization box to refer to the unit whose initialization you are editing.

Most script samples given on these forums will use generic variable/unit names (unit, target, object, vehicle, etc) on the assumption the reader has some knowledge of script syntax. You will need to learn the basics to be able to pick these and replace them as needed.

Share this post


Link to post
Share on other sites

Hmm well the unit is static (no WP set). I just want it to sit down next to a campfire I had placed on the map.

I have tried entering this as below typed into the INI field.

this AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground

I am obviously missing something? I thought the script would tell the soldier to sit down straight away but it seems this is not happening.

My grasp on scripting is weak at best but if I can get one to work then it's a start.

Despite looking at BIS Wiki there is no clear cut tutorial as to simple scripting and behaviour. This is something I would like to get into but with this basic script not working I find it frustrating at best.

Thanks again for any help.

banghead.gif

Share this post


Link to post
Share on other sites

If you enter animations into the init line they don't work. I assume it's because your animations get overwritten by the default animations for the unit during the init-phase. It should work though if you give the unit a name and execute the animation from a trigger or a waypoint. Give the unit a move waypoint on it's position and enter the code into the on activation field of the unit. then the unit won't move and the animation will work. You need to refer to the unit by it's name then and not with "this" though.

Share this post


Link to post
Share on other sites

The syntax would be:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this switchMove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground"but that won't work in the initialization part, probably because it gets immediately reset to the next action (like below).

If you add it to a trigger or script somewhere and name the soldier soldier2, you then call:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soldier2 switchMove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground"He'll perform the sit action, but then get straight back up again.

I don't know beyond that.

Share this post


Link to post
Share on other sites

ahh ok guys will try that. Thanks again for your assistance it is most appreciated.

Scripts and triggers are something I have yet to really use but will add a lot to mission making.

Thanks again.

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
Sign in to follow this  

×