Home   Help Search Login Register  

Author Topic: Names on helmets  (Read 1707 times)

0 Members and 1 Guest are viewing this topic.

Offline SafetyCatch

  • Members
  • *
  • War...it's fantastic!
Names on helmets
« on: 14 May 2005, 19:30:58 »
Hey guys

I'm making some units at the moment and I want it so the players name is displayed on the units helmet in a custom font, I think this is possible as I've seen stuff like this in missions, but can i work it into the addon?

Thanks :)

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Names on helmets
« Reply #1 on: 14 May 2005, 20:19:29 »
hmmm, what do you mean by name?
1. the name of the human player as it reads on the startup screen?
2. the identity given to the player in a mission, like gastovstki, petri honka, etc ?
3. the name of the player unit in its name field like soldier1, machinegunner_w_2 etc.?

for option 1 i don't think it's possible, option 2 might be possible, but that would be a case for mission editing cos the identity is passed to characters in a mission via the description.ext. and i'm not the right person for a question on the description.ext, cos all my attempts in making missions failed due to my inability to understand this file, so i retrained to addon making ;)
option 3 might be doable somehow. all you need is a script that decomposes the name into its letters and then setobjectstextures the single letters on the helmet. but of course you would have to name the units in the mission like their identities or do you want to have a writing like soldier_west_3 on a helmet ? ;)

//edit: if we find a way to script this i would be very interested in using it, too - for my iraqi infantry.
« Last Edit: 14 May 2005, 20:22:06 by remcen »
we're looking for members: IM:UC MOD

Offline SafetyCatch

  • Members
  • *
  • War...it's fantastic!
Re:Names on helmets
« Reply #2 on: 14 May 2005, 20:59:12 »
Yer I meant option 1  ???
« Last Edit: 14 May 2005, 20:59:22 by SafetyCatch »

Uldics

  • Guest
Re:Names on helmets
« Reply #3 on: 15 May 2005, 10:56:46 »
Option 1 is possible with "name object" command. I placed a soldier in editor and wrote in init field: hint name this
I got my MP playername displayed, so it is accessable.

There are some planes addons, where it is possible to define the hull number. F-16 by Footmunch had that possibility as written in readme:

Quote
The planes can be assigned a designation number using the
script command:

[this, 419] exec "\rktf16\scr\number.sqs"

in the init field in the mission editor. In the above case,
the plane will have the number 419 written on the tail.


Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Names on helmets
« Reply #4 on: 15 May 2005, 16:37:22 »
You could always create an addon which used setObjTexture.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

DBR_ONIX

  • Guest
Re:Names on helmets
« Reply #5 on: 15 May 2005, 16:57:32 »
Just what I was going to suggest :P
you make a bunch of 32x32 textures, and using sevral polys on the helmet, you apply the right texture to them.
To have ben on the helmet, you would use

Code: [Select]
_unit = _this select 0

_unit setobjecttexture [1,"theAddonPBO/b.paa"]
_unit setobjecttexture [2,"theAddonPBO/e.paa"]
_unit setobjecttexture [3,"theAddonPBO/n.paa"]
_unit setobjecttexture [4,""]
_unit setobjecttexture [5,""]
_unit setobjecttexture [6,""]

Not quite sure how you would split the name into array of characters


this,["b","e","n"]] exec "nameOnHelmet"

Code: [Select]
_unit = _this select 0
_name = _this select 1
_i=0

#loop
_letter = _name select i
?(_letter == "a"): _unit setobjecttexture [_i,"TheAddonPBO/a.paa"]
?(_letter == "b"): _unit setobjecttexture [_i,"TheAddonPBO/b.paa"]
?(_letter == "c"): _unit setobjecttexture [_i,"TheAddonPBO/c.paa"]
; ect

?(_i >= count _name):exit
GOTO "loop"


Only problem with this is you could run out of space, but if you have 15 writable to polys, it should be fine for most names
- Ben

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Names on helmets
« Reply #6 on: 16 May 2005, 00:10:10 »
Also, since names on helmets might not be very noticeable, you might consider names on rucks. Or both. ;)
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Names on helmets
« Reply #7 on: 20 Jun 2005, 21:11:49 »

Not quite sure how you would split the name into array of characters


this,["b","e","n"]] exec "nameOnHelmet"

There is a way to do that by using Kegetys Fwatch.

Code: [Select]
string toarray string Return all characters in string as array elements

example:
_x = call loadFile format[{:string toarray "%1"}, "hello"]

Value of _x would be ["h", "e", "l", "l", "o"]  

If somebody is intrested in continuing this let me know,I would love to have an

ECL MP unit who has his ingame name on his helmet.

I dont have enough O2 knowledge to do this alone.

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 ;)