Jump to content
Sign in to follow this  
prototype1479

Detecting PLAYER stances

Recommended Posts

So i am making a survival mission where u have to eat food to survive. So i have got a problem. when you pick up the food the only option to player take the food while lying down is getting up then taking the food. but i want it like if player lying down then he should do the "picking up in prone" animation and when standing up he should do the "picking up while standing" animation. so how can i do something like this?

 

_i= _this select 0
_i removeAction (_this select 2)
player playmove "PutDown"
~1.25
player addaction ["MRE (+250 Hunger)","foodmre.sqs"]
exit
 
ps: i heard that its possible to do in fwatch but i want it in vanilla
 
EDIT: Actually I just made one (Only works for OFP 1.99)
Here is the link

Share this post


Link to post
Share on other sites

Requires addon.
 
Take.sqs
 

? Taking || vehicle player != player : exit
Taking=true

ANIM=""
player exec "Check Stance.sqs"
@ANIM!=""
player playMove ANIM
~3
? !(alive player) : Taking=false; exit

...

Taking=false

 
 
Check Stance.sqs
 

_a="dummyBullet" camcreate [getpos _this select 0,getpos _this select 1,0.8]
_a setvelocity [velocity _this select 0,velocity _this select 1,5]
_b="CombatToTakeFlag"

#Loop
? getpos _a select 2 > 1 : deletevehicle _a; _b="LyingToPutDownLying"; goto "End"
? !alive _a : goto "End"
goto "Loop"

#End
ANIM=_b


 
External links:
Addon method
Fwatch method

EDIT: 1.99 method

  • Like 1

Share this post


Link to post
Share on other sites

Requires addon.

 

Take.sqs

 

? Taking || vehicle player != player : exit
Taking=true

ANIM=""
player exec "Check Stance.sqs"
@ANIM!=""
player playMove ANIM
~3
? !(alive player) : Taking=false; exit

...

Taking=false

 

 

Check Stance.sqs

 

_a="dummyBullet" camcreate [getpos _this select 0,getpos _this select 1,0.8]
_a setvelocity [velocity _this select 0,velocity _this select 1,5]
_b="CombatToTakeFlag"

#Loop
? getpos _a select 2 > 1 : deletevehicle _a; _b="LyingToPutDownLying"; goto "End"
? !alive _a : goto "End"
goto "Loop"

#End
ANIM=_b


 

External links:

Addon method

Fwatch method

so there is no other possible way to do without addons? btw whats that "..."  thing between "? !(alive player) : Taking=false; exit" and "Taking=false"

Share this post


Link to post
Share on other sites
Quote
so there is no other possible way to do without addons?

 

 

No

 

EDIT: 1.99 method

 

Quote
whats that "..."  thing between

 

 

Space for your own code that e.g. makes item pick-up happen.

Share this post


Link to post
Share on other sites

No

 

 

Space for your own code that e.g. makes item pick-up happen.

Alright ty what about the other post that i made? i think its possible but can u tell me how to do it

Share this post


Link to post
Share on other sites

You could theoretically use a default bullet instead of the dummyBullet the addon provides, but you probably risk killing the unit you want to test and that gives you a whole bunch of healing/reviving stuff to do.

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  

×