OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: kevb0 on 18 Jul 2006, 06:09:37

Title: Questions about training missions
Post by: kevb0 on 18 Jul 2006, 06:09:37
Hello, I have a few questions for a training mission I'm making. I'd normally ask them in the OFPEC IRC channel, but noone's awake it seems.

How can I prevent the normal BIS targets from falling over when shot? I've tried the allowdammage command, but they still fall over.

Is it possible to 'reset' the targets? IE, when you're near the range, you have an option to 'Reset Targets' and it will delete all of the current targets, and replace them with normal, not knocked over, targets?

How can I place a useable weapon (say, an M16) on the floor, and have the ability to pick it up?

Thanks in advance.
Title: Re: Questions about training missions
Post by: Cheetah on 18 Jul 2006, 08:45:19
How to place a useable weapon let's say an M16 on the floor and be able to pick it up.
Place an ammo box and type in its init:
Code: [Select]
this setpos [(getpos this select 0),(getpos this select 1),-2];You do now have a buried ammo box from which you can let the player pick up weapons. After this you have to look for a static object of the weapon you want to be picked up. I know that there's a static M16, but I can't find it right now.
After you found it just type the same code in it's init as you did with the ammo box, but change the "-2" to "0" or something near zero to put it on the ground.

Place a target and call it "target".
In the activation field select "radio julliet".
Place a trigger and select timeout, min/max/mid set to 2. Type in the condition field:
Code: [Select]
(getDammage target > 0.9) && thisand in the on activation field
Code: [Select]
target setDammage 0;For me this gives a target that after being shot down comes back up after two seconds, if it's knocked down and you use the radio command. If you want to be able to keep doing this, select "repeatly".

Place a target and call it "target".
Place a trigger, select repeatly, in the activation field type:
Code: [Select]
getDammage target > 0
in the on activation type:
Code: [Select]
target setDammage 0;Didn't work, maybe someone else has a solution to this.
Title: Re: Questions about training missions
Post by: The-Architect on 18 Jul 2006, 10:26:27
For the M16 thing, search for a guns on table script. It exists.
Title: Re: Questions about training missions
Post by: kevb0 on 18 Jul 2006, 18:58:44
Alright.

Do you know of any other scripts that would work nice on a training mission?
Title: Re: Questions about training missions
Post by: Mr.Peanut on 19 Jul 2006, 16:52:46
First setDamage 0 the target.  Then setPos or setDir to set it upright.
Title: Re: Questions about training missions
Post by: kevb0 on 19 Jul 2006, 21:23:36
I ended up making a nice little script, from the information you gave me. I'll share it with you guys just incase someone wants to make a nice mission.

I got an object, let's say a computer. I did "This Addaction "Raisetargets" "Raisetargets.sqs"; in the init line. Then, in the Raisetarget.sqs file, Put target1 setdammage 0, target2 setdammage 0, etc etc. I'm sure it's not the most effective way to do it, but it gets the job done perfectly. It works online too!

thanks for all of your help guys.