Victory condition event

Post bug reports and ask for tech support here. Post any Community Site Requests here as well.

Moderator: Vic

Post Reply
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

Victory condition event

Post by Grymme »

Hi

This is not a bug. However i was wondering if someone (Vic) could help me with the programming of my victory event. It works al right. Only problem is when Germany have a major victory they also get the message that announces they have a victory, and that they have a minor victory. So there is basicly three messages. Here is the code. What can i do to change it.

sincerely

Tomas



Image
Attachments
Victorycondition.jpg
Victorycondition.jpg (148.31 KiB) Viewed 207 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
User avatar
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Victory condition event

Post by Vic »

tempvar1=0
 
if x<20 then
tempvar1=1
setmessage
end if
&nbsp;
if x<40 then
if tempvar1=0 then
tempvar1=1
setmessage
end if
end if
&nbsp;
if x>40 then
if tempvar1=0 then
tempvar1=1
setmessage
end if
end if
&nbsp;
kind regards,
Vic
&nbsp;
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
seille
Posts: 2048
Joined: Tue Jun 19, 2007 8:25 am
Location: Germany

RE: Victory condition event

Post by seille »

Mhh, the original code has 4 Checks, but 5 EndCheck.
&nbsp;
And i think the first two checks can be true (<20 and <40 could be 18),
so this would give two messages.
The "BlockEvent" you added will probably let the whole event run only one time,
but not stop immediately. But i´m not sure here.
&nbsp;
Vics solution works. Would have done it similar, but with one seperate tempvar for each victory condition.
Vics way is better.
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Victory condition event

Post by Grymme »

So. What kind of tempvar should you use. A "check" event?
&nbsp;
Also these "if" do they mean execevents? i am really sorry, but i am really crappy at programming. Could someone show it in code?`
&nbsp;
&nbsp;
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
seille
Posts: 2048
Joined: Tue Jun 19, 2007 8:25 am
Location: Germany

RE: Victory condition event

Post by seille »

IF X means your CheckDifferenceInDays.
&nbsp;
tempvar1=1 means you have to use the Setvar command.
&nbsp;
The event engine is for beginner not easy to master.
I learned it by studying existing events.
Good luck
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Victory condition event

Post by Grymme »

Thanks. Its not that im stupid really. Ive just never had an interest in programming, but i do have an interest in AT, so the 2 clash.
&nbsp;
Also it doesnt make it easier when you guys use codes that arent in the manual. But im getting better. :)
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Victory condition event

Post by Grymme »

Well, here is my new attempt. It didnt work. For some reason Germany had a major victory imediatly. I almost feel ready to give up unless there is some easy change to be made.

If its to difficult i will copy the event from the gothic line scenario instead, although it doesnt differentiate betwen minor and major victories.



Image
Attachments
VC.jpg
VC.jpg (154.37 KiB) Viewed 207 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
User avatar
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Victory condition event

Post by Vic »

Hi Grymme,
&nbsp;
Yes the scripter is a crime for non-coders.
&nbsp;
But i think you will fix your event by
&nbsp;
A) just replacing the CHECK tempvar1 == tempvar0 by CHECK tempvar1 == 0
&nbsp;
B) enclosing the whole code with a checkgamewinner == 0 (if germany is regime 0)
&nbsp;
kind reg,
vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
User avatar
Vorsteher
Posts: 251
Joined: Sat Apr 01, 2000 10:00 am
Contact:

RE: Victory condition event

Post by Vorsteher »

@Grymme
I don`t work with blockevent.I take than in your case three events.I think this is better for debuging.

V.

Image
User avatar
Jeffrey H.
Posts: 3154
Joined: Fri Apr 13, 2007 6:39 pm
Location: San Diego, Ca.

RE: Victory condition event

Post by Jeffrey H. »

ORIGINAL: Vic

tempvar1=0

if x<20 then
tempvar1=1
setmessage
end if

if x<40 then
if tempvar1=0 then
tempvar1=1
setmessage
end if
end if

if x>40 then
if tempvar1=0 then
tempvar1=1
setmessage
end if
end if

kind regards,
Vic

Dumb question:

Is there an implied '=to' in these if statements ?

What if X=40 ?

History began July 4th, 1776. Anything before that was a mistake.

Ron Swanson
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Victory condition event

Post by Grymme »

In the end i skipped this event, it was to much for me to code. Instead i went with copying the victory event in the "gothic line" scenario. It seems to work fine.
&nbsp;
Thanks for the help anyways though.
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Post Reply

Return to “Advanced Tactics Support”