I have a collection of problems that I need to solve in SQS format. How do I...
1) find out the biggest/smallest of the bunch, for example the closest enemy team member or the highest scoring player with follow-ups?
2) make a player spawn with a rocket launcher already on his shoulder (or automatically switch to it at start) and make his RPG self loading without the long reload animation?
<s>3) make setVector always point at a certain place on the map?</s>
4) create a custom HUD (or similar) marker that works on veteran setting without a vehicle capable of it, like setting a permanent meeting point marker or revealing an enemy to compensate for the poor air visibility in my Camel Rage? (I could think of shiny particles as fog lights on the wings, but lack the know-how)
Any kind of help or workaround suggestions are welcome, 'course you don't have to know the answer to all the questions.
3) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_place = getpos PlaceOnMap
_pos = getpos Object
_vectorToPlace = [(_place select 0) - (_pos select 0),(_place select 1) - (_pos select 1), (_place select 2) - (_pos select 2)]
Object setVector _vectorToPlace[/QUOTE]
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_soldier addMagazine "M136";
Originally Posted by (Celery @ Feb. 26 2007,04:29)
_soldier addWeapon "M136";
_soldier selectWeapon "M136";[/QUOTE]
Originally Posted by (T_D @ Feb. 26 2007,17:42)
Thanks, that looks easier than it should have been.
Originally Posted by (Messiah2 @ Feb. 26 2007,18:31)
Well I'm pretty familiar with those commands, but the problem is that it doesn't work with the bazooka, only adds it on the back of the soldier. I need to have it on his shoulder instantly.
First, it's not a bazooka. Second, you can try the action command with the action USEWEAPON, or try switchMove/playMove and find the appropriate secondary weapon move.
Originally Posted by Armored_Sheep
To me it's a bazooka just like all vacuum cleaners are hoovers. I put p2 action ["USEWEAPON", p1, "M136"] in a trigger but the game gives me an error of 4 elements expected. I can't find any animation that is correct, some switch to launcher stance but change right back to another.
Originally Posted by (KyleSarnik @ Feb. 26 2007,22:03)
I actually tried the "self-loading automatically appearing M136" thing with an Eventhandler "Fired", but bugger me if it works. Maybe in a script? Basically my thought was something like "shoot, remove weapon, remove ammo, add ammo, add weapon (=loaded weapon), then selectweapon or switchmove to select it. But since neither selectweapon (maybe doesn't work with Player characters - have you tried with AIs?) nor switchmove seem to work, you might have to scratch the part where they start with the weapon deployed :-/
I suggest a "fired" eventhandler (check Biki for how to work it) and then maybe a wee script that removes and adds the weapon as appropriate. If that doesn't work, I'm stumped ^^
As to 1) maybe this is helpful : findNearestEnemy
As to highest-scoring player with follow-ups : this is in the realm of MP editing, which I know nothing about. I'm guessing the best way would be to have a map-spanning trigger, named something or other, activated repeatedly by Anyone, then have a scripts go through the List triggerName when you need the info, parse out the non-player units (this is MP-editing, don't know!, use the rating command to determine who's highest ranked, then display the information in hints or titletexts or whatever. I know this isn't specifically helpful, but it should work ok.
As to 4) -> you need to figure out some particle-editing, which is also something I really know nothing about. The known master of this in OFP is Mandoble : go hunt him in the OFPEC forums and see if he can give you some pointers, or play his The Forest mission for OFP and see if you can figure out the scripts he's used there. Hardcore stuff. ^^
Thanks, I consulted Mandoble and he said that I should use the name of the Camel's wingtip part to attach a particle but I'm at a total loss how to find it out. The fired eventhandler was the exactly first thing I did, but in vain.
With scores I meant the ones you get in multiplayer for killing and destroying stuff, I can find out individual scores with (score p1) but organising them to a list overloads my brain.
findNearestEnemy works well, but how can I specify the nearest enemy that is alive? The command wants to give the position of the nearest corpse but I don't want anything from a dead enemy. A way to skip to the next nearest enemy that is alive?