Click and Move targeting chain...

Posted By: Nomad

Click and Move targeting chain... - 04/05/09 07:32

RPG standard function of 'click and move' is not what I am after but a variation of it.

As the player points to a destination then clicks, a model is created to show the waypoint, path or node and the player model moves there.

What I have been unsuccessfully trying to create is a series or 'chain of click' created nodes that the player object moves to one at a time, node 1 first, then 2nd and so on.

I will get it eventually but its going to take me a little while.
So..........

Help would certainly be the request here, has anyone a script or methodology I could use to get there faster?
Posted By: lostclimate

Re: Click and Move targeting chain... - 04/05/09 16:14

just make an array and fill the array with different positions that are in the chain.
Posted By: Nomad

Re: Click and Move targeting chain... - 04/05/09 19:21

Thanks but I dont know how to do that so could you give a small example here please?
Posted By: lostclimate

Re: Click and Move targeting chain... - 04/05/09 20:30

http://www.conitec.net/beta/aarray.htm

check out arrays there.
Posted By: Nomad

Re: Click and Move targeting chain... - 04/06/09 08:05

Thanks...
Posted By: lostclimate

Re: Click and Move targeting chain... - 04/06/09 15:59

np, if you need help understanding how arrays work you can google it and there is tons of info out there on how to manipulate arrays.
Posted By: Nomad

Re: Click and Move targeting chain... - 04/06/09 19:28

Thanks for the help but its all too much info, anyone got a commented working exmple I could learn from?
I've gone over AUM's scripts and while arrays work well, I cant seem to understand the basis and process to write my own.
Posted By: lostclimate

Re: Click and Move targeting chain... - 04/07/09 01:46

well the basic theory is this

000000000
123456789

lets say each of those are values in the array and 0 is empty

so you put a new position, lets say 1 in the array

100000000
123456789

so you go through the array and make the first one in the row a 1 and then they click again, so you get to point 2

120000000
123456789

now you have 2 pts in the array. now lets say your character gets to pt 1, you remove it from the array

020000000
123456789

and then go thru each of the values and move it up one more slot so that they are next in line

200000000
123456789

that way they will go to point 2 next.


That is just one way to do it, but if you practice with arrays you will learn several ways to do it. You might want to google things such as stack's, deque's, queues, bubble searches and binary searches. They are all programming techniques for manipulating an array.


now you click some where else in the array
Posted By: DLively

Re: Click and Move targeting chain... - 04/07/09 03:08

in other words, hes trying to get you to do this:

array clickarray[500];// allows you to click up to 500 times before it cant store anymore

when you click, it will store your first co-ordinates xyz(134,543,0) in the first slot.
when you click again, your next set of xyz will be put it into the second slot, until the first point is reached, then its erased; and player goes for the second set of numbers(which becomes the first set of numbers now)


if you clicked 3 times before you reach destination 1, your array will store 3 sets of xyz... make sense?


Visual image...

clickarray[500]
//New array made, looks like this:
0,0,0,0,0,0,0,0,0,0,0,0,0....500 times

click once, it looks like:
(134,543,0),0,0,0,0,0,0,0,0,0,0,0...

and if you click again before you get to target one:
(134,543,0),(265,789,0),0,0,0,0,0,0,0,0,0...

and if you reach target one, and click again, like this:
(265,789,0),(325,762,0),0,0,0,0,0,0,0,0...

so you can click up to 500 times until it cant store the last number...



I dont know how to delete the numbers in array slot 1, without deleting the whole array tho...


Good luck.




Posted By: Nomad

Re: Click and Move targeting chain... - 04/07/09 04:17

Thank you so much both of you, Glimmers of understanding are tantilisingly nearing comprehension.
I know I'll have to sleep with these before I understand completly but already excited by the glimmers given here.
Again, thanks to you both, appreciated.
© 2024 lite-C Forums