Turn-based movement?

For discussions regarding skinning and mapmaking for Warcraft 3.

Moderator: Moderators

Turn-based movement?

Postby FatOfficer » Thu May 15, 2008 10:46 am

Ok, so im trying to do stuff in the WE for the first time (first serious attempt, anyway), so please bear with me if im asking really dumb questions, or if im doing stuff in a non-efficient manner. Im still at the very bottom of the learning curve :oops:

Im trying to convert a boardgame to a WC3 mod, and the first problem ive encountered is that of moving the pieces about the playing field.

So far i have made the playing board (26 by 15 squares), and on that i have made a region for each square, and named the regions A1 through to Z15.

The movement trigger i am working on is something like this:
- Event: a unit is picked
- Condition: The picked unit has movement points remaining (I have substituted INT for movement points, so that each unit has a fixed value)
- Action: Unit is ordered to move to adjacant region.......

And thats where the chain breaks for me. Im looking for a way to make a selected unit move from the region it is currently in, to one of the 8 adjacant regions, like for instance if the unit is standing in region F6, it should be able to move to either E5, E6, E7, F5, F7, G5, G6 or G7.

But, by now i have spent the last half hour browsing through the different drop down menus (yes, in using GUI, so go ahead and flame me), and i just cant seem to find anything that will allow me to make such an action.

Im certain that it is possible to do, but with my total lack of kowledge about the WE, i thought that i would probably be better off asking some of you more experienced guys.

So, any good ideas??
(I dont necessarily need a pre-coded solution, just a hint as to the right direction would be very much appreciated.)
User avatar
FatOfficer
 
Posts: 69
Joined: Wed Jul 05, 2006 2:35 am
Location: Kraghede, DK

Postby Drain_Pipe » Thu May 15, 2008 12:48 pm

I saw one map that kind of used motions like this. it was called soul chess. Anyways whenever you selected a unit, circled appeared that labeled where they could go. In terms of showing which regions you can access, you need some method of storing the regions in a way that, when you're on a point, you know that, unless some situations (ie end of board and corners) you know the other regions based on your region. I would try setting up your regions as numbers rows and columns. That way you should be able to detect columns beside you and rows as well.

ie number your stuff Region_R01_C01 all the way to Region_R16_R25 or whatever and that way you know that if you're in, say, column 10 and row 6, that you can move either 1 space left or right, so columns 9 or 11 as well as 1 space up or down, or rows 7 or 5, or a combination of those, so then you can setup markers or something to show those and allow your unit only those areas to move to. You'll need a few special case (ie column.row 0 or column/row 16/25 or whatever the max is, because they will have less potential spots to move) I dunno if this is the best way but it's what came to mind, and it should be easy enough to trigger using arrays or integers or strings so that you can convert coordinates into a numerical value that can be analyzed to find spots where you can go and revert that back into proper regions. hope this helps
-Drain Pipe Out-
Drain_Pipe
 
Posts: 640
Joined: Sat Jul 29, 2006 9:16 am

Postby FatOfficer » Fri May 16, 2008 4:58 am

Yeah, sounds like a logical way of doing it, although i dont particularly like the idea of having to rename all 390 regions... Is it possible to do it by making 26 column-shaped regions and 15 row-shaped ones?

Also, im having a bit of trouble figuring out how how to use arrays and other stuff. So far i have glanced at a few tutorials, among others those found at www.scumedit.net, but i dont think im much better off for reading them (they gave me a general idea of the functionalities of some of the stuff in the WE, but i still cant use it properly. Guess it comes with trial and error, and a lot of practise)
So, if anyone knows of a goood place to get some more in-depth tutorials, preferrably with examples , i'd be much obliged (and also not too big, since im still in Sudan, with quite possibly the worlds slowest internet connection at my disposal. Anything over appr. 700 Kb in file size and ill get a timeout from the server).

Anyway, thanks for the pointers, ill try and work on it.
User avatar
FatOfficer
 
Posts: 69
Joined: Wed Jul 05, 2006 2:35 am
Location: Kraghede, DK

Postby Tirion » Fri May 16, 2008 6:38 pm

FatOfficer wrote:Is it possible to do it by making 26 column-shaped regions and 15 row-shaped ones?

Yeah, that'd work.
User avatar
Tirion
 
Posts: 413
Joined: Mon Jul 03, 2006 1:27 am
Location: Lurking

Postby Drain_Pipe » Sat May 17, 2008 11:04 pm

FatOfficer wrote:Yeah, sounds like a logical way of doing it, although i dont particularly like the idea of having to rename all 390 regions... Is it possible to do it by making 26 column-shaped regions and 15 row-shaped ones?

Also, im having a bit of trouble figuring out how how to use arrays and other stuff. So far i have glanced at a few tutorials, among others those found at www.scumedit.net, but i dont think im much better off for reading them (they gave me a general idea of the functionalities of some of the stuff in the WE, but i still cant use it properly. Guess it comes with trial and error, and a lot of practise)
So, if anyone knows of a goood place to get some more in-depth tutorials, preferrably with examples , i'd be much obliged (and also not too big, since im still in Sudan, with quite possibly the worlds slowest internet connection at my disposal. Anything over appr. 700 Kb in file size and ill get a timeout from the server).

Anyway, thanks for the pointers, ill try and work on it.


as for arrays, I use them in .GUI when I'm basically doing the same action a set number of times. Sometimes you can get around using arrays, but i find that in .GUI, when you make custom variables that are independent and attached to multiple units, all going at the same time, the only way to keep track of each unit and the independent custom variables attached to them, efficiently is usually with some sort of array setup.

That being said, you can sometimes, for instance with unit groups, use the "pick every unit in group and do actions" command instead and rarely need the use of arrays, although they are very useful for a lot of different things, usually with repetition.
-Drain Pipe Out-
Drain_Pipe
 
Posts: 640
Joined: Sat Jul 29, 2006 9:16 am


Return to Custom Mapmaking

Who is online

Users browsing this forum: No registered users and 4 guests