WAW Weather Function

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

Post Reply
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

WAW Weather Function

Post by bwheatley »

I made this function that will handle readiness hit against the regimes in WAW but now regimes can have winter prep 1-3 so it will take a cut out of the readiness reduction you experience. I just wanted to share the code to see if i did this the "hard" way. Or maybe help someone out if they had a similar idea.

0) ' Loop through our regimes
1) LOOPER: TempVar10 FROM 0 TO 4
2) ' Reset all hexes in slot 7 back to 0 so we don't accidently make units suffer readinessloss 2x
3) LOOPER: TempVar500 FROM 0 TO CheckMapWidth
4) LOOPER: TempVar501 FROM 0 TO CheckMapHeight
5) EXECUTE: ExecSetSlot(TempVar500, TempVar501, 7, 0)
6) END LOOPER
7) END LOOPER
8) ' Reset Vars
9) SETVAR: Gameslot_Winter Prep Level Var(#60) = 0
10) SETVAR: Gameslot_Winter Prep Penalty Reduction(#61) = 0
11) SETVAR: TempVar200 = 0
12) ' What level winter prep does a regime have?
13) ' Loop through 3 researches 48-50 for winter prep
14) LOOPER: TempVar11 FROM 48 TO 50
15) ' This temp var will let us know if they have winter prep 1 2 or 3
16) CHECK: CheckResearch(TempVar10, TempVar11) == 1
17) SETVAR: TempVar200 + 1
18) END CHECK
19) END LOOPER
20) ' multiple X .25 to get readiness for winter prep
21) SETVAR: Gameslot_Winter Prep Level Var(#60) = TempVar200
22) SETVAR: Gameslot_Winter Prep Penalty Reduction(#61) = TempVar200
23) SETVAR: Gameslot_Winter Prep Penalty Reduction(#61) * 25
24) ' What will the readinessloss be
25) SETVAR: TempVar300 = CheckRandomPercent
26) SETVAR: TempVar300 / 4
27) SETVAR: TempVar300 + 53
28) ' setup 301 to hold our value so we can modify it
29) SETVAR: TempVar301 = TempVar300
30) SETVAR: TempVar302 = TempVar300
31) ' 75% reduction because of level 3 winter prep
32) CHECK: TempVar200 == 3
33) SETVAR: TempVar301 / 4
34) SETVAR: TempVar301 * 2
35) END CHECK
36) ' 50% reduction because of level 2 winter prep
37) CHECK: TempVar200 == 2
38) SETVAR: TempVar301 / 2
39) END CHECK
40) ' 25% reduction because of level 1 winter prep
41) CHECK: TempVar200 == 1
42) SETVAR: TempVar301 / 4
43) END CHECK
44) CHECK: TempVar200 == 0
45) SETVAR: TempVar301 = 0
46) END CHECK
47) ' Remove from readiness reduction
48) SETVAR: TempVar302 - TempVar301
49) ' This is the primary weather event
50) LOOPER: TempVar0 FROM 0 TO CheckMapWidth
51) LOOPER: TempVar1 FROM 0 TO CheckMapHeight
52) ' Looking for slot 6 area 1
53) CHECK: CheckSlot(TempVar0, TempVar1, 6) == 1
54) ' Check to see if the owner of the hex is the same regime we're looping on right now
55) CHECK: CheckHexOwner(TempVar0, TempVar1) == TempVar10
56) ' lets set each hex in slot 6 as slot 7 area 20 for mods
57) EXECUTE: ExecSetSlot(TempVar0, TempVar1, 7, 20)
58) END CHECK
59) END CHECK
60) END LOOPER
61) END LOOPER
62) ' Now country winter prep comes into play
63) EXECUTE: ExecReadinessLossByArea(7, 20, TempVar302, 100)
64) EXECUTE: ExecMessage(TempVar10, -1, 0, 13)
65) END LOOPER
-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
User avatar
Jeffrey H.
Posts: 3154
Joined: Fri Apr 13, 2007 6:39 pm
Location: San Diego, Ca.

RE: WAW Weather Function

Post by Jeffrey H. »

...if only we had some indenting, I might have a chance at following this......then again it might be over my head even with indenting.
History began July 4th, 1776. Anything before that was a mistake.

Ron Swanson
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

RE: WAW Weather Function

Post by bwheatley »

yea indenting + easier to script vars in line. If i could script things in line i could have done so much just in a god damned for loop :)
but my zeal for making stuff sweet and my hope that vic makes next engine even better will help sustain me.

currently im working on a new waw weather system broken up into a bunch of different groups

*WEATHER SYSEM*
Slot 9

Area 1 - England
Area 2 - Northern Parts of Europe
Area 3 - Norway and finland
Area 4 - Spain, most of italy, most of the balkins
Area 5 - Northern Soviet Union
Area 6 - Southern Soviet Union
Area 7 - China and Manchuria
Area 8 - Japan
Area 9 - Indian, Burma, Java
Area 10 - Pakistan Area
Area 11 - Africa & Middle East
Area 12 - SRA
Area 13 - Australia and south pacific islands
Area 14 - Rest of south pacific islands
Area 15 - North North America
Area 16 - South North America
Area 17 - South America
-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
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

RE: WAW Weather Function

Post by bwheatley »

its a royal pita atm because of lack of scripting but its just a matter of time now since i have the proof of concept working in britian.
-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
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

RE: WAW Weather Function

Post by bwheatley »

I actually got it working but it never made it into a final version of waw. It was pretty sexy.
-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
User avatar
Jeffrey H.
Posts: 3154
Joined: Fri Apr 13, 2007 6:39 pm
Location: San Diego, Ca.

RE: WAW Weather Function

Post by Jeffrey H. »

*bump*

What keeps you from adding it into the current WAW version ?
History began July 4th, 1776. Anything before that was a mistake.

Ron Swanson
Post Reply

Return to “Mods and Scenarios”