Home   Help Search Login Register  

Author Topic: Can't take a weapon.. Possible?  (Read 595 times)

0 Members and 1 Guest are viewing this topic.

Serial Killer

  • Guest
Can't take a weapon.. Possible?
« on: 01 Feb 2005, 17:37:48 »
Is it possible to make a script or trigger, what orderers, that player can't take any weapon from nobody?

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Can't take a weapon.. Possible?
« Reply #1 on: 01 Feb 2005, 20:11:40 »
Do you mean so you can't pick guns up off of bodies?
Just use "removeallweapons _x"foreach thislist that should work, unless I forgot an "in"
I like your approach, lets see your departure.
Download the New Flashlight Script!

Serial Killer

  • Guest
Re:Can't take a weapon.. Possible?
« Reply #2 on: 02 Feb 2005, 15:17:02 »
Hmm... That will remove all weapons from everybody. I just need to remove "weapon taking" action from player, possible?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Can't take a weapon.. Possible?
« Reply #3 on: 02 Feb 2005, 19:33:24 »
That's not mission editing, that's messing with the game engine.  

I don't think anybody has figured out how to remove default Actions.    You can probably use a crude workaround if you really want:  a looping script checks the player's weapons and removes them if he has something he hasn't.

In this kind of situation I always say the same thing:  don't fight the game, work with it.    Use your imagination and think laterally.   Design your mission to make the most of the game's strengths - don't break your skull trying to beat your way through its weaknesses.  
Plenty of reviewed ArmA missions for you to play

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Can't take a weapon.. Possible?
« Reply #4 on: 02 Feb 2005, 23:27:36 »
Add an EH killed to all the units,and have them deleted\setpos somewhere else on the island when they die.Or remove all their weapons.

U wont have dead bodies then,or any weapons,nothing to pick up :)

http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Can't take a weapon.. Possible?
« Reply #5 on: 03 Feb 2005, 19:44:21 »
as per the command reference, all actions are given an index number
In theory, you are supposed to be able to manipulate the action using this index number

however

i have tried removing actions using an index number reference, but never achieved anything

It may be possible within the config and therefore only available in a mod

But in a mission using a standard bis config, the answer is No

there are workarounds, however, but this would require a constantly looping script on the player, checking to see if his ammo and weapons array has changed and then setting it back to the starting array if it did


what may be worth trying, is to localy lock the dead unit (All men are vehicle class, you can lock vehicles, therefore in theory you can lock men units)

what effect this may have, if it works is for the finding
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Serial Killer

  • Guest
Re:Can't take a weapon.. Possible?
« Reply #6 on: 03 Feb 2005, 20:39:24 »
Can someone explain, how to make a trigger like this..
When A.I. is dead, trigger will remove him magazines or weapons?

Strango

  • Guest
Re:Can't take a weapon.. Possible?
« Reply #7 on: 03 Feb 2005, 22:35:23 »
I have a script in the Editors depot that replaces HD magazines with regular magazines when that unit dies.  You can modify that script to just plain remove everything.

It's called "Interchange HD Mags for normal Mags on death"
here's a link to the script page it's on:
http://www.ofpec.com/editors/browse.php?browsewhat=2&category=2_8

Seabiscuit

  • Guest
Re:Can't take a weapon.. Possible?
« Reply #8 on: 03 Feb 2005, 23:28:21 »
You can do this with a trigger if you create a group with all the units you want to check the status of.

Activation: Once, East Present
OnActivation: ai_east = group thisList
                          ai_east = thisList

Then in your init.sqs call a script that loops through all the units in the list checking whether or not they are alive and removing their ammo if so. I can comment more on this if you are unsure how.

Another option would be to create a 'killed' eventHandler on each guy you want cleaned up then take away his ammo when he dies.

I wouldn't suggest taking away the units weapon though because it wouldnt be too realistic to have someone shooting at you, die and their weapon dissapears.
I'm sure that you have a good reason for not wanting the player to pick up a dead units weapon but it takes away from a big reason for playing OFP in the first place in my opinion.
In reality if you ran out of ammo or your weapon was dammaged wouldn't you pick up whatever you could to survive?
Like the saying goes:
"You can have my gun when you pry it out of my cold, dead hands."

SB...



« Last Edit: 04 Feb 2005, 18:34:21 by Seabiscuit »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Can't take a weapon.. Possible?
« Reply #9 on: 04 Feb 2005, 18:47:15 »
add an eventhandler "Killed" to all units.
do this by placing the following in each ai units INIT field in the mission editor

this addEventHandler ["killed", {_this exec "cleanup.sqs"}]

and then save the following script in your mission folder

Cleanup.sqs
Quote
_unit = _this select 0
removeallweapons _unit
~30
deletevehicle _unit


and when that unit dies, his weapons and ammo will be removed instantly from the map.
he will be removed 30 seconds later

Its a lot more efficient than a trigger



I added the lines
 
removeallweapons _unit
~30
deletevehicle _unit

this would be useful if you wanted to delay the deletion of the units body after death.
(There are more elaborate ways of deleting the unit, if a delay is required after the unit has been killed than the example above.
This system is inneficient as each unit will be running a script for 30 seconds after death. )


However, from what you say, you want to delete the unit as soon as it dies, therefore you can simply use the following script instead

Cleanup.sqs
Quote
_unit = _this select 0
deletevehicle _unit

Another approach maybe to remove all the ammo from the unit, so it doesnt look as odd, as per seabusicuits post


this again can be done in the following way
NB>> No delays, so the removal and readdition of the weapon is unnoticeable

Cleanup.sqs
Quote
_unit = _this select 0
;;;;_weapon == Primaryweapon _unit
_weapArray = weapons _unit
;;;;_magArray = magazines _unit
removeallweapons player
{_unit addWeapon _x} forEach _weapArray
;;;;;  _unit selectweapon _weapon
~30
deletevehicle _unit
exit


if you have problems with the position the weapon appears in, uncomment the blue lines
« Last Edit: 04 Feb 2005, 18:58:13 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123