Home   Help Search Login Register  

Author Topic: Renaming units  (Read 952 times)

0 Members and 1 Guest are viewing this topic.

pino

  • Guest
Renaming units
« on: 04 May 2003, 00:33:41 »
Hi! I have a little scripting issue. How can I rename a unit in the middle of the mission? For example, if I have a soldier named "NCO_1" killed and I wanted some other existing soldier to take his name? ¨name¨ command apparently just returns the name, but is there a command that would actually change the units name.

UberKreb

  • Guest
Re:Renaming units
« Reply #1 on: 04 May 2003, 06:47:40 »
You could try NCO_1=soldier but I honestly have no idea if that works. I would have tested it, but I don't have OFP installed on this computer

UberKreb

pino

  • Guest
Re:Renaming units
« Reply #2 on: 04 May 2003, 07:24:18 »
You could try NCO_1=soldier but I honestly have no idea if that works. I would have tested it, but I don't have OFP installed on this computer

UberKreb

No luck--> Error Reserved variable in expression.
 
Thank you anyway.  Any more suggestions?

MadFred

  • Guest
Re:Renaming units
« Reply #3 on: 04 May 2003, 07:37:58 »
it depends on what you want to use the name for

if it is needed to activate anything like radio messages or something which wont work when the name you need is not alive any more  then I suggest you group the soldiers and use the group leader designation for it

this way when leader dies the next in line will be designated leader instead and also take that name

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Renaming units
« Reply #4 on: 04 May 2003, 10:22:28 »
For example, instead of

NCO_1 sidechat "blah"

you could have

leader grp1 sidechat "blah"

which would make the leader of the group named grp1 do the talking.   If the original leader is killed it doesn't matter.

If that doesn't solve your problem, tell us more about what you are trying to achieve.
Plenty of reviewed ArmA missions for you to play

pino

  • Guest
Re:Renaming units
« Reply #5 on: 04 May 2003, 15:56:18 »
Im doing a mission in which the player is commanding a parachute platoon of about 37 men (based on Invasion 1944 demo units).  The player is directly controlling only soldiers in his platoon HQ and the squadleaders. So the grunts in the rifle and mortar squads are following their "squadleader" commanded by the player.
When one of the squadleaders dies he is replaced (join command) fast (so that he would take the same slot/number in the grouparray) by one of the men who followed him. Now when the last squadmember dies he is removed from the players group (by the game engine) and the other soldiers that were after him in the array are moved one place up.
This makes scripting harder (for me). For example if I have 3 guys in my group named NCO_1, NCO_2 and NCO_3 and then there were 3 separate groups of soldiers named grp_1, grp_2 and grp_3.  I have script that makes the grp_1 follow and imitate (mode, facing ect.) the NCO_1, grp_2 follow the NCO_2..and so forth. If i now would be able to rename units it would be easy to make script where you just would state that grp_3 move getpos NCO_3. I have similar problem with radiocommands for moving the squads in the map (onmapsincleclick) but im going to spare you and not explain that.  Ayway my scripts are workingk somehow but renaming units sure would make them less complex.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Renaming units
« Reply #6 on: 04 May 2003, 16:05:58 »
It might be possible just to do this in a trigger or script

NCO_3 = newName

Try it, you never know.

For the sake of completeness, I assume you are familiar with the Chain of Command mod?
Plenty of reviewed ArmA missions for you to play

pino

  • Guest
Re:Renaming units
« Reply #7 on: 04 May 2003, 21:56:34 »
UberKreb already suggested that (see my second post).

I briefly looked the chain of command mod but didnt find any rename command. I think I can override the problem (my scripts work but have some bugs on certain occasions) though, with a bit more scripting. It could have been so much easyer though with the rename command. Im a noob with this editing stuff and this is my first mission that  im trying to create.

BTW that CoC mod slows the action down quite a bit atleast with my system. That mod has some huge scripts with lots of variables, so I dont wonder why it does that.

I quess I better not try anything too complex so I can get something finished.
Thanks for all who answered.


 
 

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Renaming units
« Reply #8 on: 04 May 2003, 22:15:21 »
CoC doesn't have a rename bit, as far as I know though I'm not an expert.    Sounds like you are being pretty ambitious with your first mission ... and I think you are right, make it work most of the time and worry about the subtleties of the scripting later.
Plenty of reviewed ArmA missions for you to play