Usurpers

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

Moderator: Vic

Post Reply
User avatar
Zaratoughda
Posts: 714
Joined: Sat Nov 15, 2008 4:00 pm
Location: NE Pa, USA

Usurpers

Post by Zaratoughda »

Vic...

I tried to put in an Usurpers mod.... where the AI start out with countries but human players just start with their home capital... BUT... when I tried the EXEC that resets ownership and used -1, hoping to set it to 'unoccupied'... I just got error messages. I also tried creating a new regime for this purpose but, couldn't seem to find anyway to do that. This all using generic.at2.

Under the classic random game option, I was able to set these hexes (those controlled by a human player not their home capital or adjacent to it) to the 'people's republic' and that kinda worked but if you go to the classic random game you lose a lot of the new stuff even if using generic.at2 as the master file.

So, any ideas?

Zaratoughda
User avatar
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Usurpers

Post by Vic »

Hi,

please give full event code (there is an export to txt file button)
and also exact error lines.

best,
Vic
Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
User avatar
Zaratoughda
Posts: 714
Joined: Sat Nov 15, 2008 4:00 pm
Location: NE Pa, USA

RE: Usurpers

Post by Zaratoughda »

I erased what I had because it wasn't working. But, what I tried that didn't work was...

ExecSetHexOwner(x, y, NewOwner)

and the regimes start at 0 so setting NewOwner to 0 would not work so I tried setting it to -1 and when I created a random game with this ptmaster, when it started up it gave me an error message that just said 'error in event x at line y' or something along those lines, and the exec above was what was at that line in that event.

I was just trying -1 in the hope of setting the hex to 'unoccupied' but I got the error message. I believe I also tried 99 and got the same result. I ended up using the classic random game generator and the people's republic option and then in the event code changed the hexes to be people's republic and changed the name of people's republic to 'civil disorder' and, this worked but if you use the classic random game generator you lose the new deal in the new random game generator, that gives each regime a specific people and only a finite number of cities out there that are that same people and, that is a nice enhancement. Don't get this with the classic game generator.

Zaratoughda
User avatar
Vic
Posts: 9931
Joined: Mon May 17, 2004 2:17 pm
Contact:

RE: Usurpers

Post by Vic »

Hi Zara,
0)    LOOPER: TempVar0 FROM 0 TO CheckTotalUnits
1)      CHECK: CheckUnitOwner(TempVar0) == 0
2)        EXECUTE: ExecRemoveunit(TempVar0)
3)        SETVAR: TempVar0 - 1
4)      END CHECK
5)    END LOOPER
6)    LOOPER: TempVar0 FROM 0 TO CheckMapWidth
7)      LOOPER: TempVar1 FROM 0 TO CheckMapHeight
8)        CHECK: CheckHexOwner(TempVar0, TempVar1) == 0
9)          EXECUTE: ExecSetHexOwner(TempVar0, TempVar1, -1)
10)       END CHECK
11)     END LOOPER
12)   END LOOPER
13)   EXECUTE: BlockEvent

this works fine.
i added this event at the end of the others put it to round execute.

hope this gets you on your way.

best,
Vic

Visit www.vrdesigns.net for the latest news, polls, screenshots and blogs on Shadow Empire, Decisive Campaigns and Advanced Tactics
Post Reply

Return to “Mods and Scenarios”