Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
fatbiffa
22
Years of Service
User Offline
Joined: 15th Jan 2003
Location:
Posted: 12th Feb 2003 21:47
I'm using an array to store a list of current objects in my game - this is added to (player drops an item) and taken from (player picks up an item).

type ob ox oy oz otype endtype
dim objects() as ob

but using

array insert at bottom objects()

seems to corrupt the previous slot? any clues?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Feb 2003 22:02
Yes, it has been mention before on the other forums...
I prefer to use my LinkList plug-in myself...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Feb 2003 00:24
i wouldn't use that... but outline the Max objects from the get go - not to make it easier, but if you give the user unlimited items then this means they can have upto around 4.5 billion

should set this up with something sensible, remember that a value unused is 0 and takes up nothing

so like;

type weapon_t
arrow as boolean
bullet as boolean
grenade as boolean
endtype

type food_t
bread as boolean
apple as boolean
coke as boolean
endtype

type magic_t
fire as boolean
water as boolean
wind as boolean
endtype

type item_t
weapon as weapon_t
food as food_t
magic as magic_t
endtype

dim gPlayer(256) as item_t
load array cType(255)

then you check like

for index = 0 to 255
if gPlayer(256).weapon.cType(index) = 0
item = "nothing"
else
item = cType(index)
endif
next index

etc...
etc...

you just store the names within an array for what you want and hey presto
that might be right ... lol i honestly can't remember

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2025-05-18 13:42:53
Your offset time is: 2025-05-18 13:42:53