Jump to content
Sign in to follow this  
ragnos

Random identities script in description.ext

Recommended Posts

It is possible to create my own script for random identities? And it's even possible to run scripts in description.ext?

For example if I want my security agency from Norway, I need some norwegian names and soldiers without black or asian faces.

And solution without addons or editing game config would be great :)

Something like this in description.ext?

class CfgIdentities
{
  class random
  {
     name=///insert random name from some array of names///;
     face=///array of faces///;
     glasses="None";
     speaker=///array of speakers///;
     pitch=///random number from 0.8 - 1.2///;
  };
}; 

soldier's init

this setidentity "random";

Edited by Ragnos

Share this post


Link to post
Share on other sites

Not 100% sure, but I think Description.ext is just a list of set properties.

What you could do is create a bunch of possible identities, and in the SQF script randomly assign one of the identities to each person. Also, you can setFace on any unit at any time, without need of identities.

I'm at work or I would go into more detail. If you need more input, let me know, or maybe someone else will assist too.

Edited by AZCoder

Share this post


Link to post
Share on other sites

Thank for reply AZCoder. I did little "research" and you are propably right about description.ext.

Your solution with bunch of possible identities with random setIdentity script is good, but not so elegant (it's not universal).

I want script where I put to some arrays few names, faces and voices and it's done.

Possible solution is maybe #include function for description.ext combined with some *.hpp file where is maybe some scripting possible (or calling some *.sqf scripts from *.hpp file). In Eagle Wing campaign are *.hpp files with signs of used scripts used for some effects. When I have some free time again I look at this again :)

Share this post


Link to post
Share on other sites

this setIdentity "random" is possible with some easy scripting. But I don't think it's possible to redefine actual identities this way. You could possibly make an addon that does it (redefine names and possible faces) as the game already does this. But as a scripted solution? I don't think so.

Possible not-so-elegant workaround. Make a program that creates a bunch of id's for you, outputted in description.ext identities format, and merge the outputted list to any static/fixed identities you want to use. Such a program could be made with just about anything, including a spreadsheet program.

Share this post


Link to post
Share on other sites

The pitch can be randomized. I experimented. I think this is the range you were looking for

pitch = ((random(4)/10)+0.8);

The other values are what we call class properties. The game engine expects pitch to be a floating point value, which is why you can randomize it. The other properties are strings, so even if you try to randomize it, the result will be the literal code used to randomize, as opposed to a result. I'm not saying it's impossible, but I can't think of a way to do that.

As far as appearance, that is very easy to do in your startup scripts.

http://community.bistudio.com/wiki/setFace

You could create an array of acceptable faces, and randomly choose one for each person in question.

For other properties, I really don't know.

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
Sign in to follow this  

×