Page 1 of 1

Victory condition event

Posted: Sun May 04, 2008 12:40 pm
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

RE: Victory condition event

Posted: Sun May 04, 2008 12:54 pm
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;

RE: Victory condition event

Posted: Sun May 04, 2008 1:24 pm
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.

RE: Victory condition event

Posted: Sun May 04, 2008 7:28 pm
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;

RE: Victory condition event

Posted: Sun May 04, 2008 7:49 pm
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

RE: Victory condition event

Posted: Sun May 04, 2008 8:15 pm
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. :)

RE: Victory condition event

Posted: Sun May 04, 2008 8:34 pm
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

RE: Victory condition event

Posted: Sun May 04, 2008 10:58 pm
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

RE: Victory condition event

Posted: Mon May 05, 2008 2:24 pm
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.


RE: Victory condition event

Posted: Mon May 05, 2008 7:08 pm
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 ?


RE: Victory condition event

Posted: Mon May 05, 2008 8:18 pm
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.