OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: BLITZKRIEG_ROF on 10 Aug 2004, 13:14:48
-
I'm making a MP mission (the same one from my time compression thread), and I've run into a snag.
What would be the best way to have all the shilkas on the map lose all thier ammo upon the destruction of a specific object?
Also, I'm wondering if it's possible to have a second group of shilkas that are linked to a separate destroyable object in the same way.
I'm going for a Freedom Fighters effect, where if you blow one thing up, it effects the entire map.
-
Put the shilka's names in an array and do something like
"removeAllWeapons _x" foreach shilka_arrayor:
"removeAllWeapons _x" foreach [shilka_0,shilka_1,shilka_2,shilka_3,......]
removeAllWeapons _should_ work, if not, play with removeMagazines with friends.
Cant verify this at work.
-
Mud_Spike's code could go in the On Activation field of a trigger. In the condition line you might have
not alive loon1
or maybe its just an East not present trigger ... whatever the objective is really.
-
Okay, basically, I want to simulate a truck as a moble command center for the air defenses. When the truck is destroyed, the shilkas are rendered useless. I want it so that when a Ural truck is destroyed, all the shilkas don't have any ammo.
I've tried the removeallweapons command, and it didn'a work, as well as the removemagazinecargo one.
Any other ideas?
-
removeMagazineCargo is for ammo-containers (i.e., ammo-boxes, vehicles) and is
not used by the unit hosting them (in the case of vehicles).
removeAllWeapons should work. How are you using it?
Have you named your shilka units in the editor?
If so, does hint format ["%1", shilka_unit_name] report something like "EAST DELTA Black four",
or "...0xffffffffe.."?
Paste your removeAllWeapons code and tell us how it is being executed (Trigger conditions..)
-
Try removeMagazines. Make sure you have the correct name for the ammo.
-
Alright, i'll give 'em a shot
-
The removeallweapons worked this time around. Perhaps I had done it wrong.
Alright, the other problem is liking the loss of weapons to the destruction of a Ural truck. What would be the best way to do that?
-
Exactly what MacGuba said:
Mud_Spike's code could go in the On Activation field of a trigger. In the condition line you might have
not alive loon1
or maybe its just an East not present trigger ... whatever the objective is really.
where loon1 is the name of your comms truck.
-
Hmm. Excellent. Sorry for not reading more carefully.
Again, thanks for your help. I'll test it out, and if it works, i'll SOLVE the thread.