Home   Help Search Login Register  

Author Topic: How??  (Read 1345 times)

0 Members and 1 Guest are viewing this topic.

Offline Nukejack

  • Members
  • *
How??
« on: 04 Dec 2009, 16:30:46 »
Hi!! Im new on these forums but Im very familiar with OFP and been playing it over 4 years.
But lets get to the point... I have started to build my first campaign and it is already pretty good, but my problem is: How I make units not to stop that action they are doind? For example: I have a mission two dudes are having
conversation, and they should have that conversation all time to the end, but they refuse to do it. They talk but they do it only few seconds and then they just stare at each other. Pretty annoying... Anybody know what shiuld I do??
« Last Edit: 07 Dec 2009, 10:53:27 by Nukejack »

Offline eegore

  • Members
  • *
Re: How??
« Reply #1 on: 04 Dec 2009, 21:58:16 »
  I use a script and loop it for the animations if thats what you are referring to.  I've never used wav to lip or whatever its called.



#loop
? endit: exit
Bob playMove "EffectStandTalk"
Rob switchMove "FXCivilLookaround2"
~3
goto "loop"


  I have the " ? endit: exit " in there but truthfully I dont know how Im supposed to get it to end.  I just delete the units when they are done talking.  

  This script will have Bob talk to Rob as he looks around indefinitely.
« Last Edit: 04 Dec 2009, 21:59:53 by eegore »

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: How??
« Reply #2 on: 04 Dec 2009, 22:30:48 »
Quote
I have the " ? endit: exit " in there but truthfully I dont know how Im supposed to get it to end.  I just delete the units when they are done talking.
endit is a global variable which must first be declared false in the init.sqs
Code: [Select]
endit = falseWhen your loop completes the 3 second delay it checks the condition again for status(true or false). If it has been declared true it then exits the loop, if false, it ignores the code after the "Then( : )" command and proceeds to the next line.
So...If when you desire the loop to end, in a waypoint, another script, or trigger you simply place endit = true. Keep in mind though that the loop will not immediately end since you have a delay in there between condition checks.

You can then use that same variable for other looping conversations as well as long as they are not all at the same time. This will prevent you from accumalating too many global variables and inducing the savegame bug. Just make sure to add endit = false at the end of the loop before you exit or before the next looping conversation.
Code: [Select]
? endit : endit = false; exit

Offline eegore

  • Members
  • *
Re: How??
« Reply #3 on: 05 Dec 2009, 08:34:05 »

  Thanks for the further info regarding the script.

  So from what I understand if I have the script running and want it to run for 30 seconds; I can just put a trigger in with the command
 
  endit = false

  in the activation field?

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: How??
« Reply #4 on: 05 Dec 2009, 11:58:04 »
Well since you put it that way, if you run the loop in a script and only need it to loop 10 times (10 X 3 second delay=30 seconds) just put a counter in rather than adding another global variable to the mix and once the count is met, the script ends.

Code: [Select]
_count = 0
#loop
Bob playMove "EffectStandTalk"
Rob switchMove "FXCivilLookaround2"
~3
_count =  _count + 1
? _count >= 10 : exit
goto "loop"

But if you need it to occur once the lumbering AI eventually activate a trigger when timing can be inconsistent, you would place "endit = true" in the OnActivation field of the trigger. The loop will then end once it loops back and checks the condition for variable status.

Offline eegore

  • Members
  • *
Re: How??
« Reply #5 on: 06 Dec 2009, 02:27:56 »

  I see what you are saying there.

  I've never used the count commands so I didn't think to use it to accurately time the script. 

  I need to get back to learning these since we started playing more ArmA at work.


  Thanks for the info. 

Offline Nukejack

  • Members
  • *
Re: How??
« Reply #6 on: 07 Dec 2009, 10:50:35 »
Well I can see both of us got problem solved.

Thx  :D