Master Gunnery Sergeant
I made a new WeaponHolder class with the "simulation" parameter set to "thing".
How can i tell OFP to use this weaponHolder class for specific weapon when i put the weapon down ?? It allways uses the original BIS WeaponHolder class
I tried to name both the weapon and weaponholder classes by same name, but that didn't helped. Any idea, anyone?
MSI P55-GD65 | Core i5 750 @ 2.67GHz | 4GB DDR3 | ATI HD 5970 (Asus EAH5970/G/2DIS/2GD5) | OCZ Revo 120GB PCIe SSD | 2x OCZ Vertex 4 120GB |
Windows 7 64bit Home Premium | Catalysts 13.1 | ArmA2 OA 188.8.131.52480 (beta) +BAF +PMC +ACR | ArmA2 184.108.40.206734 | ArmA 220.127.116.1181 | OFP 18.104.22.168
Be smart, use Sprocket!
Interesting. I can only guess at what you are trying to do here... wanna explain?
Anyway, I'd bet that this is hard-coded into the game. So your choices would be: (1) modify original game config, (2) some kind of workaround (I have a couple ideas that might work).
Master Gunnery Sergeant
I am working on some sort of "Escape from the Island" MP game.
The situation is that group of people crashed on some island (not important how or why, they are just there).
Soon the ppl. split to three competitive groups, each trying to get out of the island, but each of them are trying a different way.
The island was inhabitated, but some bad thing happened and all the people went crazy or something like that - they are killing anyone who doesn't belong to them. They are here to provide a universal enemy for all of the three player groups, BUT players can (although it is not my primary thought) even choose to play as these monsters (they are very tough, can't use any weapons or vehicles - something like zombies - but they have some sort of sixth sense, and monsters-players can controll other monsters [set waypoints for them, where to go, etc.]).
For the castaways, the target of the mission is to escape from the island. 1st team will have to find parts for a broken helicopter, the 2nd team will have to find parts for the broken boat, and the last team have to find parts for a submarine.
Each team can freely choose the vehicle to repair - no restrictions here, so there will be probably some fighting for the parts, as everybody will be trying to collect anything he finds just in case he will find all other parts for that vehicle later.
The teams can make bargains to swap their parts - imagine that you have the last part for other team's vehicle, and vice versa, then you could do a exchange, but WHAT IF the other team is lying? what if the other team just wants to steal the last part from you, and get away.
The parts can be found with the help of a detector - some device which will be beeping according to the distance to any of the parts.
But this device will have a dangerous side effect: When in use, it will attract the monsters (monsters will be notified of the position of the one using the detector, depending on how long the detector runs).
Each team should choose some hideout to stash in there the parts they found, until they got them all and then take them to the appropriate vehicle, and put them into it.
OR they can put the part in the vehicle right after they found the part, it's up to the team.
Any part placed into the vehicle cannot be taken back.
...but beware, the other team could have set an ambush at the vehicle, waiting for you to bring the last part.
There should be many ways to play this game.
And now why do i need a special WeaponHolder?
Because the parts you are searching for, are real objects with their own models, lying scattered all over the island, and they are WEAPONS (you cant fire from them, but you can pick them up like any 'secondary' weapon).
And because i am lazy, i wanted each of the weapons to have it's own special weaponHolder, so i could do just...
_d = Player Distance NearestObject[ Player, "A_Vehicle_Part"]
...when trying to figure out whether the detector should detect the 'part' and beep, or not.
The problem is, when you put the weapon down, it is placed inside the default "WeaponHolder", instead of the special one, so i can detect it only by...
_d = Player Distance NearestObject[ Player, "WeaponHolder"]
...and that is bad, because this will find ANY and ALL weapons or even ammo anyone drops.
I was hoping i can do this 'parts' part without much scripting, but it looks like i can't avoid it (it's not that i am unable to write some scripts, it's that i hate writing scripts for things which "should" be done without the need of scripting).
Hmm... it sounds to me like pretty much ALL of this large project is going to require scripting .
Originally Posted by (5133p39 @ Jan. 26 2006,19:49)
I understand your idea, but are you aware of the limitations of the "nearestobject" command? Specifically, it can only detect objects up to 50 meters away (which would make for a very short-range detector).
I think you're going to need to do this entirely thru scripting. If you absolutely must have the parts take up inventory space, then that might be possible, but it will be extra work.
Basically you are going to have to simulate this using the 'addaction' command, attatched to a static object. When a player uses the action, the object disappears, and the player gets an action to drop it again. If the player uses that action or is killed, the object appears next to him. If you want stuff in his inventory, you could make a magazine that couldn't be dropped, yet takes up space (possible?). This would be added/removed via the same actions/eventhandlers that make the object appear/disappear.
For the detector, you would have a global variable (type: object) which stores the object representing the part. When the part is on the ground, it is this static object. When the part is in a player's hands, it is this player. Then you use a function to search for the closest object, etc.
Specifics can be provided on request .