Home   Help Search Login Register  

Author Topic: Take action delete vechile in game  (Read 622 times)

0 Members and 1 Guest are viewing this topic.

ruff

  • Guest
Take action delete vechile in game
« on: 12 Nov 2003, 04:37:24 »
i would like to know how to make a script in which i take pc using take pc action and the pc dissapears

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Take action delete vechile in game
« Reply #1 on: 12 Nov 2003, 04:47:00 »
What do you mean with PC ? Personal computer ?

ruff

  • Guest
Re:Take action delete vechile in game
« Reply #2 on: 12 Nov 2003, 16:35:51 »
yup

i want to make a mission where wen i get close to the pc i get a "take pc" action command and wen i use the action command the pc dissapears

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Take action delete vechile in game
« Reply #3 on: 12 Nov 2003, 23:04:37 »
Name the computer.

Create a trigger, centred on the PC and with a radius of perhaps 2m - you will need to experiment to find the right distance.   Activation will be player present.

Now learn about the commands addAction and removeAction.   You will need to add the action to pick up the PC to the player when he gets close enough to .    The script called by the action will deleteVehicle the PC (so it looks like it disappears) and change a varible (so that you can check later whether the PC has been picked up).   It will also remove the action.

The addaction command goes in the on activation field of the trigger.
Plenty of reviewed ArmA missions for you to play

ruff

  • Guest
Re:Take action delete vechile in game
« Reply #4 on: 06 Dec 2003, 04:30:24 »
i made a script like this
pc = "laptop pc closed"
pc addaction ["Take pc","takepc.sqs"]
exit
and made another one to delete it like this
deletevehicle pc
exit

the pc dissapears but i i get an error on top of the screen

but it does wat i want
is there anything wrong on those lines?

Homefry31464

  • Guest
Re:Take action delete vechile in game
« Reply #5 on: 06 Dec 2003, 05:59:49 »
pc = "laptop pc closed"
pc addaction ["Take pc","takepc.sqs"]


In the second line, "pc addaction" should be:
player addaction

But I am not big on scripts, so maybe that will help a little.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Take action delete vechile in game
« Reply #6 on: 06 Dec 2003, 11:42:17 »
in the init.sqs:

pcaction = pc addaction ["Take pc","takepc.sqs"]

where
pcaction is the ID of the action
pc is the name of the pc in editor
addaction being the command
"Take pc" the what you see in action menu in game
"takepc.sqs" the script which the action will execute


in takepc.sqs:

pc removeaction pcaction
deletevehicle pc
exit

where
pc removeaction pcaction consists of the name of the pc, command to remove action from pc, the ID of the action to be removed.
deletevehicle pc of command to delete an object, the name of the object to be deleted.
exit exiting the script.


If you add the command to the pc the player will get it on his action menu when he's close enough of the pc.. which is sweet for your purpose I think.

//edit

I can't see why you'd need to define global variable pc as "laptop pc closed". If you've named your pc in the editor as 'pc' and you redifine that variable in the script as "laptop pc close", there's no way the script is ever going to work  ;)
« Last Edit: 06 Dec 2003, 11:46:30 by Artak »
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Take action delete vechile in game
« Reply #7 on: 06 Dec 2003, 11:43:25 »
If you get an error message, always post here.    Give the exact message if you possibly can.    It is particularly important to include the # since that tells you where in the line of code the error has occurred.
Plenty of reviewed ArmA missions for you to play

ruff

  • Guest
Re:Take action delete vechile in game
« Reply #8 on: 07 Dec 2003, 06:00:17 »
i actually made it work with less lines
the laptop is named pc and theres 2 scripts
the first script goes like this
pc addaction ["Take laptop","takepc.sqs"]
exit
and the second 1
deletevehicle pc
pcc = true
exit

but now ive even went further by using the script on dead bodies
but now i want a script that allows me to have the "take body" action when one of my squad members die
its the exact same script but changed the name to body
it only works for the unit named body
but i want it for the whole group so if they die i have the "take body" action
i tried naming my group body but it has error at th top

any ideas?