Page 1 of 1

Usurpers

Posted: Sat Jun 11, 2011 6:08 pm
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

RE: Usurpers

Posted: Sun Jun 12, 2011 5:17 am
by Vic
Hi,

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

best,
Vic

RE: Usurpers

Posted: Tue Jun 14, 2011 4:23 pm
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

RE: Usurpers

Posted: Wed Jun 15, 2011 6:51 am
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