HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Grid/turn-based movement

06-05-2008, 04:32 PM#1
Sunwarrior25
Ok guys. Big question question coming up. I am terraining a turn-based strategy for Wc3. This is a big project for me, as it involves several things that I have never done or implemented before (namely a summons system). My first question of the day is, as the name suggests, something along the lines of grid based movement. I need to institute some sort of movement within a given turn, where a character can move along a grid as seen in this editor screenshot.
Zoom (requires log in)

I would prefer an explanation in GUI, but if that is laggier than JASS, I can go for a JASS explanation too. If I have to make the terrain grid-based, I will.

EDIT: I am already prepared to use dummy units, I just need to know how to place the CoP's as shown in the editor screen shot, checking for pathing and other units.
Attached Images
File type: gifGridExample.gif (435.0 KB)
06-05-2008, 04:53 PM#2
rulerofiron99
1. Disable normal movement.
2. When you select a unit,
for each index a from -5 to 5
-for each index b from -5 to 5
set l = position of unit + (128 x index a) and (128 x index b)
if l is in range of position on unit, create circle of power
3. Select circle of power to move.

On number 2, use things like checking for terrain pathability, units in range of the position, destructibles etc.
06-05-2008, 06:24 PM#3
Sunwarrior25
Just a few more questions: what is 5?

How do I have different radii for different types of creatures (If I wanted to have that zergling move 9 squares/turn)?

And how do I disable normal movement - make the "enemies" controlled by a neutral player?
06-05-2008, 06:34 PM#4
Dark.Revenant
5 and -5 is the range. -9 to 9 would be a range of nine.
06-05-2008, 06:42 PM#5
rulerofiron99
And added to that, you must check if the point is in range of 128 x 9.

To disable normal movement in a <6 player map, make alternative slots.

In a 12 player map, set movement speed to 0 and make triggers for movement.
06-05-2008, 06:45 PM#6
Sunwarrior25
Ok. Would the Ward classification help or hinder this system?

EDIT: I'm not sure if this is true or not, but will units automatically try to attack a neutral player that is in a another force?

EDIT2: Ok, I'm having some difficulty with the method, so you're going to have to write a slightly deeper explanation. I'm trying to check for the player's turn, I want to check and see if the unit has moved, and I want to do it with a dialog that is displayed with the Esc key. (should I check for 'no unit'?)
06-05-2008, 10:43 PM#7
Dark.Revenant
Don't ask for so much. When you ask for help at wc3c, you get the theory behind something and a sample code snippet, not 50% of the system ready-made.

As for the questions you asked in the above post, I would advise you to look through all of the conditions and actions to become familiar with them.
06-05-2008, 10:48 PM#8
Sunwarrior25
Ok, well. I do know that checking to see if the point contains 'no unit' doesn't seem to let any circles be placed...
06-05-2008, 10:59 PM#9
Dark.Revenant
Why the hell would you check for no unit? Check for the circles of power, man.
06-05-2008, 11:03 PM#10
TEC_Ghost
Here is my current map I'm working on, Using Grid based movement system I made in Jass. Not for the feint of heart my coding isn't very user friendly :P but you might be able to get the gist of it.

-----------------
Helpfull stuff-----
-----------------
ESC key ends turn.
Use the abilities to show tiles.
Make sure to click the tile to attack/move.
Arrow Keys control camera movement.

Remember this map is in Alpha so far, it's my baby and I don't have all the stuff in it I want (Item systems etc) But I thought it might help you out bud.

Download it BattleTactics0.01.w3x
06-05-2008, 11:31 PM#11
Sunwarrior25
Quote:
Originally Posted by Dark.Revenant
Why the hell would you check for no unit? Check for the circles of power, man.
Why would I do that if I'm using the check to allow the placement of the circles. I also clear all of the circles before the placement, if that helps.

Quote:
Originally Posted by TEC_Ghost
Here is my current map I'm working on, Using Grid based movement system I made in Jass. Not for the feint of heart my coding isn't very user friendly :P but you might be able to get the gist of it.

-----------------
Helpfull stuff-----
-----------------
ESC key ends turn.
Use the abilities to show tiles.
Make sure to click the tile to attack/move.
Arrow Keys control camera movement.

Remember this map is in Alpha so far, it's my baby and I don't have all the stuff in it I want (Item systems etc) But I thought it might help you out bud.
What the-? No! I'm not gonna download someone else's work. I'm trying to set this up so that movement can be done as described in my above post. I'm already setting up the dialog when a player presses the Esc key.(though I haven't perfected the "Wait your turn" message). It's just this check. I want the movement circles to appear only when the movement dialog button is clicked, and the attack circles for the attack dialog button.

EDIT: Oh well... I'm going to work on the characters for now, then I'll come back to the system.

EDIT2: I'm also going to redesign my terrain: It looks too much like A Link to the Past. Sorry Ghost, I'm not using your terrain either.
06-06-2008, 02:31 AM#12
TEC_Ghost
I didn't want you to use my system dude. I uploaded it so you could see the theory and implementation of this kind of map.
06-06-2008, 04:25 AM#13
rulerofiron99
No. If no unit = true, then you can place a circle.

But even that is wrong.

This is what you'd do:

set ug = units in 100 of point
if number of units in ug = 0
create circle
06-06-2008, 01:57 PM#14
Sunwarrior25
Oh... so that's what you meant. And Here I thought I was supposed to be checking for an Unit or Unit-Type.

EDIT: Oops, almost forgot to +rep you guys.

EDIT2: Could all of this work in GUI?
06-06-2008, 02:15 PM#15
rulerofiron99
I live for GUI, so yes. Just remember to call RemoveLocation in custom script every now and then.