OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Baphomet on 05 Dec 2002, 10:05:20

Title: Scripting command regarding playernames.
Post by: Baphomet on 05 Dec 2002, 10:05:20
I would imagine there is one that allows either to specify a playername. I am trying to write a script which will display the name of a person in a multiplayer game if he triggers something.
Title: Re:Scripting command regarding playernames.
Post by: Chris Death on 05 Dec 2002, 18:38:14
Are you looking for this one?:

Code: [Select]
name object
Operand types:
    object: Object
Type of returned value:
    String
Description:
    Name of variable assigned to object in mission editor. In used on vehicle, name of first crew member (in order commander, driver, gunner).

Example:
    name vehicle player


~S~ CD
Title: Re:Scripting command regarding playernames.
Post by: Terox on 05 Dec 2002, 21:47:46
Eg of trigger as seen in mission.sqm file

Quote
      class Item43
      {
         position[]={7365.412109,118.396111,4775.931641};
         a=300.000000;
         b=300.000000;
         activationBy="EAST";
         repeating=1;
         age="UNKNOWN";
         text="EWarning";
         name="EWarning";
         expActiv="Titletext[format[""%1 \n You are entering a West Safezone \n Turn around or die!"",name(thisList select 0)],""Plain down""]";
         class Effects
         {
            sound="Alarm";
            titleEffect="PLAIN DOWN";
         };
      };

Place this in the triggers activation field

Titletext[format["%1 \n You are entering a West Safezone \n Turn around or die!",name(thisList select 0)],"Plain down"]

This is a trigger that displays a warning on screen, naming the East player that activated the outer area trigger of the protected West respawn zone

the \n is a switch that enters the following text on a new line




Hope this helps
Title: Re:Scripting command regarding playernames.
Post by: rchxenson on 13 Dec 2002, 01:58:11
or this works too.....for salute and name....(when using camera)
ap1 being the name of that character

;point the camera at the ap1 and display name
_cam camsettarget ap1
_cam camsetrelpos [0,2,1]
_cam camcommit 6
~6
Titletext ["" + (name ap1),"PLAIN DOWN"]
ap1 playmove "EffectStandSalute"
~5
Title: Re:Scripting command regarding playernames.
Post by: Pandoz on 19 Dec 2002, 06:46:10
well if u want ur script to work on every1 playing then use the %1 for their name...that is just basically saying that whoever trips the triggers activation will have their name displayed.