Jump to content

Recommended Posts

Hey! 

 

I've been trying to adapt the ambient civilian module released by BI to allow modded factions. So far the only way I've found this doable is by adding some code on unit created.

_civs = [
"LOP_Tak_Civ_Man_06",
"LOP_Tak_Civ_Man_08",
"LOP_Tak_Civ_Man_07",
"LOP_Tak_Civ_Man_05",
"LOP_Tak_Civ_Man_01",
"LOP_Tak_Civ_Man_10",
"LOP_Tak_Civ_Man_02",
"LOP_Tak_Civ_Man_09",
"LOP_Tak_Civ_Man_11",
"LOP_Tak_Civ_Man_12",
"LOP_Tak_Civ_Man_04",
"LOP_Tak_Civ_Man_14",
"LOP_Tak_Civ_Man_13",
"LOP_Tak_Civ_Man_16",
"LOP_Tak_Civ_Man_15"
];
_loadOut = selectRandom (getUnitLoadOut _civs); 
_this setUnitLoadout _loadOut 

As you can probably tell I'm using PO4 and want to make generic desert-y civlians. I haven't tested the code but it should be working. 

 

Now the only problem is the civies all look like John Wayne dressed up in taki wear. They speak greek/french too which is an issue as well as their names being Gorkhus Thanos and shit. 

 

Is there any way to impliment this somehow? 

identityTypes
"LanguagePER_F",
"Head_TK",
"G_IRAN_default"

faceType
"Man_A3"

genericNames
"TakistaniMen"

I want the language, heads and names fitting for the environment (far west asia) assigned to the civies. I haven't found a way of doing so without creating hundreds of versions of custom identities in the description.ext. 

 

Any help would be greatly appreciated!! :) 

Share this post


Link to post
Share on other sites

Try setFace, setName, & setIdentity.

Could look something like this:

private ["_names","_newName"];

_names = 
[
	["fullName0","firstName0","lastName0"],
	["fullName1","firstName1","lastName1"],
	["fullName2","firstName2","lastName2"],
	["fullName3","firstName3","lastName3"]
];

_newName = (selectRandom _names);
_this setName _newName;

You could put that into 'code on unit created' field.

Share this post


Link to post
Share on other sites
56 minutes ago, SpaceHippo said:

Try setFace, setName, & setIdentity.

Could look something like this:


private ["_names","_newName"];

_names = 
[
	["fullName0","firstName0","lastName0"],
	["fullName1","firstName1","lastName1"],
	["fullName2","firstName2","lastName2"],
	["fullName3","firstName3","lastName3"]
];

_newName = (selectRandom _names);
_this setName _newName;

You could put that into 'code on unit created' field.

Thanks. I'll have to write down a bunch of names then.. Do you know if there's any way to grab names from the PO4 pack? Also I'm assuming I can do the same thing with setIdentity. I'll probably have to make this into a completely different script to save some FPS eventually too smh.

Share this post


Link to post
Share on other sites
18 minutes ago, Spatsiba said:

Thanks. I'll have to write down a bunch of names then.. Do you know if there's any way to grab names from the PO4 pack? Also I'm assuming I can do the same thing with setIdentity. I'll probably have to make this into a completely different script to save some FPS eventually too smh.

You could always make your own names :P

In all seriousness though, there is a way with getText and configFile, but it may be harder considering you want specific faces. You might have to sort through classnames somehow.
Speaking on the perfomance remark, storing "_faces" under "faces" as a public variable on the server may help performance. As apposed to defining a variable every time a unit spawns.

Share this post


Link to post
Share on other sites
19 minutes ago, SpaceHippo said:

You could always make your own names :P

In all seriousness though, there is a way with getText and configFile, but it may be harder considering you want specific faces. You might have to sort through classnames somehow.
Speaking on the perfomance remark, storing "_faces" under "faces" as a public variable on the server may help performance. As apposed to defining a variable every time a unit spawns.

Yeah that's what I'm afraid I'll have to do. I want a damn script to fetch and write for me!! 

I'm already working on a way to make it all a public variable to fetch from so it doesn't have to rewrite itself hundreds of times in a mission. 

I should really make a ticket about making the civilian module a drop down and choose faction thing kind of like how zeus has the addons setting. Right now it's meant to "auto detect" if it's tanoa or altis.. but what about mods?? :(

Share this post


Link to post
Share on other sites
1 hour ago, Spatsiba said:

but what about mods?? :(

It should work the same way as vanilla, you just need the correct classnames. The config viewer in the debug console will be helpful for what you're doing.

 

Share this post


Link to post
Share on other sites
14 hours ago, SpaceHippo said:

It should work the same way as vanilla, you just need the correct classnames. The config viewer in the debug console will be helpful for what you're doing.

 

True but it'd be nice if the module used game mechanics like selecting a unit classname instead of reconfig a whole unit every time it spawns. It should technically use twice as much if not more resources doing it this ghetto way. 

Also about faces I think it's easiest just making custom identities in the description.ext and then selectRandom on those. Civilian names aren't really important for the missions I plan on using this in and there's plenty of other scripts for spawning civies like EOS style if you need it. 

 

Thanks for the help though! I'll definitely work something out of this. 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×