Home   Help Search Login Register  

Author Topic: Do it when I tell u 2!!!!!!!  (Read 510 times)

0 Members and 1 Guest are viewing this topic.

fragsta

  • Guest
Do it when I tell u 2!!!!!!!
« on: 25 May 2003, 22:07:17 »
Whenever I make an addaction in the init line of my player, the action is available but it automatically selects it when I start the game. How do I prevent this?

deaddog

  • Guest
Re:Do it when I tell u 2!!!!!!!
« Reply #1 on: 25 May 2003, 22:16:52 »
Patient to Doctor:
  Doc, my arm hurts when I move it like this...

Doctor to Patient:
  Don't move it like that!!  ;D


Seriously,  don't put the addaction in the init line.  Add it after the mission starts.  One way is to put the addaction in the 'on activation' line of a trigger.  Make the condition line 'true', instead of 'this'.  The trigger gets activated after the mission starts.

fragsta

  • Guest
Re:Do it when I tell u 2!!!!!!!
« Reply #2 on: 25 May 2003, 22:24:45 »
Thanks for your help, but thats kinda not what I meant. My current situation is this: I am making a script that will revolutionize VTOL. I can't tell you what the script is because of this. But I am having trouble linking the action tot he init script to the slowing down script. In the INIT line of the flying harrier, i put this:

Code: [Select]
stop=vehicle player addaction ["Stop","init.sqs"]
in the INIT.sqs I put this:

Code: [Select]
[vehicle player,0,0.1] exec "stop.sqs"
but when I get into the mission, I don't even press the "Stop" command, but the harrier slows and stops anyway. So what to do? Please help! Macguba? snYpir? Where are you, oh scripting gods?!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Do it when I tell u 2!!!!!!!
« Reply #3 on: 25 May 2003, 23:04:46 »
I'm not surprised the harrier slows down, you are calling the stop script from init.sqs.   So it's starting automatically when the mission starts.

Something like this should not involve init.sqs at all.    The addaction should call the stop script directly:

addaction ["Stop","stop.sqs"]
Plenty of reviewed ArmA missions for you to play

fragsta

  • Guest
Re:Do it when I tell u 2!!!!!!!
« Reply #4 on: 26 May 2003, 01:10:39 »
OK, thanks. I will have to work on it a bit then! You can't put variables in an addaction can you?!

fragsta

  • Guest
Re:Do it when I tell u 2!!!!!!!
« Reply #5 on: 26 May 2003, 01:20:25 »
WHAT IS WRONG WITH THIS THING!? I now have it calling the stop.sqs script directly when I do the action but it does it automatically! Should I have the addaction in a trigger!?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Do it when I tell u 2!!!!!!!
« Reply #6 on: 26 May 2003, 10:22:12 »
As a debug test, yes, definitely.     That will seperate things from the start of the mission which will make it easier for you to figure out what's going wrong.

You could also make a dummy script - one that just displays a hint - and get that to work, rather than using the complex stop script.

I don't understand the stop=vehicle player part either, though of course that may just be my ignorance.
Plenty of reviewed ArmA missions for you to play

deaddog

  • Guest
Re:Do it when I tell u 2!!!!!!!
« Reply #7 on: 26 May 2003, 16:13:09 »
The order of operations may be coming into play here.  

Try:  stop=((vehicle player) addaction ["Stop","init.sqs"])

Just to make sure everything executes in the right order.


@macguba

The addaction command returns an index which is required in order to remove the action later.  The official command reference says that there is a bug with this feature but it does work, at least with v1.91.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Do it when I tell u 2!!!!!!!
« Reply #8 on: 26 May 2003, 16:25:26 »
Ah yes of course, I'd forgotten about that.   Otherwise you have to remember which order you added the addactions.  Thanks deaddog.
« Last Edit: 26 May 2003, 16:25:45 by macguba »
Plenty of reviewed ArmA missions for you to play