Editing 102 - Events

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

Editing 102 - Events

Post by lancer »

G'day,

Making progress but a few of my events are becoming quite long.

Is there any way of calling one event from another so I can break them down into smaller modules?

Cheers,
Lancer
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day,

O.K, answered my own question.

I can do this with ExecExecuteEvent and pass data via Game or Regime variables.

The editor, despite it's funky interface, appears to have a fair amount of grunt and functionality built in.

Can anyone tell me what 'Early Turn (no unter)' means? I've got the Early turn event bit but the 'no unter' is a mystery. 'Under' in german? 'Sausage' in Dutch?

Cheers,
Lancer
User avatar
Vic
Posts: 9766
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Editing 102 - Events

Post by Vic »

'unter' is a feature that actually did not make it into ATG... dont worry about it...

and checkout this wiki page for the order of event processing:
http://www.vrdesigns.nl/atwiki/doku.php ... oop_screen

ps: there is also the CallFunction which has more functionality then ExecExecut and can be called by name... so calls dont get broken by switching or deleting events.

best regards,
Vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day Vic,

Thanks for the info and the tip.

I'm enjoying ATG. Good job.

Cheers,
Lancer
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day,

A couple of quick questions.

If all the variables (temp / game / regime) are integers how do I deal with percentages?

Eg. I want multiply one variable by a percentage - which I can do if it's a set percentage (eg. always 0.55) but not if it's a variable percentage (eg. I want to store the value in a variable and multiply by, say, tempvar2).

With regards to the standard integer variables what is the upper (and negative lower) limits for the numbers, eg. +/- 64,000 ?

Cheers,
Lancer
User avatar
Vic
Posts: 9766
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Editing 102 - Events

Post by Vic »

integers are maximum 2,147,483,647 + or -

to deal with percentages you have to first multiply by the percentage in question and then divide by 100.

best regards,
Vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day Vic,

O.K, thanks.

Cheers,
Lancer
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day,

Moving along. How do I place data on the top bar of the GUI?

Eg. in the normal games there are a small boxes tracking Political Points, Raw and Oil.

I've noticed in other scenarios that you can add boxes to track custom data (regime vars only?) which is what I'd like to do.

Haven't managed to find any information on how to do this so any help would be appreciated.

Cheers,
Lancer
tweber
Posts: 1411
Joined: Wed Jun 27, 2007 1:32 pm

RE: Editing 102 - Events

Post by tweber »

The resource bar is showing the regime variables.  Go into editor, settings, regime variables on a random game and look at how raw and oil are set.
User avatar
lion_of_judah
Posts: 2323
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Editing 102 - Events

Post by lion_of_judah »

how does one do weather events for say an area like Indochina and Southern Africa.....
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day Tweber,

Got it. Thanks. Looked at that before but didn't put it together. Probably suffering from button overload syndrome.

For anyone following my erratic path through editor-land here's a bit more information.

~ ~ ~

As mentioned above you need to set up a regime variable that holds the data. This is, of course, after you've already entered the editor and pressed the 'Setting' button to arrive at a screen that looks like this...


Image


Once that's done you get to see your vital stats in-game as shown below.


Image


As 'Unrest' isn't a resource that is generated by an in-game structure, I assuming that the yellow indicator will always read zip.


Image


Initialising and updating your regime variable can be done through events. Best done using the editors inbuilt EXEC's. Here's a test event snippet that adds a random amount to 'Unrest' every turn and updates the regime variable.


Image


Cheers,
Lancer
tweber
Posts: 1411
Joined: Wed Jun 27, 2007 1:32 pm

RE: Editing 102 - Events

Post by tweber »

ORIGINAL: lion_of_judah

how does one do weather events for say an area like Indochina and Southern Africa.....

Typical way is to define a new land type for each weather - Land type 1 could be plains, Land type 1 + x could be snow plains, Land type 1 + 2x could be mud plains. Based on the time of year, you change the land types. Does this make sense?
User avatar
lion_of_judah
Posts: 2323
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Editing 102 - Events

Post by lion_of_judah »

ORIGINAL: tweber

ORIGINAL: lion_of_judah

how does one do weather events for say an area like Indochina and Southern Africa.....

Typical way is to define a new land type for each weather - Land type 1 could be plains, Land type 1 + x could be snow plains, Land type 1 + 2x could be mud plains. Based on the time of year, you change the land types. Does this make sense?

Somewhat, thanks
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day,

Back again.

I have run into a small technical problem that has, despite my best efforts, beaten me.

I have written the event below which kicks in at the start of a random game. Nothing complicated, it finds the player's HQ and adds a few trucks.


Image


When I run the event in a bog standard two player random game and the human is the default regime 0 then it works fine. However when I repeat with a similiar game but make the human regime 1 it strangely doesn't work.

I say strangely 'cause I can copy the event (identical copy using the editors inbuilt paste function) and change it so it kicks in on round 1 instead of right at the start. Surprisingly the event now works for both instances of the player (regime 0 or 1).

So why doesn't it work normally when the player selects regime 1 instead of 0?

I have piggybacked the event (line #8) along with all the other standard random game master file stuff as below.


Image


Any help would be appreciated.

Cheers,
Lancer
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Editing 102 - Events

Post by Lunaticus_matrixforum »

Mmh this looks as if it should work (if predef #4 is assigned etc). Maybe you can post the file somewhere?
User avatar
ernieschwitz
Posts: 4604
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Editing 102 - Events

Post by ernieschwitz »

Why did you put a block event at the end. I think that might be the trouble... Especially if this is an event called only once each players turn.

EDIT: I take that back, i don´t think that is the problem.
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Vic
Posts: 9766
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Editing 102 - Events

Post by Vic »

@lancer,

you might want to add a check to make sure tempvar3 > -1 just in case there is any neutral territory on the map.

need the actual file to give any more info on whats wrong

best,
vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day,

Tweaked the event to check for nuetral capitals. None present. Verified this by checking a few randomly generated maps in the editor. Not the problem.

Removed the Block Event at the end. Not the problem.


Image


As mentioned above if I run the event as a 'round 1' event then it works fine, regardless of whether the human player is regime 0 or 1. Here's the test event doing this which is a carbon copy of the original event with only the round check added and a different unit placed on the map (so I can tell if it worked).


Image


Interestingly I put three debug messages in the test event above and when I run it with human = regime 0 the messages all appear yet when I run it as human = regime 1 then none of the messages show, despite the event working as intended (But it still won't work when it is run as part of the random game set-up routine).

Something strange happening with the round processing when the human player isn't the default '0' regime. Haven't changed any of the ATG random game rulevars or done anything else that may effect it to the best of my (limited) knowledge.

Can I strap my file to the nearest pigeon and heave it out the window? Might have to feed it some of those special red pills. Long ways to fly.

Cheers,
Lancer

User avatar
Vic
Posts: 9766
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Editing 102 - Events

Post by Vic »

@lancer,

send your scenario to vic@xs4all.nl

i'll take a look. it might be a bug.

best,
Vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
lancer
Posts: 2963
Joined: Tue Oct 18, 2005 8:56 am

RE: Editing 102 - Events

Post by lancer »

G'day Vic,

O.K, will do.

Thanks.

Cheers,
Lancer
Post Reply

Return to “Mods and Scenarios”