Jump to content
Sign in to follow this  
Guest

Force player to sling weapon

Recommended Posts

Guest

Hello

I have a few scenarios where player can have dialog with ai units, and I dont like during the dialog sessions the player potentially aming down the barrel at the person he/she is conversing with, so Ive tried alot of stuff with no success.

Originally I wanted to check if player behaviour is set to safe or careless, been told ofp doesent register that for 30 secs after weapon is slung, wont work.

So, only other way is to force player unit to sling weapon at conversation start, problem is setbehaviour to "safe" dosent do anything, so I tried looking for the action name here that is used for weapon on back, but all the action list links are dead in the search...

Anyone know if I can force the player unit to sling weapon with an action, and what the action name might be?

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

player switchMove "CombatToStand"

Share this post


Link to post
Share on other sites

You could also try using the Action command, works ok for the player.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player Action ["weapononback"]

Share this post


Link to post
Share on other sites
Guest

Excellent, thanks for the help Mandoble and UNN, sorry to post for such a simple question but every single post I found in my search that answered this had a link to an action list from ofpec lol, got quite discouraging...

thanks again

Share this post


Link to post
Share on other sites
Guest

Alright, I have one more question regarding this.

The player action works fine.

Ive been trying to find out if I can get the script to do something when the player does this action, and so far nothing works.

Is there a way to find out if a standard bis menu action has been activated by player?

I tried:

@Player Action ["weapononback"]

this just causes the player to do the action

?Player Action == ["weapononback"]

Error

?Player Action == "weapononback"

Error

Cant seem to get the script to find if this action has been performed by player. Im suspecting theres no way to check this..

Share this post


Link to post
Share on other sites

You can set a variable after you activate the action and then check for the variable condition like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player Action ["weapononback"]; gunonback = true; publicvariable "gunonback"

Then check for "gunonback" in script or trigger.

Wadmann

Share this post


Link to post
Share on other sites
Guest

Thanks Wadmann, but actually was wanting to find a way to do this if player activated the action, not the script. It would be so player must initiate slinging weapon before conversation start, rather than the script doing it, but its not that big of a deal.

In fact after looking at the other possibility (which I dare not mention because of complexity) I think I need to learn to be satisfied with what I have lol, so this topic is solved, thanks for the help all, it works and thats good enough for me biggrin_o.gif

Share this post


Link to post
Share on other sites

That is what I get for posting too early in the morning.

I realized my error this morning that it would not check the result of the action, only the fact that the action has been added.

Sorry if I led you down a dead end path but you did seem to spot my error rather quickly.

I thought that I had seen something similar at OFPEC. Search their site for a possible answer when thay are back online.

Wadmann

Share this post


Link to post
Share on other sites

Wouldn't possibly unitname setbehaviour "careless" work? At least I think it should work better than safe mode...you could always try

Share this post


Link to post
Share on other sites
Guest

You tried to help Wadmann, that I appreciate wink_o.gif

@ Garcia

Honestly cant remember if I tried setting behavior to careless, as nonetheless both the action and the switchmove commands work fine, although I did try to use behaviour as a question in the script to see if player behaviour was set to careless, or to safe, and it never worked even when player had initiated weapon slung, and found later in search that ofp engine takes roughly 30 secs to register a units new combat mode for script use, so it wouldnt work.

See main issue was that mission is intended to be used with FFUR mod, and anyone whos used that mod knows that unless you 'safety'weapon your normal stance is looking down the barrel, which I could not allow during player to ai dialog, but I merely force player action 'weapononback' once player has initiated a conversation with an ai unit, which works fine.

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  

×