×
Spam Prevention - Please Read! (23 Apr 2021)

Due to a problem with spammers the rules for posting in the forums have changed for new users.

Newly registered users won't have their posts published until a moderator approves them.

How to make characters appear randomly in a mission/scenario?

More
1 week 3 hours ago - 6 days 2 hours ago #2343 by Slippery Jim
After a bit of research it looks like there are only 2 sections of the scenario file that needs to be modified to make random versions from a "template" scenario.

Objectives

    Hostage    Rescue    1
    Suspect    Neutralize    2
    TRACI_B    Arrest    1


Characters

There are 5 different types of characters in this section:

Primary suspect - action is "Arrest"
Primary hostage - action is "Primary"
Suspect - action is "Neutralize"
Civilian -  action is "None"
Hostage - action is "Rescue"

I can see the amount of suspects, civilians, and hostages to be randomized but should the primary suspects be randomized also?   It can be done but you would have to be careful not to mention the primary in the mission description (since they might not be there if randomized).

Updated:  forgot to include one type of character action
 

Please Log in or Create an account to join the conversation.

More
6 days 2 hours ago - 6 days 2 hours ago #2345 by Slippery Jim
Almost done it. My lazy kid didn't want to help out during his summer break so I made it myself in Visual Studio.

Work in progress screenshot below.   As you can see the loading of the scenario all works.   I still have to work on the random choice and the saving process.

 

Update:  Just noticed I didn't include Primary Hostage.
Attachments:

Please Log in or Create an account to join the conversation.

More
5 days 58 minutes ago #2348 by Slippery Jim
New version with changes.   Only saving of the generated scenarios left to do.

 
Attachments:

Please Log in or Create an account to join the conversation.

More
4 days 17 hours ago - 4 days 17 hours ago #2349 by mobiuscenturion
This is nice. But how do you restrict the app to a certain type of suspect/hostage?

You know, I should have mentioned this earlier: if you played SWAT 4, the Quick Mission Maker has something very close to what you are making, except you can restrict the suspect or hostages to certain type. So if you want only mechanics in the repair shop, the game will put a random number but restricted to that type.

EDIT: There also something else: whenever you use the in-game randomizer for custom maps, sometimes most (if not all) characters spawn where SWAT does. Of course this doesn't happen with the vanilla maps. So if it's not too late, could you also define the spawn points for the characters so they don't spawn in the same place as SWAT?

Please Log in or Create an account to join the conversation.

More
4 days 8 hours ago - 4 days 8 hours ago #2350 by Slippery Jim
If you want to make a certain character class not random you would put, for example,  5 out of 5 for both minimum and maximum if there were a total of 5 in the character class.   Or if you decide you don't want a character class put them both to 0 (or don't put them in the scenario in the first place, lol).

As for the in-game randomizer this app only affects your pre-generated scenarios.    We would need the source code to modify how the in-game randomizer works.   Sorry.

Please Log in or Create an account to join the conversation.

Time to create page: 0.288 seconds
Powered by Kunena Forum