Home   Help Search Login Register  

Author Topic: Names in titletext  (Read 1562 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Names in titletext
« on: 05 Aug 2005, 11:21:14 »
Hi all,

I was looking at Toadlifes HALO script, when I saw this hint command

Code: [Select]
hint format["Hello %1! When your chopper reaches land, your group will automatically be ejected and the units will perform a HALO drop. This is a realistic HALO drop, so be sure and pull your chute at 100m or higher, or you may die! Once on the ground, you can order your men into one of the choppers and use the radio [0,0,1] to eject them again!",name player]

When it activates, where '%1' is, the players username comes up.

Anyway, I was wondering if there is a way to convert this method to titletext, so the players name comes up in writing at the bottom of the screen.

Thanks  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

klavan

  • Guest
Re:Names in titletext
« Reply #1 on: 05 Aug 2005, 11:26:41 »
titletext [format ["Good morning, Captain %1.", name player],"plain down"]

Klavan
« Last Edit: 05 Aug 2005, 11:27:04 by klavan »

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Names in titletext
« Reply #2 on: 05 Aug 2005, 11:35:22 »
Thanks for the quick reply.
When I try it, I get an error that says:
 
Good morning, Captain ERROR: NO VEHICLE.

Have I missed something out here?   :P
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Dane

  • Guest
Re:Names in titletext
« Reply #3 on: 05 Aug 2005, 12:00:04 »
Quote
titletext [format ["Good morning, Captain %1.", name player],"plain down"]

Works for me, are you sure you have a name in the player setup meny?

Edit. Nvm just found out player can't can't :P have a name.
« Last Edit: 05 Aug 2005, 12:04:23 by DaneDK »

klavan

  • Guest
Re:Names in titletext
« Reply #4 on: 05 Aug 2005, 12:17:45 »
Edit. Nvm just found out player can't can't :P have a name.

Yes he can: you must create an identity in the description file.

@greg147
Has your player a name? I mean: in the GUI you can create an identity for the player. Have you did it?
Klavan
« Last Edit: 05 Aug 2005, 12:19:09 by klavan »

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Names in titletext
« Reply #5 on: 05 Aug 2005, 12:18:17 »
This is what I have:

Code: [Select]
titletext [format ["{Major} You and your squads are going to be inserted into enemy territory early tommorrow morning\n led by Captain %1 to destroy the enemies artillery prior to the main assualt.", name player],"plain down"]
But its not working for me   :-\
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

klavan

  • Guest
Re:Names in titletext
« Reply #6 on: 05 Aug 2005, 12:22:56 »
@greg147
Your code it's OK: works fine with me!
I still continue to think your player doesn't have a  name.
Klavan
« Last Edit: 05 Aug 2005, 12:25:14 by klavan »

Offline 456820

  • Contributing Member
  • **
Re:Names in titletext
« Reply #7 on: 05 Aug 2005, 13:10:24 »
since when was there a [ in front or format i use

Code: [Select]
titletext format ["{Major} You and your squads are going to be inserted into enemy territory early tommorrow morning\n led by Captain %1 to destroy the enemies artillery prior to the main assualt.", name player,"plain down"]
thats what i use and it always works for me

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Names in titletext
« Reply #8 on: 05 Aug 2005, 17:13:14 »
With hint format is outside the [ with titletext its inside.
Example:
titletext...
Code: [Select]
titletext [format["%1 says hi!",name player],"Plain Down"]hint...
Code: [Select]
hint format["%1 says hi!",name player]
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline 456820

  • Contributing Member
  • **
Re:Names in titletext
« Reply #9 on: 05 Aug 2005, 18:35:45 »
oh ok i just persumed that its outside the format alsoits out side with sidechats aswell

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Names in titletext
« Reply #10 on: 05 Aug 2005, 20:00:17 »
I found out that it works in a mission, but doesn't work in an intro. Which is knida what I need it for.
At first I thought it was because I have [ and ] in my username, but it turns out that its not.
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

klavan

  • Guest
Re:Names in titletext
« Reply #11 on: 05 Aug 2005, 20:07:52 »
Do you receive an error message?
If yes what kind of error message?
I've tested it: i've putted a dude (the player) in the intro section of the editor and in the his init field I pasted your code. I ran the prewiev and....Result: the text appeared correctly.
Klavan

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Names in titletext
« Reply #12 on: 05 Aug 2005, 20:16:07 »
The only error message I recieved was in the text itself.

When I ran it, the text said:

{Major} You and your squads are going to be inserted into enemy territory early tommorrow morning led by Captain error: no vehicle to destroy the enemies artillery prior to the main assualt.

My username is [Pte] Greg (The [Pte] is there because of the MP squad i'm in, so I don't really want to change it.)
Problem is, I have tried changing my username, and it won' let me. Whenever I click on my existing one, and select edit, it creates a new user.  :P

Heres the code I have again:
titletext [format ["{Major} You and your squads are going to be inserted into enemy territory early tommorrow morning\n led by Captain %1 to destroy the enemies artillery prior to the main assualt.", name player],"plain down"]

EDIT: BTW, I have not used setidentity on the player.
« Last Edit: 05 Aug 2005, 21:11:34 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Names in titletext
« Reply #13 on: 06 Aug 2005, 10:10:23 »
No need for setIdentity..
And that code of yours works fine here too...

Are you by any change editing an MP mission?
If so, maybe that has something to do with yer problem ???
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Names in titletext
« Reply #14 on: 09 Aug 2005, 01:30:43 »
The name command can be a bit wierd sometimes I've found...

name player will work fine in a mission, but not in the intro.
Try giving your unit a name (in the name field of the unit in the mission editor) and referring to that instead in the intro, eg.

name unit1

That's how I've always done it in my missions ;)