Home   Help Search Login Register  

Author Topic: userlist say "this"  (Read 788 times)

0 Members and 1 Guest are viewing this topic.

TERA_Forrest

  • Guest
userlist say "this"
« on: 23 May 2004, 08:39:41 »
in the coop i have a guy that needs rescued... and on the off chance somone playing would kill him i would like a message to pop up at the bottom of the screen saying...

"so and so is a cold hearted killer"

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:userlist say "this"
« Reply #1 on: 23 May 2004, 11:48:43 »
Something along the lines of

_villain=name theplayerinquestion

titletext [format ["%1 is a cold hearted killer.", _villain],"plain",1]

You'd need to add an eventhandler "killed" to the victim so that if he is killed you can pick up who killed him.
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #2 on: 24 May 2004, 03:28:11 »
it seems to name the civilian... isn't there a comand that says somthing like ...

"this in userlist"

or somthing?  The "kill trigger" works fine, i just can't seem to get the "killers" name up.  All players are "bas_west"(not officail name ;) ) peeps btw.
« Last Edit: 24 May 2004, 03:29:01 by TERA_Forrest »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:userlist say "this"
« Reply #3 on: 24 May 2004, 12:40:26 »
What have you done to get the killer's name?

bas_west or something would be typeof .... name is like  macguba.
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #4 on: 24 May 2004, 12:47:15 »
Something along the lines of

_villain=name theplayerinquestion

titletext [format ["%1 is a cold hearted killer.", _villain],"plain",1]

You'd need to add an eventhandler "killed" to the victim so that if he is killed you can pick up who killed him.


oh i c what i've done, i named the "hostage killed" not the player.  So would i just name all the playable charactors and do somthing like this (where p1 p2 p3 would be the name of the playable charactors):

titletext [format ["%1 is a cold hearted killer.", p1,p2,p3,p4],"plain",1]

 ???



TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #5 on: 24 May 2004, 22:03:36 »
ok, i can tell ur about to say... so try it out dummy... its a coop and generally i'll be playing it with other tera clan members, i don't want them to see a beta version... they need to be wow-ed lol   ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:userlist say "this"
« Reply #6 on: 25 May 2004, 10:20:45 »
No.

Firstly, check out the format command in the online version of the comref so that you understand it correctly.

Secondly, the only way I can think of to get the name of the killer is to use an eventhandler.    If you're not familiar with eventhandlers, check the comref, the FAQ and use the forum search function - there's a lot of good stuff on them kicking around.   In this case you'd add the eventhandler "killed" (as I said above) to the hostage.      The eventhandler is activated when the hostage is killed and it returns several things including the name of the killer.

You don't need to name the playable characters, they have names already.   Name in this context does not refer to what you might call variable name:   it refers to the actual name of the character, be in macguba, sergei lukin, david armstrong, TERA_Forrest or whatever.
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #7 on: 25 May 2004, 19:29:55 »
I aprciate your help macguba, i'll take a look at the com ref, ;)

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #8 on: 26 May 2004, 10:44:54 »
ok, confusion here... this is what i've found in the comref...


joe AddEventHandler ["killed", {leader joe groupchat "Oh no ! Joe is down !"}]


returned values are :

"killed" (addable to men or vehicles) :
_this select 0 : who's dead ;
_this select 1 : whodunnit (say, the killer) ;


so would I do somthing like...

hostage's init line:

_this select 1, h1 AddEventHandler ["killed", titletext [format ["%1 is a cold hearted killer.", _villain],"plain",1]
]


 ???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:userlist say "this"
« Reply #9 on: 26 May 2004, 15:14:18 »
Nearly.  :thumbsup:  Something more like this in the init line of the hostage:-

this AddEventHandler ["killed", {titletext [format ["%1 is a cold hearted killer.", _this select 1],"plain",1]}]

Syntax not guaranteed, you'll probably have to play with the brackets a little.

The bit in {} in the eventhandler is what happens on the event:  you could call a script for example.    

For the format command you need to have the variable at the end - check the syntax again in the online comref.
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #10 on: 26 May 2004, 20:30:39 »
it works! kind of... it names the "official name" of the playable char before his normal name... example:

"west charlie black 1:  -=tera=-Forrest is a cold hearted killer"

also i was reading through the comref and it said there may be a problem with using eventhandler, they said to use a public variable... would i have to do the public variable thing in the syntex?
« Last Edit: 26 May 2004, 20:53:25 by TERA_Forrest »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:userlist say "this"
« Reply #11 on: 26 May 2004, 22:25:55 »
Public variable is all to do with MP which I know nothing about.     However, in this case, I suspect it may not matter - hopefully an MP expert will jump in and tell us.   Public variable is all to do with whether a variable is local (exectuted on just one computer) or, conversely, executed on all computers or the server, if that's different.  Dunno.

Anyway, I have no idea how to get rid of the charlie black 1 thing.   Experiment. Play.  Use your initiative.  Try different things.   I've used this without getting that, so I don't know why it's appearing:  could be a subtlety in your syntax.
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:userlist say "this"
« Reply #12 on: 27 May 2004, 08:53:31 »
thanks for all your help, i will use this for now, when i find a fix for the other problem i'll post the answer in here ;)