HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Monopoly Spaces!

07-07-2004, 02:21 AM#1
dspringfield14
As you can see I am making a Monopoly Map. But I really need help on trying to figure out how to move them space to space without the person doing it manually. So far, I have each space on the board set to a number 1-40, so when ever the person rolls it should add the dice roll to the number of the space the unit is on and then go to the space it is supposed to end up on. I have the numbers set up and the dice roll...the question is how do I make it add them and then move to the corresponding space?
07-07-2004, 02:29 AM#2
HexenLordX
Hmm.. toughie, huh?

Well, do you have regions or rects overtop of all of the squares that are numbered 1-40? And how is your diceroll set-up? is it a trigger? You should post it and how you did your squares if you want more help.. cause we're not sure of what type of dice or square system your using here.
07-07-2004, 02:33 AM#3
HexenLordX
If your diceroll sets a variable when the number is out, like when you roll a 12 you set DiceNumber=12. You can set a variable for what square you are on, say Unit Enters Jail (region), set variable CurrentSquare = 10.

Another trigger could be made with DiceNumber=12, Event, Add CurrentSquare+DiceNumber = Next Square. Set NextSquare = Square 22 or whatever the sum is, and then do a move event, Move current unit to NextSquare. I'm really not sure how your system is set up so I can't be of much help, and I just confused myself by writing that so it might have an error or two. Give a little more info and I'll try and help you out some.
07-07-2004, 02:38 AM#4
Rafael Br
First of all, set all of the regions that you used for each of the spaces on a integer array variable, then, make a variable for each player, representing the number of the space that he is and another to represent the dice number, every time the dice rolls add the number to the variable made for each player, using a loop, each time ordering it to move to the next space and subtracting to the dice roll variable, this is because you will have to check it the next space is the number 41, that does not exist, so you will have to order it to the 0 instead, using the dice roll variable to check how much spaces are left to go.
I may have confused you, but the computer I am using now don't have WE, if you don't understand I show you triggers later.,
07-07-2004, 02:54 AM#5
dspringfield14
Ok, pretty confusing but I'll read through it a few more times for better understanding.
More info? Ok. Well my dice system is just set up as a random number of 2-12 since you cant have a 1. Simple. The boards spaces are rects with arrays that I then set up the variable to be a number. Harder. So I need to know how to add them and then to move them. Hardest.

P.S. THanks for the help I'm sure I'll understand it!
(If you need more info I'll send it!)
07-07-2004, 06:28 AM#6
Ninja73
Ahh, y use 40 regions, that would take 4ever, just use 3 types of invisible units, alternate them per square, then jsut do it so that if there is a unit within 0 of piece and unit is equal to spacetype1 then order unit to move to random units of type unittype2 with 450 of piece. Then do 1 of those for each of the 3 types, since they alternate it would b forced 2 goto the next 1. Then just use a variable 2 detect how many times to do this depending on die rolls. 1 trigger opposed to a bunch and 40 regions.
07-07-2004, 06:21 PM#7
dspringfield14
Ninja thanks for trying to help but the way mine is going would make it look GOOD. Yours just is easy and sloppy...
07-07-2004, 06:49 PM#8
Lord_Osiris
idk if u know about array varribles. An array varrible is a varrible with index numbers. for example i can say grunts(1-10) grunts(1) can be set as a different grunt then grunts(10). It takes any interger as the index number. So you could make a varrible say grunt(player number of player red)

Create an array varrible for regions regions(1-40). Set Each Square to regoin(1-40). then a player spot varrible playerspace(1-12 or however many players there are). This will tell the trigger where to move the player space. Then a unit varrible playerpiece(1-12). Make Sure the player spot and player pieces are set corresponding to the player number. (i.e Playerspot(1) is for red)

Trigger: PLayer rolls dice... Set Playerspace(player#of triggering player) = playerspace(player#)+diceroll
If Playerspace >40
then set playerspace(# of trig player) to playerspace(# of trig player)-40
Then move unit playerpiece(#of trig player) to center of Region(playerspace(#oftrig player))

BTW... I can host if u need testers
07-07-2004, 07:27 PM#9
Ninja73
yea, the region thing would work fine, but it takes longer 2 select each region and all, its ezer just 2 place 40 invisible units that no1 would know about and just have them move to the next 1 in the sequence. This would also reduce the number of variables needed, and its not "sloppy", if uve ever looked at pyramid escape he barly used regions, he used units 2 make the ghost move on ghost path, the fire move on chamber of fire, ect. And also this will look the same in game as if u used regions. Using regions wont make it look any neater ingame.
07-08-2004, 07:38 PM#10
Lord_Osiris
Try my way... By using arrays, you can easily add the region u are going to. For example if player 4 is on the 5th square, you can make the player piece, and space number all correspond using the array index...
07-08-2004, 10:40 PM#11
Kelna2
I've made/tried to make a monopoly map before, here is what i did:

Event: player property event, player 1 has at least 1 lumber
Condition: None
Action: If/Then/Else
If: Number of units in square 1 matching PlayerUnit(Player number of triggering player) is equal to true is equal to 1
Then: Pick Every Unit in Square 1 Matching PlayerUnit(Player Number of Triggering Player) and do Order unit to move to Square 2
Else: Do Nothing

PlayerUnit is an array equal to the number of players, say you have 10 players in your map, then the array variable would be 10
Square 1 is the first square on the map, like the Pass Go square.
Square 2 would be the second square on the map, I don't remeber what the second square on the monopoly board is but it would be that one.
Lumber would be gained from the rolling from the dice, i'm pretty sure that someone already told you how to do that.
The event would be the same for every player only the player number would be changed to fit how many players you want.
The action would be repeated for each square also.
07-09-2004, 07:50 PM#12
Milkman
I don't know if anyone have said this already since i didn't feel like reading all the code so here's what you should do (If you are using the solution i gave you in another thread)

Events: Whatever
Conditions: Whatever
Actions:

set StreetNumberToMoveTo[player number of player in the trigger] = StreetNumberToMoveTo[player number of player in the trigger] + Dice

Then you'll have the street he was previously on and then you will have the street he will move to. Also i talked to you about a region array, here it comes again:
A regions array can look like this:
Regions Array
Events
Map initialization
Conditions
Actions
Set Streetnumber[j] = Streetnumber 1 <gen>
Set j = (j + 1)
Set Streetnumber [j] = Streetnumber 2 <gen>
Set j = (j + 1)
Set Streetnumber [j] = Streetnumber 3 <gen>

So, regions[1] is the location street number 1 and regions[18] is the location street number 18. Not that hard, eh?

So, now you have set the place where you want to go, and you have stored the different regions in a regions array.

To get the unit to move you will have to do:
Unit - Order unit to move to StreetnumberToMoveTo[Streetnumber[Player number of the player in the trigger]]

In case you don't understand
StreetnumberToMoveTo is an IntegerArray with the initial value 0, or 1 if GO is 1.
Streetnumber is a RegionsArray with the initial value None.

And one more thing, last time you gave some rep for the help, thanks for that. It's only one thing, you have me negative reputation instead of positive. Judging from the comment i believe that you intended to give em positive reputation, aye?

Once again, hope i helped out.