HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help! I don't even know where to start!

12-29-2006, 01:49 PM#1
AtOmIc_PeAnUt
hihi What I would like to ask for some help on is this:

I am making a Trivial Pursuit map (ROFL) and I need some kind of system to let the 'peices' move around the board. The spaces are made with circles of power, and there is a dice roll function which generates a random number that determines how many spaces you may move in any direction, but in one direction only during that move. Any1 who has played Trivial Pursuit will know what I mean. Anyway I have absolutely no idea where to start with this. I have created a region in every space cos I thought that would probably be needed, but that's as far as I got lol. I guess I need some way of getting it to count away from the unit's current space and set its destination, but I don't know how I can get it to count in terms of spaces

I probably make no sense, but if anyone could be kind enough even to give a few ideas, I would be very grateful
12-29-2006, 02:07 PM#2
Themerion
Well... I suppose you can use regions for everything, but wouldn't it be easier to use Angles and Cos + Sin functions?

By "move around", do you mean that they walk, or that they are moved?
12-29-2006, 02:13 PM#3
Fireeye
I would make something like this.
1. Get the distance between the centers of 2 regions/fields
2. Create the needed unit in the center of 1 region
3. Additional you can delet now alll rects if you don't use them furthermore
4. Create a Dice with a random number between 1-6
5. Now let a Dialog appear with the option Up, Down, Right and Left.
6. Get the x and y coords of the unit you created for the player
7. Now add/substract x*d to the x and y Value (x = Dice Value and d = Distance between 2 centers)
If the pressed Button is up then add x*d to the y value and leave the x value as it is.
If the pressed Button is down then substract x*d to the y value and leave the x value as it is.
If the pressed Button is right then add x*d to the x value and leave the y value as it is.
If the pressed Button is left then substract x*d to the x value and leave the y value as it is.
8. Move the unit and when you want events compare it with x and y values if it is == then you call the needed event
12-30-2006, 02:10 AM#4
Pyrogasm
Fireeye, that would work if the trivial pursuit board were a grid, like a 2-d plane. However, it is not. Trivial pursuit boards (or at least the ones I've played) are circular, and have spokes going into the middle (like a wheel) and 1 space in the middle.

AtOmIc_PeAnUt, I have a question: Do you want the player to click on the space that they want to move to and then move the piece there, or have them pick each space 1-by-one?

If you want the latter, my suggestion would be to make the "pieces" invulnerable and unselectable (locust), and make the "spaces" units with 2-6 abilities (Depending on where the space is). The way this works is that the piece starts on a space, with which the player casts an ability to move it in different directions (use channel for the abilities because you can change its base order ID). After the player uses the ability, then move the player's piece to the next closest space in the direction chosen (probably using a jumping parabola, like in all the demo jump maps), select the "Space" unit for the player, and decrease the "move" integer by 1.

You're going to need 6 triggers for the moving (1 for each direction), which will then have an If/Then/Else for each space (Which would be highly inefficient, though I see no other way to do it). You'd have a region at each "space" that you would check to see if it contained the player's "piece" (which would be assigned to a variable, since units with locust don't show up in "pick every unit" functions).

That's the gist of it, but I'm intested in helping you out more with this if you don't get it. PM me the map and I can see what I can do.
12-30-2006, 01:56 PM#5
AtOmIc_PeAnUt
Yes it is a circle with spokes like you say Pyrogasm, but thanks anyway Fireeye. In answer to your question, I guess it will have to be so the player clicks on their final destination space, otherwise people would be able to switch direction during their turn which is disallowed in Trivial Pursuit. The playing peices are footmen aswell, so I would like to make them walk to the destination space rather than just hop there. Anyway, I will post the map on here for you to take a look at, it's no way near done, but you can get the idea of the position of the spaces and so on.
Attached Files
File type: w3xLOTR Trivial Pursuit V.ALPHA.w3x (55.2 KB)
12-30-2006, 07:57 PM#6
Themerion
A movement system for this map could best be created by oop in vJASS I think. However, you don't use JASSHelper, so I have another solution.

First of all; do you know how an array variable works? Secondly, do you know what a unit custom value is?

What I had in mind is that you can assign a unique value to every circle. Then you can create three unit arrays, one for clockwise movement, one for counter-clockwise, and one for inwards. (The inner spaces can use cw and ccw for in and out.)

Let's say that you set up the red main-space, with the unique id 1. It would look like this:

Trigger:
Setup Circles
Events
Conditions
Collapse Actions
Unit - Set the custom value of Weapons And Warfare (large) 0072 <gen> to 1
--------------- This is the circle clockwise of the red main-space-------------
Set Clockwise[1] = Roll Again (large) 0073 <gen>
--------------- This is the circle counter-clockwise of the red main-space-------------
Set CounterClockwise[1] = Roll Again (large) 0076 <gen>
--------------- This is the circle inside the red main-space -------------
Set Inwards[1] = Roll Again (large) 0060 <gen>

This means that if you know on which circle a unit is standing; then you also know (through its custom value) which the adjacent circles are. This should make it somewhat easy to write an algorithm for finding out where the unit can go...

(If you want further help or didn't understand what I meant, then don't hesitate to say that!)