Question about People

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:

Question about People

Post by bwheatley »

Here's what i need to do i need to be able to have a city that has us people when in us control then after it gets captured the people goto the 2nd regmines people. SO heres what i did.

I really wish i could write setting to a gamevar via a gamevar # instead of having to pick from teh gui if so i could have done it all in a loop but now i need to make 1 event per city which sucks but oh well.

First the loop

Code: Select all

 0)    ' Each event nbr corresponds to a city via gamevars
 1)    LOOPER: TempVar0 FROM 26 TO 27
 2)      EXECUTE: ExecExecuteEvent(TempVar0)
 3)      EMPTY
 4)    END LOOPER
 

Code: Select all

 0)    ' AUSTIN event 26
 1)    SETVAR: TempVar0 = Gameslot_Austin X(#56)
 2)    SETVAR: TempVar1 = Gameslot_Austin Y(#86)
 3)    SETVAR: TempVar2 = CheckHexOwner(TempVar0, TempVar1)
 4)    SETVAR: TempVar3 = 0
 5)    CHECK: Gameslot_Austin Owner(#26) == TempVar2
 6)      SETVAR: TempVar3 = 1
 7)    END CHECK
 8)    CHECK: TempVar3 == 0
 9)      SETVAR: Gameslot_Austin Owner(#26) = TempVar2
 10)     CHECK: TempVar2 == 0
 11)       SETVAR: TempVar4 = 1
 12)     END CHECK
 13)     CHECK: TempVar2 > 0
 14)       SETVAR: TempVar4 = 2
 15)     END CHECK
 16)     EXECUTE: ExecChangeLocationType(TempVar0, TempVar1, 5, TempVar4)
 17)     EXECUTE: ExecMessage(TempVar2, -1, 0, -1)
 18)   END CHECK
 
 
 
-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
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Question about People

Post by Vic »

you might want to do this more like:
 
loop x=0 to mapwidth
loop y=0 to mapheight
 
if location
 
   if people = us AND reg = X
 
       then change people.
 
   end if
 
end if
 
next y
next x
 
its way less work that way
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

RE: Question about People

Post by bwheatley »

oh ok i see there is execchangepeople that would work. Now whats the the function to check if its a village town etf. I see checklandscapetype but thats only going to return plains,sea,light forest etc.
-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: Question about People

Post by bwheatley »

0) LOOPER: TempVar0 FROM 0 TO CheckMapWidth
1) LOOPER: TempVar1 FROM 0 TO CheckMapHeight
2) SETVAR: TempVar10 = CheckHexOwner(TempVar0, TempVar1)
3) CHECK: TempVar10 == 0
4) EXECUTE: ExecChangePeople(TempVar0, TempVar1, 1)
5) END CHECK
6) CHECK: TempVar10 == 1
7) EXECUTE: ExecChangePeople(TempVar0, TempVar1, 2)
8) END CHECK
9) END LOOPER
10) END LOOPER
11) EMPTY
12) EMPTY


i was able to do that didnt even have to bother to check if the location was a city.
-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: Question about People

Post by bwheatley »

I just thought it was inefficient to check every single hex like that but i guess it wasn't that bad :)

Vic question for you when you exec another function do any tempvar's get passed along? from what i've been doing it seems like they do. Just curious.
-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
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Question about People

Post by Vic »

Hi,
 
No the temp vars are event specific.
If you want to pass stuff along use gamevars.
 
And next to CheckLandscapeType you might want to use CheckSprite to be more precise and only affect certain urban hexes.
 
kind reg,
vic
 
 
 
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
bwheatley
Posts: 3655
Joined: Mon Dec 13, 2004 4:08 pm
Contact:

RE: Question about People

Post by bwheatley »

Thanks!
-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
Post Reply

Return to “Mods and Scenarios”