• 0
Erzengel

_trader setName (_x select 9);

Question

Hey, in order to create audio dialogs between traders, civillians and players (for a mission system) i need to set the name of diefferent characters.

so i went into my initplayerlocal.sqf and edited the following:

,[],["medic2","",""] 

so my custom trader in there now looks like

["Exile_Trader_CommunityCustoms2", ["HubSittingChairB_idle3"], "Exile_Trader_CommunityCustoms2", "Barklem", [[],[],[],["U_C_Paramedic_01_F",[]],[],[],"H_Cap_marshal","G_Spectacles",[],["","","","","",""]], [6753.42, 13028.2, 12.3278], [-0.990275, -0.139121, 0], [0, 0, 1],[],["medic2","",""]]

the first

,[]

is in there for an addAction call so it should not really matter for this, so i guess u can ignore it

my other trader for this looks like this just to make sure the issue comes not from in here

["Exile_Trader_CommunityCustoms2", ["Acts_carFixingWheel"], "Exile_Trader_CommunityCustoms2", "WhiteHead_15", [[],[],[],["U_C_Paramedic_01_F",[]],[],[],"H_Cap_marshal","G_Spectacles",[],["","","","","",""]], [6748.02, 13028.8, 12.3531], [-0.608126, 0.793841, 0], [0, 0, 1],["Was ist denn hier los ?","mission\conversation.sqf","",1,false,true,"","((position player) distance _target) <= 4"],["medic1","",""]]

and yes, i do know i need a " , " on the first one of these but cause of this is just an example i left it away

 

the i went slitly down to the _trader section and edited

_trader setName (_x select 9);

so it now looks like this


    _trader setVariable ["BIS_enableRandomization", false];
    _trader setVariable ["BIS_fnc_animalBehaviour_disable", true];
    _trader setVariable ["ExileAnimations", _animations];
    _trader setVariable ["ExileTraderType", _x select 2];
    _trader disableAI "ANIM";
    _trader disableAI "MOVE";
    _trader disableAI "FSM";
    _trader disableAI "AUTOTARGET";
    _trader disableAI "TARGET";
    _trader disableAI "CHECKVISIBLE";
    _trader allowDamage false;
    _trader setFace (_x select 3);
    _trader setUnitLoadOut (_x select 4);
    _trader setPosWorld (_x select 5);
    _trader setVectorDirAndUp [_x select 6, _x select 7];
    _trader reveal _logic;
    _trader attachTo [_logic, [0, 0, 0]];
    _trader switchMove (_animations select 0);
    _trader addEventHandler ["AnimDone", {_this call ExileClient_object_trader_event_onAnimationDone}];
	_trader addAction (_x select 8);
	_trader setName (_x select 9);

i do hope anyone of u ever had the need of adding a name to an unit and you might be able to help me out now

Edited by Erzengel

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0
On ‎20‎/‎12‎/‎2017 at 8:17 PM, Erzengel said:

Hey, in order to create audio dialogs between traders, civillians and players (for a mission system) i need to set the name of diefferent characters.

so i went into my initplayerlocal.sqf and edited the following:


,[],["medic2","",""] 

so my custom trader in there now looks like


["Exile_Trader_CommunityCustoms2", ["HubSittingChairB_idle3"], "Exile_Trader_CommunityCustoms2", "Barklem", [[],[],[],["U_C_Paramedic_01_F",[]],[],[],"H_Cap_marshal","G_Spectacles",[],["","","","","",""]], [6753.42, 13028.2, 12.3278], [-0.990275, -0.139121, 0], [0, 0, 1],[],["medic2","",""]]

the first


,[]

is in there for an addAction call so it should not really matter for this, so i guess u can ignore it

my other trader for this looks like this just to make sure the issue comes not from in here


["Exile_Trader_CommunityCustoms2", ["Acts_carFixingWheel"], "Exile_Trader_CommunityCustoms2", "WhiteHead_15", [[],[],[],["U_C_Paramedic_01_F",[]],[],[],"H_Cap_marshal","G_Spectacles",[],["","","","","",""]], [6748.02, 13028.8, 12.3531], [-0.608126, 0.793841, 0], [0, 0, 1],["Was ist denn hier los ?","mission\conversation.sqf","",1,false,true,"","((position player) distance _target) <= 4"],["medic1","",""]]

and yes, i do know i need a " , " on the first one of these but cause of this is just an example i left it away

 

the i went slitly down to the _trader section and edited


_trader setName (_x select 9);

so it now looks like this



    _trader setVariable ["BIS_enableRandomization", false];
    _trader setVariable ["BIS_fnc_animalBehaviour_disable", true];
    _trader setVariable ["ExileAnimations", _animations];
    _trader setVariable ["ExileTraderType", _x select 2];
    _trader disableAI "ANIM";
    _trader disableAI "MOVE";
    _trader disableAI "FSM";
    _trader disableAI "AUTOTARGET";
    _trader disableAI "TARGET";
    _trader disableAI "CHECKVISIBLE";
    _trader allowDamage false;
    _trader setFace (_x select 3);
    _trader setUnitLoadOut (_x select 4);
    _trader setPosWorld (_x select 5);
    _trader setVectorDirAndUp [_x select 6, _x select 7];
    _trader reveal _logic;
    _trader attachTo [_logic, [0, 0, 0]];
    _trader switchMove (_animations select 0);
    _trader addEventHandler ["AnimDone", {_this call ExileClient_object_trader_event_onAnimationDone}];
	_trader addAction (_x select 8);
	_trader setName (_x select 9);

i do hope anyone of u ever had the need of adding a name to an unit and you might be able to help me out now

https://community.bistudio.com/wiki/setName

try that

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.