Posted By
|
Message
|
Ecstazy
Registered 04/01/2002
Points 179
|
4th September, 2005 at 17:47:09 -
I'm having messy results trying to do this RPG-like turns rotation. The rotation isn't the same all the time, the player is added to the queue when a counter reaches its maximum.
Any tips on how to approach this thing?
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
|
..:.Phox.:..
Registered 18/02/2005
Points 646
|
5th September, 2005 at 15:44:53 -
There's an article about it. Try searching, if you find it tell me.
I'll look for it. But if you find first tell me.
Profile edited as it messed the layout of the site up.
|
Fifth Quadruped
Registered 07/05/2003
Points 5818
|
5th September, 2005 at 15:50:12 -
Well, you could use a list object for the queue. Whenever you add a turn, you just add a line to the end. Then you can compare the first line to see whose turn it is, and delete that line when it's passed.
Go Moon!
|
DeadmanDines Best Article Writer
Registered 27/04/2006
Points 4758
|
5th September, 2005 at 16:56:42 -
<winces at the forbidden words>
191 / 9999 * 7 + 191 * 7
|
Fifth Quadruped
Registered 07/05/2003
Points 5818
|
5th September, 2005 at 17:23:07 -
What?
You don't like list objects?
Go Moon!
|
Fifth Quadruped
Registered 07/05/2003
Points 5818
|
6th September, 2005 at 02:45:32 -
Ah, okay.
I was afraid I'd stumbled across some sorta programming taboo.
...Although I guess you could use a string just as well...
Go Moon!
|
Ecstazy
Registered 04/01/2002
Points 179
|
12th September, 2005 at 12:37:20 -
Hmm, I can't seem to find a listbox object in TGF...
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
|
Dave Matthew (Jester Gaming)
Registered 09/07/2004
Points 148
|
12th September, 2005 at 13:22:03 -
a String is a list anyway
n/a
|
David Newton (DavidN) Invisible
Registered 27/10/2002
Points 8322
|
13th September, 2005 at 06:02:36 -
That's an idea - add a character to the end of a text object's alterable string with ([Existing string] + [new character]) to form a list of characters, and take a character off the beginning each time a turn passes (read Left$(String, 1) then set it to (Right$(String, Lengthofthestring - 1): in that way you'll get a queue effect.
http://www.davidn.co.nr - Games, music, living in America
|
Ecstazy
Registered 04/01/2002
Points 179
|
13th September, 2005 at 07:09:54 -
Hmm nice, I actually thought about it this way, but I then thought it would be great only in real programming and assumed strings don't have that much power in TGF/MMF.
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
|
Dave Matthew (Jester Gaming)
Registered 09/07/2004
Points 148
|
13th September, 2005 at 11:53:04 -
I don't think it is good in "real" programming as string-operations consume quite much "power", compared to other solutions
n/a
|
Ecstazy
Registered 04/01/2002
Points 179
|
13th September, 2005 at 12:02:40 -
Well, in real programming I instinctivly thought of making a train of "memory pockets" with the order, and whenever the first turn is used, delete it and free a tiny bit of memory.
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
|
Dave Matthew (Jester Gaming)
Registered 09/07/2004
Points 148
|
13th September, 2005 at 12:21:40 -
yep thats right. but (I think) strings are represented as arrays of character which could be good if it never changes size and you need to index each entry in the array. however, we don't as we always will look at the first object in the queue and the queue will grow and shrink all the time. of coarse, this can be done with a String in MMF to, but it will eventually take up too much memory after a while. I'm not sure, but the experience I have from other programming languages, string operations are generally slow.
n/a
|
Ecstazy
Registered 04/01/2002
Points 179
|
14th September, 2005 at 14:57:17 -
Actually the string's size will nearly always be the number of battling entities, no?
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
|
|
|