Editing 102 - Events (Full Version)

All Forums >> [New Releases from Matrix Games] >> Advanced Tactics Series >> Mods and Scenarios



Message


lancer -> Editing 102 - Events (4/28/2011 7:09:20 AM)

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 -> RE: Editing 102 - Events (4/28/2011 7:21:22 AM)

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




Vic -> RE: Editing 102 - Events (4/28/2011 9:33:33 AM)

'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?id=game_loop_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




lancer -> RE: Editing 102 - Events (4/28/2011 9:43:45 AM)

G'day Vic,

Thanks for the info and the tip.

I'm enjoying ATG. Good job.

Cheers,
Lancer




lancer -> RE: Editing 102 - Events (4/29/2011 9:18:19 AM)

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




Vic -> RE: Editing 102 - Events (4/29/2011 9:35:53 AM)

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




lancer -> RE: Editing 102 - Events (4/29/2011 10:47:38 AM)

G'day Vic,

O.K, thanks.

Cheers,
Lancer




lancer -> RE: Editing 102 - Events (4/30/2011 3:54:38 AM)

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 -> RE: Editing 102 - Events (5/1/2011 3:50:19 PM)

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.




lion_of_judah -> RE: Editing 102 - Events (5/2/2011 7:47:26 AM)

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




lancer -> RE: Editing 102 - Events (5/2/2011 7:59:13 AM)

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]http://i258.photobucket.com/albums/hh262/plugger_photo/regime_var_3.jpg[/image]


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


[image]http://i258.photobucket.com/albums/hh262/plugger_photo/regime_var_1.jpg[/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]http://i258.photobucket.com/albums/hh262/plugger_photo/regime_var_2.jpg[/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]http://i258.photobucket.com/albums/hh262/plugger_photo/regime_var_4.jpg[/image]


Cheers,
Lancer




tweber -> RE: Editing 102 - Events (5/2/2011 8:44:41 PM)


quote:

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?




lion_of_judah -> RE: Editing 102 - Events (5/2/2011 9:53:06 PM)


quote:

ORIGINAL: tweber


quote:

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 -> RE: Editing 102 - Events (5/3/2011 11:12:11 AM)

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]http://i258.photobucket.com/albums/hh262/plugger_photo/editor_1.jpg[/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]http://i258.photobucket.com/albums/hh262/plugger_photo/editor_2.jpg[/image]


Any help would be appreciated.

Cheers,
Lancer




Tufkal2 -> RE: Editing 102 - Events (5/3/2011 1:42:46 PM)

Mmh this looks as if it should work (if predef #4 is assigned etc). Maybe you can post the file somewhere?




ernieschwitz -> RE: Editing 102 - Events (5/3/2011 3:00:31 PM)

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.




Vic -> RE: Editing 102 - Events (5/3/2011 3:34:21 PM)

@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




lancer -> RE: Editing 102 - Events (5/4/2011 2:43:43 AM)

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]http://i258.photobucket.com/albums/hh262/plugger_photo/editor_4.jpg[/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]http://i258.photobucket.com/albums/hh262/plugger_photo/editor_3.jpg[/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





Vic -> RE: Editing 102 - Events (5/4/2011 9:36:19 AM)

@lancer,

send your scenario to vic@xs4all.nl

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

best,
Vic




lancer -> RE: Editing 102 - Events (5/4/2011 10:47:14 AM)

G'day Vic,

O.K, will do.

Thanks.

Cheers,
Lancer




Jeffrey H. -> RE: Editing 102 - Events (5/4/2011 8:03:43 PM)


quote:

ORIGINAL: lancer

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.



The first random game I started in ATG, I moved the human regime from it's default position to the last regime in sequence and some very strange things happened. The game really didn't "go". I had shroud on and a few other items selected.

Something's fishy, IMO, and it's not related to your event directly.





lancer -> RE: Editing 102 - Events (5/6/2011 10:57:24 AM)

G'day,

For anyone reading this thread I should state for the record that the problem turned out to be operator error and that there is no particular game bug with what I've highlighted above.

Cheers,
Lancer




bwheatley -> RE: Editing 102 - Events (10/1/2011 2:56:17 PM)

what was the problem lancer?




lancer -> RE: Editing 102 - Events (10/2/2011 11:02:47 PM)

G'day,

From memory the problem wasn't with the code but was with me getting all tangled up over how to handle random game masterfiles.

I was using previously saved games for testing when I thought I was using newly generated ones.

Once I was sorted on that it all fell into place.

Cheers,
Lancer




bwheatley -> RE: Editing 102 - Events (10/3/2011 12:59:46 AM)

Cool thanks. I'm back into editing again so any tips and tricks i can remember will help me. I really like the new stringlist stuff. It cut down one of my functions from 100 lines to 11 and a stringlist :)




lancer -> RE: Editing 102 - Events (10/4/2011 12:14:47 AM)

G'day,

Yep, stringlists are your friend.

Don't forget that the first record in a stringlist is record '0', not record '1'.

Also if you start dynamically adding or subtracting records from a stringlist you need to make sure you are accessing the right record.

Something like this... (stringlist ID89)

Exec: ExecAddStringListCells(89,1,0)
SetVar: TempVar5 = CheckStringListRows(89)

then use TempVar5 as your row index, eg.

Exec: ExecSetStringList(89,TempVar5,...,...)

Cheers,
Lancer




bwheatley -> RE: Editing 102 - Events (10/4/2011 1:43:55 AM)

Yea used to 0 being the primary id from programming shiz.
Thought i had just run into a loop issue but it was because i had a loop in a loop and goofed up the logic lol. Oops




bwheatley -> RE: Editing 102 - Events (10/4/2011 2:15:08 AM)

Wonder if there is a size limit for the strings i was trying to make a string 241 by 85 and it crashes out on me :'(




bwheatley -> RE: Editing 102 - Events (10/4/2011 2:25:16 AM)

Looks like there is a limit that is not documented on creating a string.

[image]local://upfiles/14863/71796957641C47A3B78DC9947D2E56C6.jpg[/image]




bwheatley -> RE: Editing 102 - Events (10/4/2011 5:30:05 AM)

Also i noticed if you click on the last column of a stringlist it does that error too.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.890625