Lesson Six -- Military Sites and (gasp) Triggers

Discussion and help with creating scenarios and campaigns in the Editor
Matt Zimmitti
Posts: 214
Joined: Tue May 04, 2004 4:00 pm
Location: Brighton, MA

Lesson Six -- Military Sites and (gasp) Triggers

Postby Matt Zimmitti » Tue Dec 07, 2004 7:59 pm

We’re almost there folks. We essentially have a working(ish) scenario. It has a lot of loose ends which we’ll shore up soon. First though, we need to add a little bit of military in to spice things up. We’re also going to start playing with triggers and in doing so we’ll make the world level a little more dynamic. Also, I’m assuming you have read pages 9 & 10 of the Editor Manual. Let’s get underway.

1) Basic Military Sites
Military sites are essentially just trade sites with a few small differences. We’re going to make a Bandit Fort and have it get revealed when the player explores south. The military in this scenario will be optional, so this first site will not send raiders. If the player decides they want to attack the raiders, then things will get more interesting once the player has attacked them. Here’s what I did after hitting the “New Activation Site”.
- Site Category: Enemy Site
- Cost Category: Citizens
- Cost Type: deactivation
- Resource: designated spearmen
- Cost: 10
I then added 10 archers and 600 food as deactivation costs. Fill in text and labels the same as you would a trade site. Move it to where you want it on the map, uncheck Visible and Active and you’re done. Just make sure you set “Exploration Up The Nile” to reveal your new site.

The site I’ve just created will require 10 archers, 10 spearmen and 600 food to deactivate. Well, if I was a bandit and someone “deactivated” my fort, I’d be pretty angry. We want there to be some sort of repercussions so upon defeating the fort, we’ll have more sites open up.

2) Raiders (our first trigger!)
I went in and made another military site called “Desert Raiders”. I used the graphic called “D. Enemy Camp” and made sure to check Spawn Raiders. I think I’ve mentioned this before but, just to reiterate, the Spawn Raiders checkbox does not spawn the raiders. It only puts the icon in the world level UI so that the player can determine what site is responsible for the raiders. We need to go in and set up a trigger to make the raiders show up. What we want to do is say that if the Desert Raiders site is open (the condition), send raiders every year (the effect).

a) Hit the Triggers button at the bottom of the screen (it’s just above the World Level button).

b) Create the Condition
- Press Condition then New
- Type of Condition: World Site
- It should now say “World Site Condition Details” in the bottom left of the UI. First select the name of the site you want to have responsible for the raiders (Desert Raiders in this case) from the first drop-down and select the state you want to check for (Is Open).
- Now give the condition a name that makes sense and press the enter key. I named mine “Raider Camp Open”.

c) Create the Effect
- Press Effect then New
- Set Type of Effect to Player
- It should now say Player Effect on the bottom-left
- Select Event from the first drop-down labeled “Action”
- For Player, select Player 1 (I’m 99.9978% sure that whenever you are asked to enter a player you should enter Player 1)
- Select Raiders Libyan under Event. There are other raider events with different cultural tags. These simply dictate the graphic used for the raiders that enter the map.
- Once again, name it appropriately. If you fail to enter a name, the editor will autogenerate a name that tells you very little about what is actually going on. When you only have a couple of triggers/conditions/effects the names don’t matter much. Down the road you will lose your mind if you don’t label these things.

d) Create the Trigger (finally)
- Press Trigger then press New
- Make sure Trigger Is On is checked. If this is left unchecked, then the scenario will start with the trigger inactive. You only do this latter case if you are planning on having a different trigger activate this one.
- Check Conditions True For and enter 960 seconds. There are 20 seconds in a game week and 48 weeks in a game year (20 * 48 = 960 seconds @ 1.00 speed).
- Check Looping. Looping triggers will continue to check after they have been fired. In this case, we want our raiders to show up yearly as long as the site is open. By making this a looping trigger we are saying once you fire, start counting again.
- Below, we enter our condition and our effect from the previous two steps.
- Finally, name the trigger.

What we now have is a trigger that checks to see if our Desert Raiders site is open. If it remains open for 960 seconds, it will send raiders and immediately start counting to 960 again. How many raiders? Every time a raider event fires, 3-6 show up at the edge of the map. If you want more aggressive attacks, fire the raider event off multiple times. We’ll do this with another site later.

3) Site Dependence
Triggers can be used to affect other sites. Our Desert Raiders site isn’t very tough, so what I’m going to do is make it return as long as it is supplied. I made another military site called “Supply Camp”. It’s a tougher site with significantly higher requirements. What I’ll do next is set up a trigger than reopens the raider camp as long as the supply is open.

a) Create a Condition that can be checked to see if the Supply Camp site is open (just like step 2b)

b) Now we will make two effects. One that makes the Desert Raiders site open and one that makes it visible. The Type of Effect in both cases will be World Site. One effect will have Open Site as its Action and the other will have Make Site Visible.

c) Now for the trigger.
- Hit Trigger then New
- Check Trigger is On
- Check Conditions True For and enter 480 (half a year)
- Check Looping
- Below, enter the condition that checks if the supply is open.
- Enter the first effect we create (open site)
- Next to that first effect there is a drop-down that presently says “End”. Select “And” from that drop down. A second effect drop-down should now appear. Select our second effect (make visible).
- If you like, you can add more effects to the statement in the same manner. I chose to add a raider attack event as well (the same event we cooked up in 2c) so that when the Desert Raiders site reopens it sends a group of raiders to say hi. I intentionally do no have it check to see if Desert Raiders is already open.

Note: I later went back and checked “No Open Message” for the Desert Raiders site. What this does is prevent the generic site open message from popping up each time the site gets reopened.


4) The Swap Out (a.k.a. “Bait and Switch”, “The Shell Game”, Compound Sites)
One technique used regularly in the campaign involves having two versions of the same site. A military site is always a military site. Well, what if you want the player to actually “take over” the site? What we did to solve this is to swap out the military site with a government owned site using triggers. Here’s how this works.

a) I created a trade site called “Conquered Supply”. It imports armor, kopeshes and food. It exports some gold. It will eventually reveal the city of Balat, but we’ll cross that bridge when we get to it. I placed it at the same X/Y location as the original supply site. I also unchecked Active and Visible for the site. It’s just going to sit there for a while.

b) I then made a condition that checks if the original Supply Camp site “Is Dead”. This is done in the same manner as making a condition to see if a site “Is Open”. Is Dead conditions check to see if the player has defeated a site with military. Therefore, this condition only applies to military sites.

c) Next I created an effect to make Conquered Supply visible (I called the condition “Vis Conquered Supply”). We’re talking about the new site from 4a here. It’s been there the whole time, just sleeping.

d) We need to get rid of the old Supply site so we’ll use the World Site effect called “Make Site Invisible”. It’s in the same drop-down we used in 4c.

e) Now for the trigger.
-The only think we’ll check off under the name of the trigger is Trigger Is On. We want the swap to be instantaneous so no need to check Conditions True For. This swap will also only happen once so there is no need to loop it.
-Select your condition from 4b
-Select your effects from 4c AND 4d

This trigger will now hide the original supply site and replace it on the map with a new government owned one in its place when you defeat it. The player will never see the swap and never know the better. This technique was used all over the place in the Grand Campaign. A good example of this is the world level basalt quarries. The quarry operation is actually two separate sites. When you upgrade it, it swaps in an entirely new site with different requirements and text. Pretty sneaky stuff.


Are you still with me? Good. There’s one more thing I’d like to cover in this lesson. For certain triggered events, you may wish to pop up a message box. I’ve done so in Akhetaten in a couple of spots. Here’s how they work.

5) Messages
- In Triggers, select Effect
- Type of Effect: Media
- Action: Send Dialogue
- Message Title: this is what appears at the top of the message box
- Message: the text in the box
- Sound (path and extension): I’ve never actually used this. Presumably you can add your own sound files and have them fire with the message.
- Display: Significant. This setting makes the big message box pop up in the middle of the gameplay area. Setting Display to Standard will have the message appear at the bottom of the screen.
- Category: Local Event. I’ve only ever used this setting.

Once you create a message effect you can AND it with other effects in a trigger. Whenever the trigger fires it will send the message.

-------------------------------------

I went in and added more triggers than just the ones listed above. I suggest going into the editor and taking a look at the triggers/conditions/effects that are now in Akhetaten. There is now a relationship between Cyprus, Lebanon and Traders of the Sinai. The Balat site sends multiple raider groups with a message.

There are certainly more types of triggers than what this lesson covers. This should get you started. Once you get familiar with the UI and trigger syntax things get a lot easier. I realize this lesson is a lot to digest so if anything is unclear let me know and I’ll go in to a little more detail on this thread.

Next lesson we’ll clean this scenario up significantly. Things like starting year, starting resources, patron god and a ton of text will be added. Bye for now.
You do not have the required permissions to view the files attached to this post.

sitearm
Posts: 1432
Joined: Sun Aug 15, 2004 4:00 pm
Contact:

Postby sitearm » Tue Dec 07, 2004 8:56 pm

Aha! So this explains why some messages pop up and others don't!
* taps nose knowingly *

Matt Zimmitti wrote:... Messages... Display: Significant. This setting makes the big message box pop up in the middle of the gameplay area. Setting Display to Standard will have the message appear at the bottom of the screen...

dreamsoftwilight
Posts: 686
Joined: Tue Aug 24, 2004 7:23 pm
Location: Michigan

Postby dreamsoftwilight » Sat Dec 18, 2004 9:00 pm

*listens to William Shatner screaming KAAAHN again*

Raccoon_TOF
Posts: 576
Joined: Tue Nov 30, 2004 12:07 am
Location: Tyngsboro, MA

Postby Raccoon_TOF » Thu Dec 23, 2004 8:47 pm

Figured I should repost this response here for anyone else that might be having problems with military sites and the army getting stuck:

Matt Zimmitti wrote:Hiyo,

I took a quick look at the triggers you have going and I’m pretty sure I know what is going on. If you have a military site reopen via trigger, you need to do a check to make sure that it is not already open. Here’s why…

When you send soldiers off to a site, the site’s state changes so that the game knows that you have mustered and sent soldiers to the site. This prevents you from sending soldiers to multiple sites etc. If a trigger activates that site while it is in the “troops on the way” state, then that state gets wiped. This leads to problems if you in fact had troops headed there at the time the site was reactivated.

All you should need to do is check that the sites you will reopen are indeed closed and you should be ok. Let me know if this fixes things and you have my apologies for not noting it in my lesson on military sites.


Hopefully that will keep other people from making the same mistake I did when trying to reduce the number of triggers used, lol...

Raccoon_TOF
Posts: 576
Joined: Tue Nov 30, 2004 12:07 am
Location: Tyngsboro, MA

Postby Raccoon_TOF » Thu Dec 23, 2004 8:57 pm

On another note, when using a mixture of AND and OR in triggers, what order do they get evaluated in? For example, if my trigger has

If {condition a} AND {condition b} OR {condition c} AND {condition d}
Then {effect x} AND {effect y}

Which of the conditions below does the trigger fire under:

1: (a and b are both true) OR (c and d are both true)
2: (a is true) AND (b or c is true) AND (d is true)
3: ((a and b are both true) OR (c is true)) AND (d is true)
4: (a and b and d are all true) OR (c is true)
5: Some other combination...
Last edited by Raccoon_TOF on Thu Dec 23, 2004 9:02 pm, edited 1 time in total.
Reason: clarification with parentheses

Matt Zimmitti
Posts: 214
Joined: Tue May 04, 2004 4:00 pm
Location: Brighton, MA

Postby Matt Zimmitti » Mon Dec 27, 2004 1:28 pm

4: (a and b and d are all true) OR (c is true)

I believe that the triggers function just as the goals do in regards to AND/OR. AND statements are necessary (relative to the other AND statements). OR statements are sufficient (on their own w/o regard for any other statements). They do not evaluate to complex statements based on order etc. I am 90% sure of this. However, we kept our condition statements pretty simple so I could be wrong.

(how's that for taking a decisive answer, qualifying the daylights out of it and rendering it to hearsay?) :eek:

Honestly, I'm reasonably sure it works that way. :)

Raccoon_TOF
Posts: 576
Joined: Tue Nov 30, 2004 12:07 am
Location: Tyngsboro, MA

Postby Raccoon_TOF » Mon Dec 27, 2004 8:59 pm

*chuckles* Ok, I was afraid that was how it worked, that a single OR could override all of the AND requirements in a single trigger. Looks like I'm going to have to be having some real messy sets of nested triggers, and triggers checking other triggers, to get some of the effects I want...

Honour_Shogun
Posts: 24
Joined: Wed Dec 22, 2004 2:01 pm

Postby Honour_Shogun » Wed Jan 05, 2005 11:36 pm

Is there a way through triggers to set it up so that if you build a fortress, it reduces the amount of troops needed to take an enemy capital? For example, you open Fort A, and because of that you don't need 400 spearmen, but only 200 instead. I am completely lost trying to figure out how to do this.

Thanks in advance from a struggling scenario builder.

Raccoon_TOF
Posts: 576
Joined: Tue Nov 30, 2004 12:07 am
Location: Tyngsboro, MA

Postby Raccoon_TOF » Thu Jan 06, 2005 4:23 am

Yes, you can do it, but not "directly". What you have to do is make two sites for the enemy site, one (we'll call it EnemyA) that has the normal requirements, and a new one (we'll call it EnemyB) that has the lowered requirements. Place both of them in the exact same spot on the world level (manually enter the coordinates into EnemyB so that they match EnemyA's coordinates). Then you have to create a set of triggers that when the Fort is activated, you Inactivate (not Deactivate, as that will count as them being defeated...) EnemyA, Hide EnemyA, Activate EnemyB, and Visible EnemyB. Then, to get EnemyB to send raiders, you need to duplicate the raider triggers that you had for EnemyA, but set them based on EnemyB being active instead of EnemyA.

This really isn't reducing the costs to deactivate the enemy site, it's really just replacing one site with the other. But if they are in the same location, with the same names, text, etc. then as far as the PLAYER can tell, the cost has been reduced by activating the Fort, as was the desired goal. Just remember to keep any triggers that depend on the status of EnemyA clear in the fact that it IS still a separate site from EnemyB as far as the GAME is concerned...

kITIARA
Posts: 1
Joined: Mon Apr 02, 2007 3:32 pm

Postby kITIARA » Mon Apr 02, 2007 4:54 pm

1) Is there a way to establish in with place raiders will come into my city.
2) Is there a way to disable default message that pop up when raider event is starting ("Raiders are approaching, intent on stealing what they can ...").

Azeem
Posts: 3678
Joined: Wed May 05, 2004 9:30 pm
Location: Hetepsenusret

Postby Azeem » Mon Apr 02, 2007 10:49 pm

1) Not that I know of. It appears to be random.
2) No. But you can create a customized message when the raider trigger occurs.

Karter
Posts: 469
Joined: Wed Dec 29, 2004 4:07 am
Location: Portland, Oregon
Contact:

Postby Karter » Tue Apr 03, 2007 2:50 pm

kITIARA wrote:2) Is there a way to disable default message that pop up when raider event is starting ("Raiders are approaching, intent on stealing what they can ...").


NOTE: when creating the site on the World Map

also, in addition to Azeems comment, the check box for raiders on the world map portion (when creating the site)
the only thing the check mark does, is either displays/or not display the city name/site location in the popup raider message

setokaiba
Posts: 27
Joined: Fri Jan 23, 2009 12:37 pm

Kudo's to you and Tilted Mill

Postby setokaiba » Mon Jan 26, 2009 2:32 pm

I managed to figure out lesson 1 - 4 out buy myself. ^_^ It took a while estpecially with clay.

I'm not a big "sprite" fan. when i play i build up some farms and brick makers and then I run around the map deleating all usless stuff that just confuses me. :p Hate them... make some nice bricks in the process.

So when building i only use resources. I'm also not a big fan of landscapes. Don't pay much attention to it. I also never use a lot of space and find that most scenarios are way to big. I usually build everything on top of each other. I never build military or labours apart as suggested. I always manage to have perfect happiness with them in my citiy, maybe keep them on the outskirst of with a Ra, Set and city patron shrine and their own hospital(....they love to go to the hospital :D ) and their own baker (boy can the moan about bread). Who said a noble couldn't live next door to a solider. ^_^ I guess I do that becuase my first 3 plays I ended up with 20 - 40 vagrants all being labourers and soldiers. I'm just no good at it. Lessons 1 - 4 were no good to me. ^_^ Flat land, no sprites and small maps....that's my thing. You'll be surprised how easy it is to fit 10 nobles, 16 labourers and 120 troopers into one little space and keep them all happy with divinity prestige. :D

Lesson 5 - 7 however are fantastic. I got lesson 5 like 80% down on my own through opening up other scenarios and taking a peek. Big time playing around, nearly messed up a good senario Abu i think it was.... ^_^ But there were still a few tips here and there that i didn't know and well worth knowing. ^_^ thanks.

Then i started triggers and lost my head. The concept was easy enough to understand but getting the concept to work.... was a whole new ball game. Lesson 6 is fantasic, really tied up loose ends for me. Thanks a mill. I'm still playing around so if anything crops up I'll be happy to fill it in somewhere. Going through lesson 7 to see if can refine my creations a little more. ^_^

This is definatly the best simulation game I've played, it rocks. I'm making a campaign.....but i'm not very accurate on history so I've just gone silly and called things randomly - Pharo Oli XD (Oliveville), Friends (allies), Barbarrians (randomness at the top of egypt) and Enemies (lots of battles at the bottom XD), together with lots and lots of nonsense in between I'm fond of Marty's Monkey's....., and haphazardly stumbling upon barbarians outcaset camp. :p

Tinkerbell
Posts: 5415
Joined: Fri Sep 07, 2007 3:42 am
Location: San Diego, California
Contact:

Postby Tinkerbell » Mon Jan 26, 2009 3:00 pm

Howdy, setokaiba!

I & I'm sure that it is also a "We" cannot wait to see you in the User-Created Scenario section.

Good Luck on your journey with the excellent but sometimes tricky COTN Editor & please be sure to share your scenarios with us! They don't have to be great (just look at mine :D ) & they don't have to be perfect.

Thank You so much! :)

setokaiba
Posts: 27
Joined: Fri Jan 23, 2009 12:37 pm

Postby setokaiba » Tue Jan 27, 2009 12:39 pm

"Tinkerbell" wrote:Howdy, setokaiba!

I & I'm sure that it is also a "We" cannot wait to see you in the User-Created Scenario section.

Good Luck on your journey with the excellent but sometimes tricky COTN Editor & please be sure to share your scenarios with us! They don't have to be great (just look at mine :D ) & they don't have to be perfect.

Thank You so much! :)



Thanks, I'll go take a look ^_^. Once I'm done (I don't know when, just started studying again, got 7 novels for litriture to read ^_^) I'll be more than happy to upload for everyone to have a good laugh at. ^_^ I really made it very silly.

Malandra
Posts: 38
Joined: Tue Dec 30, 2008 7:29 pm

Postby Malandra » Tue Jan 27, 2009 8:59 pm

"setokaiba" wrote:I'm not a big "sprite" fan. when i play i build up some farms and brick makers and then I run around the map deleating all usless stuff that just confuses me.


I found myself nodding as I read this... the first thing I do when I start a new game (as a player, I haven't tried any editing) is pause and delete absolutely everything that isn't a resource.

I feel kinda bad for the scenario designers when I do it, though... all that hard work making things look pretty and I just blow it all away! :(
________
ANGELINA JOLIE NUDE
Last edited by Malandra on Thu Mar 24, 2011 10:45 am, edited 1 time in total.

tomnobles
Posts: 1182
Joined: Sat Aug 25, 2007 12:01 am
Location: Albuquerque, New Mexico
Contact:

Postby tomnobles » Tue Jan 27, 2009 11:11 pm

Don't feel bad. I did it myself with an older machine. I try to think of those when I build the map now, but sometimes I just get carried away. So, go ahead and delete everything, and don't worry you can't delete resources, just certain decorative sprites.

sakasiru
Posts: 1968
Joined: Thu Jan 17, 2008 12:26 am
Location: Germany

Postby sakasiru » Wed Jan 28, 2009 2:11 pm

That´s the reason why I now make things pretty with ressources ;) :p

Malandra
Posts: 38
Joined: Tue Dec 30, 2008 7:29 pm

Postby Malandra » Wed Jan 28, 2009 4:47 pm

"tomnobles" wrote:Don't feel bad. I did it myself with an older machine. I try to think of those when I build the map now, but sometimes I just get carried away. So, go ahead and delete everything, and don't worry you can't delete resources, just certain decorative sprites.


My machine can handle it, just not my brain. :rolleyes: And yes - I was quite happy when I discovered that the clear trees/buildings tool ignores resources.

Sakasiru - /cheer! That is all. :)
________
Buy Roor Bongs
Last edited by Malandra on Thu Mar 24, 2011 10:45 am, edited 1 time in total.

Punchackale
Posts: 7
Joined: Sun Feb 07, 2010 1:05 am

Postby Punchackale » Mon Feb 08, 2010 10:06 pm

Man i was wondering, if you have like 2 raider camps and both send raiders, is there anything do do to specify wich of the raiders attack when raiders are invaiding tghe city?


Return to “Editing”

Who is online

Users browsing this forum: No registered users and 2 guests