Jump to content
twistking

easy ways to randomize missions without external scripting?

Recommended Posts

Hello,

 

i would like to randomize my missions with more or less predefined variants without the need for external scripts (the way we play in coop is very "sandbox-like": play, change sth. play again etc... and external scripts are often confusing when you make changes on the fly).

 

my first idea is to duplicate some groups and then set condition of presence for each group, to somehow determine that only one of each groups is present in the mission with slightly different waypoints etc.

- can i set conditions of presence for whole group, or would i have to do it manually for each unit of the group?

- how can i set variables for the condition, before the units are spawned? is there a eden object/logic that can run code before everything else without need for external script?

- what would be syntax for such a logic? i guess i would need sth. like "random choose A1 or A2, random choose B1 or B2, random shoose C1 or C2"...

 

- are there any eden-point-and-click-ways to randomize waypoint - for example connect waypoint to a certain trigger or module to randomize it's position between original position and synced position? you can group an object to a marker to randomize starting position between all grouped markers, but having sth. like this for waypoints would make more sense...

- how can i use the switch trigger with a random condition to have the group go to a different predefined waypoint each playthrough? is there perhaps another way to randomize predefined waypoints?

- any other idea on how to easily randomize waypoints between somehow predefined positions?

- can i use eden compositions for randomizing mission without external scripting? for example have waypoints and "composition X" at either position A, or position B?

 

- i also would like to hear your general approach, when you try to make very basic missions with decent replayability. what simple tricks work well and is there any formula you use, if you want to make a fun mission in very short time?

 

i'm mostly interested in very basic waypoints structure. units spawn somewhere and mostly it would be about going to position 1 or position 2 and stay there. or alternatively have a guard waypoint at one of several predefined positions.

(for truly random patrols etc. i use bis_func_taskpatrol or SAD waypoint with big random waypoint position radius, which works well.)

 

thanks! any help or sugegstions appreciated:)

Share this post


Link to post
Share on other sites

- i also would like to hear your general approach, when you try to make very basic missions with decent replayability. what simple tricks work well and is there any formula you use...

To make replayable missions, you really need to script. A lot.

make a fun mission in very short time?

Impossible.

 

- can i set conditions of presence for whole group, or would i have to do it manually for each unit of the group?

- how can i set variables for the condition, before the units are spawned? is there a eden object/logic that can run code before everything else without need for external script?

- what would be syntax for such a logic? i guess i would need sth. like "random choose A1 or A2, random choose B1 or B2, random shoose C1 or C2"...

 

- are there any eden-point-and-click-ways to randomize waypoint - for example connect waypoint to a certain trigger or module to randomize it's position between original position and synced position

Get some script and follow the instructions, it's not hard. I use UPS.

Share this post


Link to post
Share on other sites

I kind of disagree with theend3r here.

You don't need to script a lot, you only need to know what you're doing.

 

You can place all possible missions/tasks on the map and then disable/enable them on the fly with enableSimulationGlobal and hideObjectGlobal.

 

On the other hand if you start building your function library it can grow pretty quick, especially if you keep an eye out for redundant stuff.

So you can easily have a mission that involves hostage rescue and evac, depending on the outcome this can trigger other scripts to chime in.

 

Then there's still Zeus, when in the right hands can be an exciting experience too.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

To make replayable missions, you really need to script. A lot.

Impossible.

 

Get some script and follow the instructions, it's not hard. I use UPS.

 

i know. and i know how to use scripts (as long a i don't have to write them myself). that's not the problem...

 

thing is, for the simple missions that i make (and enjoy!!!) i sometimes want some more control, f.e. for manually placing waypoints and manually setting up defensive positions at strategic positions etc.

i would however like to get some randomization going on while still be able to have that sort of control...

"ups" and similar scripts are indeed great, but they are not what i am looking for right now.

 

You can place all possible missions/tasks on the map and then disable/enable them on the fly with enableSimulationGlobal and hideObjectGlobal.

 

On the other hand if you start building your function library it can grow pretty quick, especially if you keep an eye out for redundant stuff.

So you can easily have a mission that involves hostage rescue and evac, depending on the outcome this can trigger other scripts to chime in.

 

 

ok. cool. but for simple mission design with very simple "either this or that" structure, shouldn't be "condition of presence" be a more elegant approach? thing is, that i don't know how to properly implent this, but if i understand correctly it would only spawn the units that are associated with a parameter and the others wouldn't even spawn. so there would be no need to worry about state of simulation of a unit...

Share this post


Link to post
Share on other sites

The best method for this i've found is using alive in conjunction with building a regular mission.

 

So say the  mission is assassinate the HVT. You place him down on the map as normal with 100% probability of being there, You could give him a loiter waypoint of some other way to randomise his placement. Set up a few other static things to make it more realistic (like bodyguards or static weapons or whatever)

 

Then start placing your Alive stuff using small TAOR markers. Have Alive spawn two groups of Spec Ops within 1km of the target, maybe throw in some convoys or helo's. Alive's OPCOM module will take care of all the mobility and placement of units making that effectively random each time.

 

My group has made a huge mission with about 10 tasks, each of which spawn sub-tasks, using this method. We now have a fully re-playable full-map mission which a group could play for weeks without getting bored. We've used almost no scripts (apart from ones in our base for cleanup/vehicle loadouts/repairs)

 

if you want a copy PM me, although it does have a ton of dependencies, so it might not be much use to you without our mod repo.

 

on a side note, i've used UPS  and also EOS and they don't require too much scripting - You just tweak values on scripts already provided to you. Pretty easy, even i could do it and i get confused after a script goes beyond about 6 lines :)

 

You could knock out a basic mission with a few tasks in about an hour or two, Our largest mission took about a week to make, but that was adding new tasks every day after we had the basic one on the server.

 

 

Gav

  • Like 3

Share this post


Link to post
Share on other sites

@gavc: ok. thanks for the suggestions. will try it out soon. have recently tried out alive, but haven't really used it yet. thanks for the offering of the mission, but i guess it will be quite a hazzle with the mods. guess i will find it out on my own. like i said, i know how to work with these script-mods, i'm just kind of a vanilla-fan - trying to get as far as i can with vanilla comamnds and functions...

 

 

two more quick question:

 

1: can someone tell me the syntax/command for a triggers condition field to have 50% change of firing the trigger?

 

2: what would be the syntax/command for a triggers "on activation" field to randomly set either variableA1 true OR set variableA2 true.

Share this post


Link to post
Share on other sites

I don't understand what you mean by 1) but if you just want a trigger with 50% chance to activate after its conditions are satisfied then it can't be done through the condition field but through the activation field:

if (selectRandom [true, false]) then { code };

2: what would be the syntax/command for a triggers "on activation" field to randomly set either variableA1 true OR set variableA2 true.

call compile format ["%1 = true", selectRandom ['variableA1', 'variableA2']];
  • Like 1

Share this post


Link to post
Share on other sites

The best method for this i've found is using alive in conjunction with building a regular mission.

 

So say the  mission is assassinate the HVT. You place him down on the map as normal with 100% probability of being there, You could give him a loiter waypoint of some other way to randomise his placement. Set up a few other static things to make it more realistic (like bodyguards or static weapons or whatever)

 

Then start placing your Alive stuff using small TAOR markers. Have Alive spawn two groups of Spec Ops within 1km of the target, maybe throw in some convoys or helo's. Alive's OPCOM module will take care of all the mobility and placement of units making that effectively random each time.

 

My group has made a huge mission with about 10 tasks, each of which spawn sub-tasks, using this method. We now have a fully re-playable full-map mission which a group could play for weeks without getting bored. We've used almost no scripts (apart from ones in our base for cleanup/vehicle loadouts/repairs)

 

if you want a copy PM me, although it does have a ton of dependencies, so it might not be much use to you without our mod repo.

 

on a side note, i've used UPS  and also EOS and they don't require too much scripting - You just tweak values on scripts already provided to you. Pretty easy, even i could do it and i get confused after a script goes beyond about 6 lines :)

 

You could knock out a basic mission with a few tasks in about an hour or two, Our largest mission took about a week to make, but that was adding new tasks every day after we had the basic one on the server.

 

 

Gav

Bingo.

My squad leader put together a hostage rescue mission on Tanoa. The hostage was in a set compound but ALiVE randomized the entry/exit areas. It was intense and we had a great time.

After we successfully finished the mission (we faced almost no resistance on entry, with a crap ton on exit), he told us stories about his when he was playing it alone, he couldn't even finish the entry part because the vicinity was littered with OPFOR. When we played there was none and like I said, it was awesome.

That's the basic idea with The Contractor mission I made in my signature. There's a set piece of Intel. That Intel reveals 3 "random" locations (one marker and two random markers) where the hostage can be found. The battle field has two TAOR's for OPFOR so every time, not only is the mission built to be kind of random, but ALiVE itself will randomize things too because that's the nature of the mod.

  • Like 1

Share this post


Link to post
Share on other sites

@theend3r

thank you very much.

 

yes, 50% chance of activation after conditiosn are satisfied is what i meant. well, basically i don't care about other conditions. i just want a trigger to have a 50% change of firing at mission start...

the only problem might be, that i don't want to run code with the trigger, but use the trigger function "skip waypoint". so, if the trigger fires the synced waypoint gets skipped.

if (selectRandom [true, false]) then this

might this do the trick? i'll give it a try....

 

the call "compile format" looks very fancy. thanks a lot. i will try it:)

Share this post


Link to post
Share on other sites
the only problem might be, that i don't want to run code with the trigger, but use the trigger function "skip waypoint". so, if the trigger fires the synced waypoint gets skipped.
if (selectRandom [true, false]) then this

might this do the trick?

No, I'm afraid that won't work. It can only help you execute a code which could very well be a simple code to skip to the next WP.

  • Like 1

Share this post


Link to post
Share on other sites

No, I'm afraid that won't work. It can only help you execute a code which could very well be a simple code to skip to the next WP.

 

ok. thanks but i guess i could do

if (selectRandom [true, false]) then { variA = true };

and then have a second siyp-trigger with "vaiA" in "condition" field and that trigger syncs to the waypoint!?

 

edit: doesn't work. :(

 

but i got what i wanted with theend3rs code (thanks again!):

call compile format ["%1 = true", selectRandom ['variableA1', 'variableA2']];

and used only variableA1 as condition for the skip trigger. yay! so it should be a 50% change of firing...

Share this post


Link to post
Share on other sites

To make replayable missions, you really need to script. A lot.

Impossible.

Get some script and follow the instructions, it's not hard. I use UPS.

That wasn't very helpful was it.

Share this post


Link to post
Share on other sites

could someone tell me, why this is not working?

if (selectRandom [true, false]) then { variA = true };

i basically want a 50% change of a variable to be true.

(to be put into logics/objects init or triggers "on activation", not for external script)

Share this post


Link to post
Share on other sites

could someone tell me, why this is not working?

if (selectRandom [true, false]) then { variA = true };

i basically want a 50% change of a variable to be true.

(to be put into logics/objects init or triggers "on activation", not for external script)

Just tried it and it works for me. (calling if (selectRandom [false, true]) then { hint "ok" }; from the debug console returns "ok" half the time)

Maybe you're just forgetting to define the variable if it's false?

if (selectRandom [false, true]) then { variA = true } else { variA = false };

or more simply

variA = selectRandom [false, true];
  • Like 1

Share this post


Link to post
Share on other sites

Maybe you're just forgetting to define the variable if it's false?

 

sir, that may very well be the case. thank you very much. i'm not good with code.

Share this post


Link to post
Share on other sites

Scripting is helpful but by no means necessary to make a good replayable mission.

In fact there are plenty of tools available for that involve no scripting at all.

 

 

Things like:

placement radius

probability of presence

 

And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

  • Like 3

Share this post


Link to post
Share on other sites

Scripting is helpful but by no means necessary to make a good replayable mission.

In fact there are plenty of tools available for that involve no scripting at all.

 

 

Things like:

placement radius

probability of presence

 

And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

 

Those things can already change how a mission will look and feel alot. I highly recommend that.

 

You can also work with tasks that way.

  • Like 1

Share this post


Link to post
Share on other sites

Oh and "guard" waypoints are also quite good for having the AI dynamically adjust to the situation.

  • Like 2

Share this post


Link to post
Share on other sites
And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

 

is there a workaround to somehow copy the direction of the marker? this would be rather imprtant for vehicles and fortification objects. as it is now, the object keeps it's initial direction...

 

You can also work with tasks that way.

 

how would that work?

 

Oh and "guard" waypoints are also quite good for having the AI dynamically adjust to the situation.

 

yes, guard-waypoints are incredibly effective. unfortuantely the "guarded by trigger" does not seem to work (tested on stable branch). but even without the trigger, the guard waypoint is a very cool tool.

Share this post


Link to post
Share on other sites

And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

Seriously? Never new that, thats awesome!

Share this post


Link to post
Share on other sites

Ah well thats a bit complicated then.

An alternative would be to place several copies of the object and upon missionstart delete all but one.

 

 

Lets assume you have 3 camps.

Put this in the init-line of an object:

if (isServer) then {missionNamespace setVariable ["randomvar", ceil(random 3), true]};

"randomvar" beeing the name of the variable you want to use.

3 because we have 3 positions to cover

 

 

Then place one trigger at each camp thats cover the whole area.:

Make it trigger only once.

 

condition:

randomvar != 1

 

onAct:

{deleteVehicle _x} forEach thisList;

 

 

Change the numer in the condition for each trigger from 1 to 3

I've never tried it like that myself but it should work. ^^

  • Like 1

Share this post


Link to post
Share on other sites

 

And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

 

It's things like this that should be shouted from the roof tops. I bet you there are loads more functionality in the editor that just isn't well known...

  • Like 1

Share this post


Link to post
Share on other sites
And especially (seems like very few people know about that) you can place down several markers and group them with an object. This will make the object spawn randomly at one of the marked positions (initial position of the object included)

 

I want to try out, if this also works with "non physical" objects. this way you could have some sort of "logic" be placed randomly at predefined places and then somehow create a waypoint with addwaypoint on the logics position.

this way you could have a group move to a location that is randomly selected from predefined locations.

 

What editor object could i use as a dummy object? a logic entity perhaps? which one?

What would be the correct syntax to add a waypoint for a group? mywaypoint =_this addwaypoint [position MyObject, 0]; ???

Do you have another idea on how you could make a group randomly select a location to move to - from a pool of predefined locations?

Share this post


Link to post
Share on other sites

I used to create a couple "on the fly campaign-like missions", using reset scripts to purge old objectives and making new ones. It ended with a hunk of scripts and triggers and variables in the mission, which bloated it beyond anything I ever seen b4.

 

It IS possible to do it with little effort and little scripts but that will be very "limited" in terms of variation and esp. randomization. Like, UPS does work! but it can create the funkiest mission layouts, like objectives completing on their own b/c stuff is spawned in the water and dies, or mission targets dying on spawn and such.

 

Without effort, it is really hard to make a well made balanced and finely tuned working machinery, which is why so many maps and scripts aren't slapped together overnight. And I'm getting old so that ain't helping either... but thats just myself :P

  • Like 1

Share this post


Link to post
Share on other sites
What would be the correct syntax to add a waypoint for a group? mywaypoint =_this addwaypoint [position MyObject, 0]; ???

Do you have another idea on how you could make a group randomly select a location to move to - from a pool of predefined locations?

Always try to consult the wiki first. If _this contains your group then yes, that's correct.

For the second question: Place some markers (empty type, under system, so players can't see them), let's say mrk1..mrk10, save this

_grp = _this select 0;
_n = ceil random 10;
_mrk = "mrk" + str(_n); // or just list the names by _mrk = selectRandom ["mrk1", "mrk2"...etc.];
_wp = _grp addWaypoint [getMarkerPos _mrk, 0];

as some randomWP.sqf and call it from the game by _nul = [someGroup] execVM randomWP.sqf.

  • 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

×