Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Hall of Mirrors Map Script

(November 12th, 2014, 17:28)Ruff_Hi Wrote: How do you know about these C++ functions? Are they in every map script?

From looking at the C++ code you can see exactly how it works.

There are quite a few C++ functions, these among them, that the map script can optionally override. The C++ versions check if there's a python version and try that first.

Quote:If I understand this correctly ... I think you are saying that I could do this ...

Code:
def afterGeneration():
    return mirrorizePlots()

def mirrorizePlots():
    # MIRRORIZE PLOTS
    map = CyMap()
    etc for the balance of what was in 'def afterGeneration():'

... and then call mirrorizePlots again from normalizeAddExtras() ...

Code:
def normalizeAddExtras():
    return mirrorizePlots()
#    return None

It is a bit redundant, but it should be fairly quick.

Basically yes. Although I will point out that none of the functions involved return anything meaningful. The important point is that mirrorizePlots directly changes the map. What you have written looks like it would work, but it falsely gives the impression that values are being returned.
Reply

(November 12th, 2014, 17:41)SevenSpirits Wrote: Basically yes. Although I will point out that none of the functions involved return anything meaningful. The important point is that mirrorizePlots directly changes the map. What you have written looks like it would work, but it falsely gives the impression that values are being returned.

Excellent. I will try that.

I use the 'return None' as a way of telling myself that the function stops / quits here. Or sometimes as a way of getting a different function run (return functionName).
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.

(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
Reply

Thx Seven for your comments and observations. Here is an updated mapscript that fixes the following
- starting position non-mirror issues
- location of starting position (see code below)

Code:
#Ruff Change - limits the starting x value to the outer X%
def allowStartingPlot(iPlayer, iX, iY):
    global sliceW
    return sliceW * 30 / 100 <= (iX+1) <= sliceW * 60 / 100

Still thinking about if I care about the borked rivers at the join.
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.

(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
Reply

This is really cool. How do you adjust map scripts for mods?
Reply

(November 12th, 2014, 18:47)Ruff_Hi Wrote: Thx Seven for your comments and observations. Here is an updated mapscript that fixes the following
- starting position non-mirror issues
- location of starting position (see code below)

Code:
#Ruff Change - limits the starting x value to the outer X%
def allowStartingPlot(iPlayer, iX, iY):
    global sliceW
    return sliceW * 30 / 100 <= (iX+1) <= sliceW * 60 / 100

Still thinking about if I care about the borked rivers at the join.

Ruff, did you ever finish these changes? If so, can you share? smile

Played: Pitboss 18 - Kublai Khan of Germany Somalia | Pitboss 11 - De Gaulle of Byzantium | Pitboss 8 - Churchill of Portugal | PB7 - Mao of Native America | PBEM29 Greens - Mao of Babylon
Reply

(February 27th, 2015, 15:44)spacetyrantxenu Wrote: Ruff, did you ever finish these changes? If so, can you share? smile

Sorry - thought I had uploaded it.

The attached includes the py file and also a PDF showing the differences between the DUEL version of the map and SS original.


Attached Files
.zip   Hall_of_Mirrors_Duel.zip (Size: 159.3 KB / Downloads: 6)
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.

(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
Reply

Thanks!

Played: Pitboss 18 - Kublai Khan of Germany Somalia | Pitboss 11 - De Gaulle of Byzantium | Pitboss 8 - Churchill of Portugal | PB7 - Mao of Native America | PBEM29 Greens - Mao of Babylon
Reply



Forum Jump: