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
Joanna
19
Years of Service
User Offline
Joined: 31st May 2005
Location:
Posted: 31st May 2005 19:05
Hello everyone!

I know that you have to assign numbers to objects when you create them, but this doesn't seem a very good method. How do you manage lots of objects using just numbers? Do you use types with ids or random numbers or counters or what? I guess assigning numbers is okay if you know how many objects you need when you starting writing your program, but what if you don't?

Very confused!

Joanna.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st May 2005 20:58
types with uid nums helps and types with uid nums and object buffer num can helpa also.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 31st May 2005 21:20
Ahh crapsticks indi's caught a newbie dissorder

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st May 2005 22:09
Numbers are easier to use for beginners.

By the time you need a more flexible dynamic approach to object creation, you can very easily implement it yourself on top of the numbering system.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 31st May 2005 23:36
Quote: "how do you manage lots of objects using just numbers?"

Strangly enough it comes quite easily. Aslong as you start with simple little projects when you make bigger projects you have got the hang of using objects very fluently.
In large games its often wise to plan out what numbers will do what.
In my game currently:
1 is the terrain
2 is the character
3 is his gun
10-300 is items you can pickup
etc
etc

Basically as IanM says, by the time you need a more advance system youll know how to go about creating one.
In my project i made a system for images and sounds and such where you call them by name rather than number...its not perfect but i did post it up.
http://forum.thegamecreators.com/?m=forum_view&t=54055&b=6
But obviously for small projects its not neccesary.

James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 1st Jun 2005 03:39
When creating small projects you will only use a small amount of objects, if you were to rem a reference above each make or load command this should be sufficent:



Once you go onto creating more objects and get used to the numbers you can either:
Do what Baggers said and create a default in your head (i.e. 1 = terrain, 2 = player) this however can limit you as if you want 2 terrains your method is slightly messed up.
Learn UDT (user define types)
Or more simply learn about globals:



James

Hello!
Joanna
19
Years of Service
User Offline
Joined: 31st May 2005
Location:
Posted: 1st Jun 2005 06:03
Thanks for the replies everyone. Interesting infomation. I think I see how it works.
But anyway, as you were all implying, I'm not quite at that stage yet....but good to have that info on-hand.

Thank you!

Joanna.

Login to post a reply

Server time is: 2024-09-23 21:24:58
Your offset time is: 2024-09-23 21:24:58