Page 1 of 2

Editing 102 - Events

Posted: Thu Apr 28, 2011 4:09 am
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

RE: Editing 102 - Events

Posted: Thu Apr 28, 2011 4:21 am
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

RE: Editing 102 - Events

Posted: Thu Apr 28, 2011 6:33 am
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

RE: Editing 102 - Events

Posted: Thu Apr 28, 2011 6:43 am
by lancer
G'day Vic,

Thanks for the info and the tip.

I'm enjoying ATG. Good job.

Cheers,
Lancer

RE: Editing 102 - Events

Posted: Fri Apr 29, 2011 6:18 am
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

RE: Editing 102 - Events

Posted: Fri Apr 29, 2011 6:35 am
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

RE: Editing 102 - Events

Posted: Fri Apr 29, 2011 7:47 am
by lancer
G'day Vic,

O.K, thanks.

Cheers,
Lancer

RE: Editing 102 - Events

Posted: Sat Apr 30, 2011 12:54 am
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

RE: Editing 102 - Events

Posted: Sun May 01, 2011 12:50 pm
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.

RE: Editing 102 - Events

Posted: Mon May 02, 2011 4:47 am
by lion_of_judah
how does one do weather events for say an area like Indochina and Southern Africa.....

RE: Editing 102 - Events

Posted: Mon May 02, 2011 4:59 am
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

RE: Editing 102 - Events

Posted: Mon May 02, 2011 5:44 pm
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?

RE: Editing 102 - Events

Posted: Mon May 02, 2011 6:53 pm
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

RE: Editing 102 - Events

Posted: Tue May 03, 2011 8:12 am
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

RE: Editing 102 - Events

Posted: Tue May 03, 2011 10:42 am
by Lunaticus_matrixforum
Mmh this looks as if it should work (if predef #4 is assigned etc). Maybe you can post the file somewhere?

RE: Editing 102 - Events

Posted: Tue May 03, 2011 12:00 pm
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.

RE: Editing 102 - Events

Posted: Tue May 03, 2011 12:34 pm
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

RE: Editing 102 - Events

Posted: Tue May 03, 2011 11:43 pm
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


RE: Editing 102 - Events

Posted: Wed May 04, 2011 6:36 am
by Vic
@lancer,

send your scenario to vic@xs4all.nl

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

best,
Vic

RE: Editing 102 - Events

Posted: Wed May 04, 2011 7:47 am
by lancer
G'day Vic,

O.K, will do.

Thanks.

Cheers,
Lancer