Jump to content

Dune2000 D2k Editor ~ How to use Flags


Gothmaster

Recommended Posts

Hey.
I,ve searched many topic's for a answer about how to use flags in the Dune2000 Maps and Mission Editor.
I Use the D2k Maps and Mission Editor to create Dune2000 Missions.
I can not figure out how to use
flags in the editor.
I tried to understand how the Events&Conditions>>Create Events>>Harvester Replacement does work.
My Question below the Event Description:
If I create that event for Harkonnen on Event #1 and ConditionType #1 it creates:

Event:                              Position:             Player:                                   Contents:                                 Conditions:
#1 Reinforcement     >>     0,0         >>        Harkonnen          >>               None 1: 1x Harvester       >>    [x0]Base Destroyed(Harkonnen),  [x1]Units Exists(Harkonnen Harvester),
                                                                                                                                                                   [2]Timer(%500),  [3]Flag()
#2 Set Flag              >>                  >>                                    >>               3 = False                           >>    [x0]Base Destroyed(Harkonnen),  [x1]Unit Exists(Harkonnen Harvester),                                                                                                                                                                    [2]Timer(%500),  [3]Flag()
#3 Set Flag              >>                  >>                                    >>               3 = True                            >>    [1]Unit Exists(Harkonnen Harvester),   [3x]Flag()
Conditions in event:
#1 =     [x]  0 - Base Destroyed (Harkonnen)
            [x]  1 - Unit Exists (Harkonnen Harvester)
            [ ]   2 - Timer (%500)
            [ ]   3 - Flag()
#2 =     [x]  0 - Base Destroyed (Harkonnen)
            [x]  1 - Unit Exists (Harkonnen Harvester)
            [ ]   2 - Timer (%500)
            [ ]   3 - Flag()
#3 =     [ ]   1 - Unit Exists(Harkonnen Harvester)
            [x]   3 - Flag()

Event Properties (Event 0)
#1       Event Type       ->    Reinforcement
           Player               ->    Harkonnen
           Position             ->     0    0
           Deploy Action   ->    None
Event properties (Event 1)
2#       Event Type       ->    (19) Set Flag
           Set Flag            ->     3   >> False
Event Properties(Event 2)
#3       Event Type       ->   (19) Set Flag
           Set Flag             ->    3   >> True
                  Condition Type:                  Player:                     Contents
#1    >>     Base Destroyed       >>      Harkonnen     >>     
#2    >>     Unit Exists                >>      Harkonnen     >>      Harvester
#3    >>     Timer                        >>                            >>      %500
#4    >>     Flag                          >>                            >>

My question:
Can someone explain this
event to me.
what does the
flag do.
How can i use
flags in other events and different conditions.

How can i use flags to (as example) create a reinforcement drop from a house that will be launched 2 times with a delay of 120 seconds and 60 seconds between the 2 launches
when a
area is revealed or when a harkonnen starport does exist.

In my Missions i want to add events that will trigger when a Tile or Area is revelead (i dont know how to select a area or tile)
, a
building does exist (until it is destroyed,) , a unit does exist until it does not exist, Casualties from a certain house is made by a certain player or house,
all
buildings from a certain type - owned by a house is destroyed, Spice is harvested, After a [X] couple of times or after a certain amount of time.
I thought it kinds of work like:

After 8 Minutes [Interval>12000>1>1]       >>     A Flag    [Event Type #1>(19)Set Flag>1>True)
                                                                              And
                                                                              [Event Type #2>(19)Set Flag>1>False)         
                                                                    >>      The flag that triggers to [True] when 8 Minutes has past,
And that triggers to [False] before
8 minutes has past.                                        >>      And some events [Reinforcements],[Starport delivery's],[Unit Spanws],[Tile/Area Reveals]  That will be triggered
when the Flag [#1] turns True                       >>      Events that trigger when Flag #1 is False until Flag #1 Turns True.             
                                                                    >>      Example:
               House Harkonnen
starts with $2000,2x Power Plant, Outpost,Barracks,And 1x Engineers ---
               House Ordos
starts with $5000,2x power plant, outpost,Barracks ---
               House Atreides
starts with $5000,a construction Yard, 2x Power plant,Repair Pad,Heavy Factory
               House Harkonnen
locates the Atreides Construction Yard and steals the Atreides Construction Yard.
                House Harkonnen
Receives $2000 spice and a reinforcement arrives with 4 troopers and a trike.
               Bulding Exist>Harkonnen Construction Yard, Some Events Has now be triggerd.
 Every 4 minutes 5 times: Ordos receives a Reinforcement (Interval 1>6000>5) with 3 troopers and 2 readers that will hunt for harkonnen.
               Atreides
builds a MCV and build forces, build a Atreides Refinery and receives every 2 minutes a reinforcement (Interval 3000>3000>5)
When the Atreides Refinery exist (Building Exists>Atraides>(A) Refinery) the Ordos also Receives every 2 minutes a reinforcement, 3 times.
              The Harkonnen
build there base And units and they build a StarPort (Building Exists>Harkonnen>(H)Starport), Then a couple events trigger.
 
How to do this with flags.
How to do this without flags.
 
i noticed that there is no Dune2000 D2K Map And Mission Editor Tutorial around somewhere, I think many beginners can use a tutorial.
I Hope someone can answer my question.

Thanks

  • Upvote 1
Link to comment
Share on other sites

Flag vaules used to stop triggers to activate everytime and make them fire only once. Set flag action is used with same conditions with the triggers. Flag vaule is used as negative on conditions of both normal trigger and Set flag. Set flag is also used as True as they are false as default. Vaule on set flag trigger is ID of Flag condition u want to change.

Edited by Mustafa Alperen Seki
Link to comment
Share on other sites

The best event to explain this on is the text message event. In order to fully understand what it does, you need to think about it the way it works in-game (it's like an if statement in programming, if you know it, that's being placed in the main game function, which is ran every frame, that's how a game basically works). So if (<condition> is true) then <event>.

 

But let's say you want to show a message once the Mercenaries have lost all their structures. If you simply add Condition: BaseDestroyed(Mercenaries) >> Action: ShowMessage("Mercs got rekt"), the game is going to check the condition every frame (as it checks every event). So every frame, the condition will be true as the mercenaries no longer have any buildings, and the text message will be displayed. The result? You'd get 60 messages "mercs got rekt" in a second (if you have 60fps for dune) and they would never stop being displayed (unless mercs deploy an mcv and restart building).

 

To make it so it shows only once, you want to use a flag. So as Condition: BaseDestroyed(Mercenaries), [X]Flag(<your_flag_here>), Event: ShowMessage("Mercs got rekt"). But you now need an additional event that will actually set that flag, otherwise the result will be like before. So event #2: Condition: BaseDestroyed(Mercenaries), [X]Flag(<same_flag_number_as_previous>), Event: SetFlag(<that_flag_number>). Make sure conditions are EXACTLY the same for both events, as you want the message and flag to be set under the same conditions. Once you have this done, the game will check the condition every frame, it will detect that the mercs no longer have buildings and will show the message, but it will also set the flag. The next frame, game checks it again, sees that mercs dont have buildings BUT sees the flag is set, therefore the full condition is no longer met, so it won't display the message again.

 

I hope you understood my explanation, I did it so in-depth because flags are one of the most important things to know when making missions for Dune. :D

  • Upvote 1
Link to comment
Share on other sites

If you want to create a event to run once, you can right click and select the "add run once flag". The editor even include a "create events -> Harverster replacement" so right now I don't even think about that double flag thing, the editor does for you.

21 hours ago, Gothmaster said:

How can i use flags to (as example) create a reinforcement drop from a house that will be launched 2 times with a delay of 120 seconds and 60 seconds between the 2 launches

For this one you can use a simple "intervatl" condition type like show it in this image.

interval.PNG

2 minutes (120 secs) * 1500 = 3000) --- 1 minutes (60 secs) * 1500 = 1500. The Run count is the number of drops. if you write 3 then the event (reinforcement in your question) will be: 1 drop at 2 minutes, another drop 1 minute later and a third drop another minute more.

21 hours ago, Gothmaster said:

when a area is revealed or when a harkonnen starport does exist.

this image will tells you.

revealing map.PNG

Like Feda said: without any flag the game is gonna to reveal that position every-frame, but in this case doesn't affect the game (will you revealing the same area over and over). you can use a flag to make happen only once.

This event reveal the map WHEN the Harkonnen have the starport.

21 hours ago, Gothmaster said:

In my Missions i want to add events that will trigger when a Tile or Area is revelead (i dont know how to select a area or tile)

This way.

tile revealed.PNG

21 hours ago, Gothmaster said:

, a building does exist (until it is destroyed,) , a unit does exist until it does not exist, Casualties from a certain house is made by a certain player or house,

This is simple. exist or doesnt exist.PNG

Building exist (Atreides [...]) = the condition is set to "exist". If the square is marked, then is set to "doesn't exit". Is the same with unit exists.

Just is important to said to choose "Atreides" "Barracks (A)", this refers to Atreides type Barracks.

 

In other things: I guess you are using the "interval" to make drops, I guess is because the original game use it this way. There is a event called "timer". You can use it instead interval if it's only a single drop.

choosing "Interval 12000 - 1 - 1 " is the same as "timer = 12000". Have the same efect. To me (this is personal) is cleaner just see "timer = 12000" than "Interval - 12000 - 1 -1"

I usually only use "flags" when I want an event to trigger once, even when the condition is permament.

For example. "Building exist". "showing a message when X base is destroyed" etc...

For setting reinforcements, starport delivery or showing a message when X minutes has passed, I just don't even use flag, because setting them with "= timers" just happen once anyway.

 

Edited by Cm_blast
  • Upvote 1
Link to comment
Share on other sites

I'm going to show you the look in one of my maps.

 

all of them.png

I know looking into this can look overwhelming, but the point to show this image is to tell you my lack of flags.

the first Flag I used is in the number 18 to 23. That is the "harverster replacement", which the editor can create automatically.

the last 2 flags in 26 to 29 is a text to appears once. One where you defeat the Atreides, and the other when you recieve the VCM.

So, in a map with 29 event, there is only 6 flags, 4 or them just to make both player have a harverster for free if they loose it (and because the editor can create this event for you is really easy), and 2 flags to a once time message when [...] (something happens).

Link to comment
Share on other sites

It's much better if he understands how it works as well. I know the editor does it for him, but it's important that he understands the stuff that happens behind. There are a few things that you need flags for and are not an automatic option to click in the editor. I needed manual flag events in my WOA missions a lot.

  • Upvote 1
Link to comment
Share on other sites

1 hour ago, FedaYkin said:

It's much better if he understands how it works as well. I know the editor does it for him, but it's important that he understands the stuff that happens behind. There are a few things that you need flags for and are not an automatic option to click in the editor. I needed manual flag events in my WOA missions a lot.

I don't fully understand how the flags works. If it wasn't for the automatic "harverster replacement" I would need to check one original dune2000 level and do a full copy/paste (or don't even bother in use it).

My way to learn flags with that old editor was looking and copy the same events from an original map (or looking/copying from one of your old tutorials), plus "If I set this dummy condition marked (if you remember that editor) this works, if not, doesn't... ok, I don't get it, but works so... yay!".

But you are alright, is better if he understands it and can do it by himself.

Edited by Cm_blast
Link to comment
Share on other sites

  • 4 weeks later...

I have a question, because there is one thing that maybe could be done with flags but I just don't know how, maybe feda know more about this.

Imagine this scenario:
In the map there is an enemy building.
After the building is destroyed, 10 Harkonnen combat tanks appears from a carryall.

Here I want a new event to show the message "Harkonnen combat tanks defeated" when all those tanks are killed.
You can't just use the "unit exist" or "unit destroyed" by itself, as those harkonnen combat tanks doesn't appear until that very moment.

My guess is something similar like with the harverster, some kind of double flag, but in my test I didn't make it works.
 

 

Link to comment
Share on other sites

Well theoretically I would set a flag once the tanks exist on the map, and then use another flag for the text message, so indeed a double flag. It should work in theory, but you said in your test it doesnt. Maybe i'll try it tomorrow and see the result.

Link to comment
Share on other sites

On sábado, 23 de abril de 2016 at 1:07 AM, FedaYkin said:

Well theoretically I would set a flag once the tanks exist on the map, and then use another flag for the text message, so indeed a double flag. It should work in theory, but you said in your test it doesnt. Maybe i'll try it tomorrow and see the result.

Don't take my word. Probably I did something wrong like check/unchecked something in somehere so that's why didn't work.

Now I remember the original campaign Harkonnen level 7. Here the Atreides have a High-tech factory which The emperor brings periodical reinforcements.

A simple buildings exist (unchecked) + Flag (false/unchecked); triggers a message after the Atreides rebuild the high-tech: "High Tech Factory rebuilt! Expect further Imperial reinforcements!".
But I don't get it. Because I use those 2 exact events with a random message and don't appear once. I tried having barracks, selling and then rebuilding.
I am doing something wrong but don't know what.

 

Link to comment
Share on other sites

I think I'm starting to understand how it works.

At least I manage to do what I want (the same thing I was asking here). Here is the imagen:
it works.PNG

1. -Harkonnen Reinforcements appearing after the building is destroyed.
2. -The Flag to make them appears once (this can be done in auto).
3. -This Flag goes true after the tank exist (they appear because of the reinforcement).
4. -The message combine the "Flag (tank exist)" and at the same time "Tank-doesn't-exist". So this is the "Schrödinger Tank".
5. -Like the second point, this is the "run-once flag" (Flag number 10). Can be done in auto.

Test the map.
- I destroy the Barracks.
- A carryall drops 2 Harkonnen tanks.
- After the tanks are destroyed the text "Tanks destroyed" appear once.
 

Edited by Cm_blast
Link to comment
Share on other sites

Essentially, a flag is just a yes or no. You use it to allow your conditions to have additional checks. For example in Feda's scenario, you added an extra check to make sure the message does not trigger more then once. 

Sorry if I'm just rehashing something you already understood.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...