HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Help!

07-02-2004, 04:10 AM#1
dspringfield14
WEll, I'm making a Monopoly Map and I need a trigger for moving the pieces around the board. o_O I don't want the players to have to manually do this so I'm trying to get some triggers to move them auotumatically.

P.S. I know i can move them Instantly there but i want them to like go from space to space like in the real game.
07-02-2004, 04:26 AM#2
HexenLordX
There is an action called 'Unit Group - Issue order targeting a point'.
Players can simply click the spot they want to go to (or square for monopoly), and units will move there, using their normal run/walk/fly animations, or whichever ones they use.

It may look like this:
Unit Group - Order (Units of type Shoe) to Move To (Center of (Tennessee Avenue<gen>))

The reason for using unit group is you can choose a specific type of unit to move, and if you follow basic monopoly rules, no two poeple have the same type of game piece, therefore whoever has the 'Shoe' will move only their piece with this trigger. The 'Tennessee Avenue <gen> will be a region you place over Tennessee Avenue on the gameboard. I hope this helps.
07-02-2004, 04:42 AM#3
dspringfield14
Quote:
Originally Posted by HexenLordX
There is an action called 'Unit Group - Issue order targeting a point'.

But won't the game piece cut corners and what if it goes there the wrong way???
07-02-2004, 04:50 AM#4
Unykorne
You can avoid that with pathing blockers, making it so that they can only go the "right" way. This usually isn't the best way of doing it, but in monopoly anything that moves follows the same "path", so it should work very well.
07-02-2004, 05:23 AM#5
HexenLordX
Quote:
Originally Posted by dspringfield14
But won't the game piece cut corners and what if it goes there the wrong way???

This can be avoided. Either create pathing blockers, or under the textures in your terrain, put a thin boundry around the inside of the squares so the unit is forced to walk all of the way around instead of cutting corners. You can do this on the outside of the board if it is not going to take up the entire map, so they cannot go on the outside of the map either.
07-02-2004, 06:04 AM#6
dspringfield14
Ok, so I can just make pathing blockers to make sure they go the right directiona nd stuff like that. Got it! Ok, but I also have another question: I am going to make an automated dice system. How can I make a trigger to make sure they go the amount of spaces on the dice??? ( I have an idea but my idea makes me have triggers on EVERY space that have the numbers of spaces from 2-12 and each space region provided for EVERY space...BUT THAT WOULD TAKE FOREVER!)

P.S. If I can find no other way i shall use the one I'm thinking of.
07-02-2004, 02:04 PM#7
Shimrra
I have an idea that seems to be somewhat like yours, but perhaps a bit easier: Perhaps you could have each square on the board equal to a certain number; increasing from 'Go'. the unit, or 'piece', would have a custom value equal to the number of the square it is on. You could then add the 'dice roll' to the unit's value and order the unit to move to the region that held the same number. The inl other thing you would have to do is put an if\than\else so is the number were to excede the number of spaces on the board, you would reset it and keep adding.

Basically, you don't have a trigger for every space on the board, but instead you would probably set each space to a region array. Then use the custom values and the dice role to descern which of the regions is the target one.
07-02-2004, 07:59 PM#8
dspringfield14
Thanks guys this really helps me ALOT! But on the spaces I get that now, but...do i use the region array to give the region the number???
07-03-2004, 07:07 AM#9
Ninja73
Personally, i hate using a bunch of regions for what ur doing. This is because since ur using a dice system also, u want it so that it moves the pieces. So what i would do is just to pause units not in use, then just make the unit move to the position of itself with an offset so u dont gotta use a bunch or regions and stuff.
07-03-2004, 01:46 PM#10
Shimrra
Arrays have a number field after the name (e.g.: BoardSpace[NUMBER]). In this number field, you place the number of the region. This way you can say, "Unit - Order UnitVariable to move to BoardSpace[(CustomValue of UnitVariable) + (DiceRollVariable)]".
07-03-2004, 09:32 PM#11
dspringfield14
Quote:
Originally Posted by Shimrra
Arrays have a number field after the name (e.g.: BoardSpace[NUMBER]). In this number field, you place the number of the region. This way you can say, "Unit - Order UnitVariable to move to BoardSpace[(CustomValue of UnitVariable) + (DiceRollVariable)]".

Ok so I thjink I'm doing this right I have this variable and Its a Region w/ an Array size 1 so when i Made it it looks like this in the variable box:

Board_Space Region Array (1) No Region

SO i just make lots of those with diff array sizes???
07-03-2004, 09:50 PM#12
Vexorian
the array size actually determines till what value the array will be initialized at map initialization
07-03-2004, 09:51 PM#13
dspringfield14
Ok nvm....would you just give me directions or a VERY detailed example???
07-03-2004, 09:53 PM#14
Ninja73
ok, well i dont think u fully understand arrays, so ill explain what an array is. An array is just multiple slots of data saved under 1 name. For instance INTEGER could have an array of 10. Then it could have a different value ain each of the 10 slots. So u want 2 make an array with the size of how many regions u need it on. Then u can set REGIONNUMBER[1] (array 1 for the name of the region variable) = REGION001, then u can set the [2] or the second slot for that variable 2 a different region. Do u understand?
07-03-2004, 10:11 PM#15
Milkman
Another example in case you didn't understand the previous one:
Each street on the board is representated by a number starting with 0 and 1 on go. When you roll the dice, you get i.e. 4.
Say that you are on street number 14, the total street number would be 18. Thus, you set StreetNumber[player number of player in the trigger] = 18.
Then you order the unit to move to RegionsArrayWithStreetNumber[streetnumber[player number och player in the trigger]].
Do you copy?
A regions array can look like this:
Regions Array
Events
Map initialization
Conditions
Actions
Set Regions[j] = 1 <gen>
Set j = (j + 1)
Set Regions[j] = 2 <gen>
Set j = (j + 1)
Set Regions[j] = 3 <gen>

where, J is a number to keep track of the arrays, not used in any other triggers. To get the right one you you StreetNumber instead. And in your case Regions would be replaced by RegionsArrayWithStreetNumber.

Hope i helped out!