GrumpyMel
Posts: 864
Joined: 12/28/2007 Status: offline
|
quote:
ORIGINAL: GunnyJarhead Hmmm...see...I told you I don't know how to code! How many should there be..I have no idea, until it feels right i guess. LOL I was able to "execute this event now", with the "Random : Place Crate" event on a blank map. Below. 0) SETVAR: TempVar9 = CheckMapWidth 1) SETVAR: TempVar9 * CheckMapHeight 2) SETVAR: TempVar9 / 200 3) LOOPER: TempVar10 FROM 0 TO 100 4) SETVAR: TempVar0 = CheckMapWidth 5) SETVAR: TempVar0 * CheckRandomPercent 6) SETVAR: TempVar0 / 100 7) SETVAR: TempVar1 = CheckMapHeight 8) SETVAR: TempVar1 * CheckRandomPercent 9) SETVAR: TempVar1 / 100 10) CHECK: TempVar9 > 0 11) CHECK: CheckLocTypeXY(TempVar0, TempVar1) == -1 12) CHECK: CheckLandscapeType(TempVar0, TempVar1) > 1 13) CHECK: CheckHexOwner(TempVar0, TempVar1) == -1 14) EXECUTE: ExecSetSpecial(43, 0, TempVar0, TempVar1) 15) SETVAR: TempVar9 - 1 16) EXECUTE: ExecHexActionCard(TempVar0, TempVar1, 1) 17) EXECUTE: AI_SetAIVP(TempVar0, TempVar1, -1, 1) 18) END CHECK 19) END CHECK 20) END CHECK 21) END CHECK 22) END LOOPER It did place crates..but very few and far between. So I ran it again, and it added even more crates, I did this a few times (imagining that they were Cities instead of Crates) until I got what I thought was a good distribution. I tried to changes the code above to place cities instead of crates..but never could get it to do it. I never could get it to place Raw and Oil doing "execute the event now" using "Random : Place Raw and Oil"...this worked to an extent. Id did place the R&O but only in a very small section of the 200x160 map. It placed it only in the upper left hand corner. Once again I could continue to execute the event until it felt right. 0) LOOPER: TempVar0 FROM 0 TO CheckMapWidth 1) LOOPER: TempVar1 FROM 0 TO CheckMapHeight 2) CHECK: CheckSlot(TempVar0, TempVar1, 0) == 1 3) EXECUTE: ExecChangeLocationType(TempVar0, TempVar1, 2, 8) 4) EXECUTE: ExecSetLandscape(TempVar0, TempVar1, 5) 5) EXECUTE: ExecSetSprite(TempVar0, TempVar1, 0) 6) END CHECK 7) CHECK: CheckSlot(TempVar0, TempVar1, 0) == 2 8) EXECUTE: ExecChangeLocationType(TempVar0, TempVar1, 3, 8) 9) EXECUTE: ExecSetLandscape(TempVar0, TempVar1, 0) 10) EXECUTE: ExecSetSprite(TempVar0, TempVar1, 0) 11) END CHECK 12) END LOOPER 13) END LOOPER I think that if I knew what to change to get these to Cover the Map and could identify where to change what it places..it would be a great start. Thanks for replying In your first code example TempVar10 is the counter for how many crates you are seting, so it's setup to loop through your crate setting 100 times (meaning 100 crates maximum). Tempvar9 looks like it's used to reduce that number for smaller maps to make sure that there isn't more then 1 crate for every 200 hex's on the map. The second example looks like it's using a Slot to control which area of the map stuff gets generated...if I'm reading it right (doing this from memory) it's looking for Area 0 slots that are painted 1 or 2.....or I could have it reversed and it's Area 1 and 2 slots that are painted with a 0. Anyway, that's why it's only generating stuff on part of your map....at least I believe that's it....pretty rusty with the editor.
|