event codes in ATGold
Moderator: Vic
event codes in ATGold
Hi all,
I am having ridiculous trouble coding events. Evidently this is a skill that I have no talent in. I am trying to create messages that appear at the beginning of certain turns, and have had not luck. Even trying something simple like this, taken from the tutorial:
exec message 2 (0,1,-1,-1) (Hi there)
Nothing seems to work.
Any suggestions? or examples I can look at (tried the tutorial Event Code & didn't have much luck).
thanks,
Mike
I am having ridiculous trouble coding events. Evidently this is a skill that I have no talent in. I am trying to create messages that appear at the beginning of certain turns, and have had not luck. Even trying something simple like this, taken from the tutorial:
exec message 2 (0,1,-1,-1) (Hi there)
Nothing seems to work.
Any suggestions? or examples I can look at (tried the tutorial Event Code & didn't have much luck).
thanks,
Mike
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
Did you remember to set it as a early turn event, or is it still as the default is, a no check?
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
Initially it was set up as a "no check". Nothing happened. Then I tried every other type of check (early turn, late turn) , and it would crash after the intro screen for the German player. I may have missed trying it as an early turn event - will try again tonight. Thanks for the response.
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
I can´t explain the crashes when not setting at no check, but when it is set at no check, then basically it just doesn´t get run. So that might explain why nothing happens.
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
Tried again, and "no check" did not effect the game in any way.
The program crashed (got a windows error message) when I set it up as early turn, late turn, and every other variable in this field.
At this stage, I'm waving the white flag, & moving on to other apects of the game editor.
Thanks again for your response.
The program crashed (got a windows error message) when I set it up as early turn, late turn, and every other variable in this field.
At this stage, I'm waving the white flag, & moving on to other apects of the game editor.
Thanks again for your response.
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
I would report this to Vic. Windows error messages are his programs fault, not yours.
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
Good to know.
I'll pull some screen shots & post them.
Anything in particular I should do to make sure Vic sees my message?
thanks.
I'll pull some screen shots & post them.
Anything in particular I should do to make sure Vic sees my message?
thanks.
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
I´d put it in the advanced tactics support category. He will know what to do with the information you post. Just make sure to post the circumstances of what you have done as precisely as possible... 
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
mgaffn1 i would say always keep old versions of things you are modding. I've had instances where you can reorder sftypes or any small thing and it causes a crash because you're not really supposed to move stuff around. So just good future advice save a new version everytime you change something. Then you have something to fall back on worst case. 
-Alpha Tester Carrier Force
-Beta Tester ATG
- Mod Maintainer (past) for ATG's WAW mod
- Mod Maintainer (past) for ATG's GPW mod
-Beta Tester WITE
-Alpha Tester WITW
-Alpha Tester WITE2
-Alpha Tester Wif
-Beta Tester Command
-Beta Tester ATG
- Mod Maintainer (past) for ATG's WAW mod
- Mod Maintainer (past) for ATG's GPW mod
-Beta Tester WITE
-Alpha Tester WITW
-Alpha Tester WITE2
-Alpha Tester Wif
-Beta Tester Command
RE: event codes in ATGold
Thanks for responses, everyone.
Installed update 11 this weekend, and had somewhat better luck with event codes.
After coding this, it worked! The message and the custom graphic appeared. But wait.... the message appeared on the first turn for the German player, AND the second turn for the German player. Then on the third turn, the message no longer appeared.
Am I getting something wrong here? Perhaps mistaking the definitions of "turn" vs. "round"?

Installed update 11 this weekend, and had somewhat better luck with event codes.
After coding this, it worked! The message and the custom graphic appeared. But wait.... the message appeared on the first turn for the German player, AND the second turn for the German player. Then on the third turn, the message no longer appeared.
Am I getting something wrong here? Perhaps mistaking the definitions of "turn" vs. "round"?

- Attachments
-
- message1script.jpg (76.75 KiB) Viewed 354 times
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
You play a turn, each round. The round ends, when everyone has taken their turn.
The event you have coded will run once every turn, in the first round. I´m guessing you had a two player test game
The event you have coded will run once every turn, in the first round. I´m guessing you had a two player test game
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
Sorry if i posted a bit hastily, and a little too curt.
Here is what i meant to say.
Every round consists of turns. I had trouble with this myself and still do sometimes. The code you are using initiates every turn. That is because it is an early turn check.
Your message is only posted to player 1. Because of the setting ExecMessage(0...) In game terms player 1 is always regime 0.
Your message is repeated on round two turn one, because it is executed on round 2, turn 1 as well as round 1 turn 1. So you see it the first time, and then when it is the opponents turn, it is executed again.
There are several ways to make sure it is only posted once.
For instance, make it a round check, and it will only initiate in round 1.
Or make extra lines, Check: CheckTurn == 0 ... End Check, along with the round check of course.
Or using the Block Event code after it has executed once.
to name a few...
I hope this was more enlightening than my first post.
Here is what i meant to say.
Every round consists of turns. I had trouble with this myself and still do sometimes. The code you are using initiates every turn. That is because it is an early turn check.
Your message is only posted to player 1. Because of the setting ExecMessage(0...) In game terms player 1 is always regime 0.
Your message is repeated on round two turn one, because it is executed on round 2, turn 1 as well as round 1 turn 1. So you see it the first time, and then when it is the opponents turn, it is executed again.
There are several ways to make sure it is only posted once.
For instance, make it a round check, and it will only initiate in round 1.
Or make extra lines, Check: CheckTurn == 0 ... End Check, along with the round check of course.
Or using the Block Event code after it has executed once.
to name a few...
I hope this was more enlightening than my first post.
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
Just double checked it, and in fact I was getting the same message 2 rounds in a row for the German player. So now message 1 appears to German player on turn 1 and turn 2. On turn 3, no more message.
Then I created a second message, CheckRound = 2, to be viewed by the German player. What happened? The 2nd message played on turn 2 and 3. On turn 4, no more message 2.
very odd....
I'm going to re-read the Event Code tutorial, and dabble some more this weekend.
Getting closer....
Then I created a second message, CheckRound = 2, to be viewed by the German player. What happened? The 2nd message played on turn 2 and 3. On turn 4, no more message 2.
very odd....
I'm going to re-read the Event Code tutorial, and dabble some more this weekend.
Getting closer....
Mike
RE: event codes in ATGold
In the meantime, here is an example of a custom unit I've created in the graphic style of the original ATG:


- Attachments
-
- sturmartillerie.jpg (214.15 KiB) Viewed 354 times
Mike
RE: event codes in ATGold
Fantastic - I'll give your suggestion a try! Disregard post from a few minutes ago ... hadn't read your second response yet! cheers,
FYI: didn't perceive your response as curt - just pressumed that like the rest of us, your schedule is pretty busy. Thanks for your suggestions.
FYI: didn't perceive your response as curt - just pressumed that like the rest of us, your schedule is pretty busy. Thanks for your suggestions.
Mike
- ernieschwitz
- Posts: 4619
- Joined: Tue Sep 15, 2009 3:46 pm
- Location: Denmark
RE: event codes in ATGold
No problem, and i must say thats a very nice graphic you made for the SIG-33! 
Creator of High Quality Scenarios for:
- Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
RE: event codes in ATGold
Ya looks nice!
-Alpha Tester Carrier Force
-Beta Tester ATG
- Mod Maintainer (past) for ATG's WAW mod
- Mod Maintainer (past) for ATG's GPW mod
-Beta Tester WITE
-Alpha Tester WITW
-Alpha Tester WITE2
-Alpha Tester Wif
-Beta Tester Command
-Beta Tester ATG
- Mod Maintainer (past) for ATG's WAW mod
- Mod Maintainer (past) for ATG's GPW mod
-Beta Tester WITE
-Alpha Tester WITW
-Alpha Tester WITE2
-Alpha Tester Wif
-Beta Tester Command