The following warnings occurred:
Warning [2] Undefined variable $search_thread - Line: 60 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 60 errorHandler->error_callback
/showthread.php 1617 eval
Warning [2] Undefined variable $forumjump - Line: 89 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 89 errorHandler->error_callback
/showthread.php 1617 eval




Roll Combat Movement
#1
I am revamping my roll Combat adding in some new features, and fixing some old but most importantly I am going to make it more accessible. With the new version of GHI that should not be too hard.

But I need your guys' help. I need some ideas on how to do movement.

Why is movement important? Well, frankly it is just not very fair to have people running from one opponent to the next in consecutive turns. For example, it is not fair for a hunter who shoots a warrior from over 50 feet away only to have the warrior right on him on the next turn. And this happens a lot, like every time I have seen a caster or hunter in battle.

Anyway I would like to some how set down some movement rules. I wish we could just throw down a DnD board but that is not really practical.

The most practical idea I have had is to trust people with 5 walking steps.

The most unpractical idea I have had is to some how use an add on to make a grid on the mini map. I have no idea how to do this and I have checked.

Perhaps there is a spell out there that puts something on the ground that we can harness.

Any and all ideas are welcome no mater how out there they may be.
Reply
#2
Warlocks have a few spells that place things on the ground and such. I cannot recall some of them off the top of my head, perhaps they could be used to sort of lay a guideline down. I am just throwing some ideas out there.
Spoiler:
APPROVED CHARACTERS!!!
Al'Zulak the Troll
Valingash the Warlock

[Image: badge.jpg]
I am The Burning Legion - Play Free Online Games
[Image: badge.jpg]
I am Warlock - Play Free Online Games
Reply
#3
There must be a way of tracking a player's movement from their starting position. I'm not familiar with the more intricate workings of GHI, but I wonder if there's a way for it to create a series of buffs that decreases with distance travelled? E.g. at the start of combat the player recieves a series of buffs along the lines of '0, 5, 10, 15, 20, 25'etc, and the buffs are removed once the player has traveled that distance? All speculation of course, I really have no idea what GHI can and can't do.

The alternative is for a GM to create a new spell that acts like one of the Shaman totem spells, except without a buff. Then they give it to every player. It could act as an OOC marker for the players' starting positions, as well as their positions with each consecutive turn. Could also come in handy for players who want to use a marker for other IC things, like if they throw their meleé weapon at the enemy, it could be used to show where it lands if it misses.
Reply
#4
I've been working on this for months now, and I still can't get it. And now reading that -you- can't get it either... well that's just makes the whole thing hopeless. QQ

But an idea I have is using the coordinate system rather than a grid. For instance, if you are standing at (6,3), and you have the option of moving up to five spaces, and decide to move all five of those spaces north, then you would move north until your current coordinate position read (6,8). But I think this could only work if you state that a player can only move in the compass directions, as moving diagonally five spaces will be a far greater distance than moving in any of the four compass directions five spaces. So instead, a person may have the option of moving X spaces up, down, left, or right, and then (MAXMOVES - X) spaces up or down if they started left or right, or left or right if they started up or down!

Eh, that probably makes no sense, but you might understand it this way instead. It's written in C, but you'll get the basic idea of what's supposed to happen. Basically, the coordinates of where the character is at the start is recorded, and while they move, it constantly checks to see where they are, and if the difference of the coordinates of where they are -now- and the coordinates of where they -started- is MAXMOVES, then they are alerted to stop moving.

Also to note, I didn't run this through a compiler, so there are likely a few syntax errors. In fact, I -know- there are at least two errors, since I didn't define the two functions, but their names explain what they do! Either way, I only wrote it to better explain the concept in programming terms, not to have it copy/pasted and consequently run.

Spoiler:
Code:
int main( int argc, char* argv[] ) {

#define MAXMOVES = 5    // Maximum amount of moves allowed is 5.
typedef struct coordinate{ int x, int y } coordinate;  // Creates a coordinate type. (x,y).

coordinate origin = read_location(&Lexi);  // Read in and record the unit's current location.

while( 1 ) {  // Infinite Loop.

if( location_difference( read_location( &Lexi ), origin, MAXMOVES ) ) { continue; }  // If the difference of where they're standing is not MAXMOVES, stay in the loop.

else{ printf( "Stop moving!" ); break; }  // If the difference of where they're standing is MAXMOVES, then they've moved the max number of spaces, and are told to stop moving, and break free of the loop, ending their turn.

}

return 0; // Must return an integer, since main is defined to return one.

}
Reply
#5
Though hard to measure, perhaps you could give people a full 2 seconds to move per turn? Then that way you can fairly use buffs like sprint and aspect of the cheetah to their fullest advantage. Or if 2 seconds is too short, then maybe 3. But it should be kept relativly low due to how quick turns go in reality.

Then like-wise if you run into a debuff, like a trap, you can cut the time down and force them to walk depending on the extremities of the trap.

Another thought, perhaps making turning around cost a second, since realistically a person can not do it in the blink of an eye and keep their momentum optimal. Also it will prevent unrealistic kiting.
☃ This is my snowman. He's there to remind me how much I hate the snow.
Reply
#6
Many addons -- CTMod, Titan Panel, and a few others -- report map coordinates, often with at least a single decimal place to record small movements accurately. It must be possible to harness (or harvest) this information somehow, and then utilize it in an addon or GHI item in order to help cut down on the whole Usain Bolt syndrome. Yes, adrenaline does amazing things, but it doesn't let you complete the 100 meter dash in under 10 seconds in full armor.

My initial thought was something along the line of Jeff's suggestion, but the issue I find with that is that not every second online is created equal. Your graphics card, processor, RAM, wireless signal strength, latency, etc. all have their effect on how quickly you can really move.

The same issue applies with calculating movement by a set number of steps. A tauren and a gnome have different step lengths, and compensate with different animation speeds -- should combat automatically be unbalanced in favor of a Tauren simply because of this?
[Image: 2mhzmdy.gif]
Reply
#7
These are all great ideas and are getting me thinking keep them coming

Edit: Knock and nexusphere I think you guys are on the right track. Nexus I don't know a lot of C but I get where you are going. I wonder if you could write a similar script in LUA? It would at least be a good foundation.

and Rent you are right about a second on the internet in not equal to every one. But about the step thing, is in not realistic that a Tauren should be able to cover more ground than a Gnome. But I have not tested it out, Wow might have some how evened it out animation wise.
Reply
#8
How's this?

Note: Don't flame me. I'm new to Lua. QQ

Spoiler:
Code:
function read_location( origin )

-- Here we must find a way to have GHI or the GUI read in the coordinate --
-- and place the X value in the 1 field and the Y value in the 2 field. --
-- We can try looking in addons like Cartographer to see how to do that. --

return origin -- return the coordinates.
end -- end read_location()

function location_difference( table1, table2, MAXMOVES )

sum = 0

-- X value difference plus Y value difference. --
sum = ( math.abs( table1[1] ) - math.abs( table2[1] ) ) + ( ( math.abs( table1[2] ) - math.abs( table2[2] ) )

-- If the sum is equal to MAXMOVES, the user is standing on the borderline of their range. --
if sum == MAXMOVES then return 1

-- If the sum is greater than MAXMOVES, the user is beyond their range. --
if sum > MAXMOVES then return 0
end -- end location_difference()

function user_turn( toggle )

-- This function will allow the user to end their turn --
-- without having to use up all of their moves. --

if toggle == 0 then return 1
if toggle == 1 then return 0

end

-- Here is where the Main() driver should begin --

MAXMOVES = 5 -- Arbitrary number.

origin = {} -- Origin is an empty table.

-- Read in the location and use the 1 field as the X, and the 2 field as the Y. --
origin = read_location( origin )

while user_turn( toggle ) do -- Infinite Loop ( I think ).

-- If the difference between the origin and current location is MAXMOVES. --
if location_difference( read_location(), origin, MAXMOVES) ) then
continue -- Stay in the loop.

-- Control statement. If the user uses all their moves --
-- alert them to stop moving and then break out of the loop --
-- ending their turn. --
else
print( "Too far!" )

end -- end If.

end -- end While.

-- Here is where the Main() driver should end. --
Reply
#9
Something I was testing this morning... It seems that to increase X or Y by just 1, you have to walk a ridiculously large distance (Bounty-Hunter was sitting in the Gilded Rose, and I was standing by the Pig N' Whistle, and the difference in our distance was a mere .2 ). We will have to determine the borders of our squares by a much smaller value, but that would result in users having to look for very minute differences in their coordinates. We could try to "zoom in" on the square by simply taking that large floating point number GHI gives us, and ignore the first few digits (ignoring the decimal, of course), by simply multiplying that number by 10 to some degree that we'll figure out later, and then ignoring what comes before the decimal!

Ex:

X: 0.74779689311981 ( X coordinate before alteration. )

X: 0.74779689311981 x 10^8 = 074779689.311981
X: 9.31 ( X coordinate after alteration. )

Doing it this way will allow us to move only a small distance from our origin to increment it by 1!
Reply
#10
:|
nexusphere Wrote:Ex:

X: 0.74779689311981 ( X coordinate before alteration. )

X: 0.74779689311981 x 10^8 = 074779689.311981
X: 9.31 ( X coordinate after alteration. )

Doing it this way will allow us to move only a small distance from our origin to increment it by 1!
nexusphere Wrote:74779689311981

This sounds intelligent, do the 74779689311981.
Azheron's back in business. For reals.
Reply
#11
Wow, Nexus you are so much better at code than me. I have been trying to run your code found a few errors, just a some end s missing. And also I don't think this bit works
Code:
if location_difference( read_location(), origin, MAXMOVES)
         then
            continue

I don't think Lua recognizes continue the way it should

Any way here is the code with a few little changes.
Spoiler:
Code:
function read_location( origin )
  
   -- Here we must find a way to have GHI or the GUI read in the coordinate --
   -- and place the X value in the 1 field and the Y value in the 2 field. --
   -- We can try looking in addons like Cartographer to see how to do that. --
  
   return origin -- return the coordinates.
end -- end read_location()

function location_difference( table1, table2, MAXMOVES )
  
   sum = 0
  
   -- X value difference plus Y value difference. --
   sum = ( math.abs( table1[1] ) - math.abs( table2[1] ) ) + ( ( math.abs( table1[2] ) - math.abs( table2[2] ) ) )
  
   -- If the sum is equal to MAXMOVES, the user is standing on the borderline of their range. --
   if sum == MAXMOVES then return 1
   end
  
   -- If the sum is greater than MAXMOVES, the user is beyond their range. --
   if sum > MAXMOVES then return 0
   end -- end location_difference()
  
   function user_turn( toggle )
      
      -- This function will allow the user to end their turn --
      -- without having to use up all of their moves. --
      
      if toggle == 0 then return 1
      end
      
      if toggle == 1 then return 0
        
      end
      
      -- Here is where the Main() driver should begin --
      
      MAXMOVES = 5 -- Arbitrary number.
      
      origin = {} -- Origin is an empty table.
      
      -- Read in the location and use the 1 field as the X, and the 2 field as the Y. --
      origin = read_location( origin )
      
      while user_turn( toggle ) do -- Infinite Loop ( I think ).
        
         -- If the difference between the origin and current location is MAXMOVES. --
         if location_difference( read_location(), origin, MAXMOVES)
         then
            continue -- Stay in the loop.
            
            -- Control statement. If the user uses all their moves --
            -- alert them to stop moving and then break out of the loop --
            -- ending their turn. --
         else  
            = print( "Too far!" )
            
         end -- end If.
        
      end -- end While.
      
      -- Here is where the Main() driver should end. --

Your idea above with working with the cordaniance I think is right on

Oh, and for any that want to learn more about codeing in wow take a look at this site http://wowprogramming.com/ or there is quite alot on wowpedia.org here http://www.wowpedia.org/Portal:Interface_customization check out "World of Warcraft Global API"

They have a very useful addon on the site that lets you do lua code in game. With syntax highlighting, and bug detection. You can find it here http://www.wowinterface.com/downloads/in...owLua.html
Reply
#12
I've noticed that every territory seems to be an inverted first quadrant. Basically, the origin (0,0) is on the upper left corner rather than lower left. I noticed this as I traveled further south, the Y coordinate would increase rather than decrease, and the X coordinate would decrease the further west I traveled, as expected. No idea why Blizz did it this way, but eh.

Anyway, the current display of coordinates would look something like this:

X: 0.334618615973

But that's a mess. We also already know that the standard scale Blizz decided to use goes from 0 to 1, so to increment our location by 1 would require us to move an entire territory, which completely ruins the point of us even making this addon! So the solution, as I mentioned earlier, is to "zoom in" on the territory, consequently increasing the range from 0 - 1, to 0 - 100, or 0 - 1000, or even 0 - 10,000! Meaning that it would take 100, or 1000, or even 10,000 moves to travel across a single territory.

So I devised this little equation that will display the current coordinate position in a format that is far easier on the eyes:

-- We will use zoom as our constant --
zoom = 100

-- Once the coordinates are set into their appropriate --
-- variables we can proceed to change its format. --

x = ( x * zoom ) - ( ( ( x * zoom^2 ) % 1 ) / zoom )
y = ( y * zoom ) - ( ( ( y * zoom^2 ) % 1 ) / zoom )


Now, that probably looks complicated, but allow me to explain how simple it actually is!

All this does is move the decimal in the original coordinate two spaces to the right:
-- ( x * zoom ) --
0.334618615973 becomes 033.4618615973

This will move the decimal two more spaces to the right.
-- ( x * zoom^2 ) --
0.334618615973 becomes 03346.18615973

Now it will divide that result by 1, but the great thing about the "%" ( modulus ) operator is that it doesn't give us the number of equal divisions, but rather what remains of that division.
-- ( x * zoom^2 ) % 1 --
03346.18615973 becomes .18615973

This will take that remainder of the previous division, and move the decimal over two spaces.
-- ( ( ( x * zoom^2 ) % 1 ) / zoom ) --
.18615973 becomes .0018615973

Now those two values will be subtracted!
-- ( x * zoom ) - ( ( ( x * zoom^2 ) % 1 ) / zoom ) --
033.4618615973 - 0.0018615973 = 33.46 <- far easier to read than 0.334618615973, no?

Not only is that result easier to read, but it allows us to divide the territory into a 100x100 grid! Or 1000x1000, or whatever number you plug into the "zoom" variable.

All we need to do now is find a way to have the user's current location be constantly displayed on screen rather than in the chat box, which is all I've managed to do so far. XD

Edit: I think I messed up the modulus operator. If any Lua experts could take a look at it, I'd appreciate it!
Reply
#13
DuskWolf Wrote:They have a very useful addon on the site that lets you do lua code in game. With syntax highlighting, and bug detection. You can find it here http://www.wowinterface.com/downloads/in...owLua.html

Oi!

When you save a .lua file on that addon... what directory does it save it to on your comp? I tried running the code and that infinite loop made my comp freeze, and when I went to get it back, it was nowhere to be found! I saved it before I ran it, so I know it's around somewhere...

Note: Stay away from infinite loops! XD
Reply
#14
I think it saves it in the WTF file you will have to dig down to find it though. Although, it should pull up in the load button in game if you saved it?
Reply
#15
I got it working!

Just copy/paste this into any GHI item with a "script" right click action!

Spoiler:
Code:
origin = {}
origin2 = {}
zoom = 100

origin[1], origin[2] = GetPlayerMapPosition( "player" )

origin2[1] = origin[1]
origin2[2] = origin[2]

origin[1] = origin[1] * zoom
origin[2] = origin[2] * zoom

origin2[1] = origin2[1] * zoom^2
origin2[2] = origin2[2] * zoom^2

origin2[1] = origin2[1] % 1
origin2[2] = origin2[2] % 1

origin2[1] = origin2[1] / zoom
origin2[2] = origin2[2] / zoom

origin[1] = origin[1] - origin2[1]
origin[2] = origin[2] - origin2[2]

print( "X: ", origin[1] )
print( "Y: ", origin[2] )
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Intuitive Rolling Combat Rules [WIP] DuskWolf 7 2,042 08-15-2010, 10:37 PM
Last Post: DuskWolf



Users browsing this thread: 1 Guest(s)