For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Unreal Ed Coop Map Dilemma

Ask UnrealEd 1 mapping related questions, or give hints, tips and tricks
Post Reply
User avatar
XtCPhoenix
OldUnreal Member
Posts: 8
Joined: Sun Apr 14, 2013 4:40 pm

Unreal Ed Coop Map Dilemma

Post by XtCPhoenix »

For a Coop map I am working on, I have 4 objectives (which I want to be able to be triggered in any order). Once all 4 objectives have been completed, an exit door is triggered to open…

My goal: After the (whichever) 1st objective is completed, I am looking to have 1 skaarj enemy spawn near each of the 3 remaining objectives (3 skaarj total). Once the 2nd objective is triggered, to have 1 skaarj spawn near each of the 2 remaining objectives (2 skaarj total). And finally, once the 3rd objective is triggered, have 1 skaarj spawn near the single remaining objective. In other words, there should always be 1 skaarj guarding the 2nd objective the player approaches, 2 skaarj guarding the 3rd, and 3 skaarj guarding the 4th.

It is straightforward to do this if the players MUST complete the objectives in a designated order, but I can’t seem to wrap my head around how to do this when the players may complete the objectives in ANY order.

Failure 1 (may confuse you): I experimented having 3 triggers on top of one another AT each objective (main triggers) that activate their own trigger near that room’s exit (perimeter triggers), which would in turn be linked to their own thingfactory/spawnpoints near the other 3 objectives. These 3 main triggers would also need to deactivate each main trigger at the other 3 objectives that corresponds to the objective you are currently at. A circular reference persisted, however, and this didn't work.

Failure 2: I also experimented using counters, with each objective having the same event name and linked to 4 counters. When the ‘1’ counter is triggered (any 1 of the objectives is complete), 1 skaarj spawns near the other 3 objectives, etc. However, a spawn point for this factory would obviously need to be placed at ALL 4 objectives, and I was not aware of a way to deactivate a spawnpoint and assure the 3 skaarj only spawn at the 3 spawnpoints near the remaining 3 objectives.

Any help would be greatly appreciated! Thanks!
User avatar
Lurker
OldUnreal Member
Posts: 38
Joined: Tue Mar 03, 2015 4:11 am

Re: Unreal Ed Coop Map Dilemma

Post by Lurker »

Hello XtCPhoenix.

First off, let me throw in the reason for this dilemma in just one sentence from a coder's perspective:

Triggers in UnrealEngines have common single-bool states (True/False) and not multi-bool states (Flags) to begin with!

Now this may sound confusing too. Let me explain what this sentence means, so you and others will easily understand the nature of the problem and be able to wrap your head around it...

For a simpler illustration let's say the goal is to enter 4 rooms and press a single switch in each room in a special pre-defined order to activate a teleporter in a 5th room and exit the level. The goal is divided into 4 objectives:

Objective 1 is to press Switch 1 in Room 1 first.
Objective 2 is to press Switch 2 in Room 2 second.
Objective 3 is to press Switch 3 in Room 3 third.
Objective 4 is to press Switch 4 in Room 4 at last.
After Objective 4 is completed then exit teleporter is activated.

Such complex processes can be achieved by using normal Triggers and Dispatchers in UnrealEd and setting them up in a "Domino Effect" type of way. This means first all triggers and dispatchers are deactivated by setting the bInitiallyActive bool state of each trigger and dispatcher to FALSE! Except the first ones in Room 1 since this is the beginning of the ordered sequence anyway.

1. When Switch 1 is pressed then it activates Switch 2 in Room 2.
2. When Switch 2 is pressed then it activates Switch 3 in Room 3.
3. When Switch 3 is pressed then it activates Switch 4 in Room 4.
4. When Switch 4 is pressed then it activates exit teleporter in Room 5.

However, as you have already explained and found out yourself, there is a major failure in all this!

Because Triggers have single-bool states and not multi-bool states, thus they have only one state (either activated or deactivated), don't know the state of the previous trigger (which activated the current trigger), thus the pre-defined order is useless and won't work when a player activates the Switches in a different order. In fact, a player can completely screw up and cheat the whole ordered sequence by walking in Room 3 and pressing Switch 3 first to activate Switch 4 in Room 4 and then pressing Switch 4 to activate the exit teleporter in Room 5, totally ignoring the other Rooms 1-2 and Switches 1-2.

So what can you do about this problem? This is your actual question now easily illustrated.

The answer is: Unfortunately there is no work-around in UnrealEd with the standard Trigger and Dispatcher classes, neither with the Counter class. You have to code your own core Trigger type class from scratch to accomplish this effect!

I call it a MultiStateTrigger which is chained to other MultiStateTriggers in order to force complex ordered Event dispatches. No Unreal modder has ever coded anything like this, so you can be the first one, or I could do it in my spare time...  ;)

Here's a code example (no actual working code, just for illustration purpose):

Code: Select all

class MultiStateTrigger extends Triggers
      native;

// For triggers that are activated/deactivated by other triggers. (Multi-States 1..4)
var(MST) bool bInitiallyActive1;
var(MST) bool bInitiallyActive2;
var(MST) bool bInitiallyActive3;
var(MST) bool bInitiallyActive4;
var(MST) byte RequiredActiveStates;
var(MST) string RequiredBoolFlag; // 4 flag bits (0 = False, 1 = True)
...

defaultproperties
{
     bInitiallyActive1=False
     bInitiallyActive2=False
     bInitiallyActive3=False
     bInitiallyActive4=False
     RequiredActiveStates=4
     RequiredBoolFlag="1111"
}
A MultiStateTrigger would dispatch its Event Tag only when 2 (minimum) to 4 (maximum) of the Trigger bool states are set to TRUE/Active/ON. (or when number of RequiredActiveStates is reached and RequiredBoolFlag is matched)

From an internal code execution perspective this will work as following:

1. Each 4 bool states of all MultiStateTriggers 1 to 4 are initially set to FALSE (bInitiallyActiveX=False, X = 1..4).
2. When MultiStateTrigger 1 is touched/activated then MultiStateTrigger 1 (bInitiallyActive1=True) sets the states of MultiStateTrigger 2 (bInitiallyActive1..2=True).
3. When MultiStateTrigger 2 is touched/activated then it self-checks whether its own bInitiallyActive1..2 are set to TRUE and only then sets the states of next MultiStateTrigger 3 (bInitiallyActive1..3=True).
4. When MultiStateTrigger 3 is touched/activated then it self-checks whether its own bInitiallyActive1..3 are set to TRUE and only then sets the states of next MultiStateTrigger 4 (bInitiallyActive1..4=True).
5. When MultiStateTrigger 4 is touched/activated then it self-checks whether its own bInitiallyActive1..4 are all set to TRUE and only then activates exit teleporter.

As you can read, from a programming perspective it is not so simple and requires complex re-coding of the core Trigger class in UnrealEngine1. Complex Functions such as "self-check of InitiallyActiveStates" and "setting or toggling of 1 to 4 InitiallyActiveStates of other MultiStateTriggers" (Chain Effect) have to be implemented to make it work.

As I already said, nobody has coded such a complex Trigger type yet. In my opinion it is very hard to do, because you also have to code a function which always knows the InitiallyActiveStates 1..4 of all the other MultiStateTriggers which it is chained to and knows what to do next, based on this information. Most likely this can be achieved by giving all 4 InitiallyActiveStates in each MultiStateTrigger its own Tag to be verified individually.

I hope this helps to better understand your dilemma and how it can be solved with advanced coding skills.
Last edited by Lurker on Wed Apr 22, 2015 2:29 pm, edited 1 time in total.
User avatar
Lurker
OldUnreal Member
Posts: 38
Joined: Tue Mar 03, 2015 4:11 am

Re: Unreal Ed Coop Map Dilemma

Post by Lurker »

For a Coop map I am working on, I have 4 objectives (which I want to be able to be triggered in any order).
Hmm.. I have read through your initial post again and noticed that you said "to be triggered in any order".
Before I make your problem more complex than it is, I ask you to be more specific about your problem...

Do you mean the objectives can be completed in any order or do you want them to be completed in a special order?

Because if you want them to be completed in any order then you can accomplish this with the normal Trigger and Dispatcher classes in UnrealEd, using single bInitiallyActive state in each trigger, and ignore everything which I just wrote in my previous reply posting.

So or so, the dilemma is simple to understand but not so simple to solve.
Last edited by Lurker on Wed Apr 22, 2015 1:38 pm, edited 1 time in total.
User avatar
XtCPhoenix
OldUnreal Member
Posts: 8
Joined: Sun Apr 14, 2013 4:40 pm

Re: Unreal Ed Coop Map Dilemma

Post by XtCPhoenix »

Thanks for the reply, Lurker.

To clarify, I would like the objectives to be able to be completed in ANY order (3, 2, 4, 1 or 1, 2, 3, 4 or 4, 2, 1, 3...etc)

A Failure #3 I had (which I did not type out in my original post, as was similar to failure #1) did involve dispatchers, but I may have linked the dispatchers to the main/perimeter triggers incorrectly.

I'm thinking through how this would work...
Last edited by XtCPhoenix on Wed Apr 22, 2015 2:17 pm, edited 1 time in total.
User avatar
Lurker
OldUnreal Member
Posts: 38
Joined: Tue Mar 03, 2015 4:11 am

Re: Unreal Ed Coop Map Dilemma

Post by Lurker »

Right. The so-called base capabilites of UnrealEngine do not feature Trigger states to be verified in a specific order, only to activate Triggers and Events in a pre-defined order using Dispatcher, RoundRobin and basic Unreal Trigger types.

You have to code your own Trigger class to accomplish your goal and force strict execution order (see MultiStateTrigger example in my initial reply). Or you may look for a hidden work-around which nobody has discovered yet, although I doubt that such work-around exists with the base Unreal classes.

If you intend your trigger sequence to be activateable (is that a proper word?) in ANY order then you can accomplish this with the base Unreal Triggers, Dispatchers and/or Counters, as previously said.
Last edited by Lurker on Wed Apr 22, 2015 2:35 pm, edited 1 time in total.
User avatar
SFJake
OldUnreal Member
Posts: 252
Joined: Sun Aug 15, 2010 4:31 pm

Re: Unreal Ed Coop Map Dilemma

Post by SFJake »

3 triggers at each objectives (+ the main one)

Each trigger goes to a dispatcher that spawns stuff for each other objectives.

When an objective is completed, you also need to shut off the relevant triggers so that they don't spawn monsters where you don't want to. Thats why there are 3 triggers at each objectives instead of just 1.

Handle every spawning with an independant CreatureFactory-SpawnPoints, all of which are hidden and activated by triggers/dispatchers as necessary.

With this setup, once you completed 3 objectives, the 4th would have had monsters spawned 3 times, so there would be 3 skaarj by the time you get to it.

I do not understand where the problem lies? I know this stuff can be confusing to use, but it all sounds very possible without any custom classes.


You can even go more complex and use counters with trigger and activatable triggers to completely customize how things spawns depending on the order, but I do not believe that you asked for something that complex.

Again, none of this should require custom classes.
Last edited by SFJake on Fri Apr 24, 2015 1:53 am, edited 1 time in total.
SFJake Center -
Unreal Nightmare - http://sfjake.byethost7.com/unrealnmproject.html
Post Reply

Return to “UnrealEd, the editor for Unreal up to version  226”