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.

DarkBASIC Professional Discussion / Object Spawning and world creation

Author
Message
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 29th Jun 2011 06:16
Ok so using any of TGC tools, what would be the best way to do the following?

Spawn different items at the some location randomly?

Generally build a world. Like set up an environment then load in buildings and smaller objects and such?

For the 1st one, ive thought of just making items at given points and hiding them and then have a random assignment of the different other items spawn at those locations, referencing the location information of the hidden objects.

Then 2nd is more general and im not sure which tool is best for kind of visually constructing my worlds.

Thanks guys
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 29th Jun 2011 11:28


that would give you pretty random placement of your stuff.

you could always add more conditions to the placement criteria.

eg. is the area a...
town, forest, beach, desert?
does object suit environment?
are there too many already to bother with more?

its a very general problem your posing and there are a lot of ways you can handle it.

in short i personally would...
define the boundaries
define area types - define sub boundaries
determine necessary number of cloned objects
determine best location type of objects
randomly place object within area sub boundary

test program and check for anomalies
refine placement conditions
repeat until your getting what you want.

but again, many ways to skin a cat
thats the fun of it i guess...

programming, not skinning cats that is.

hope this helps
kezzla

Sometimes I like to use words out of contents
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 29th Jun 2011 16:08
Yea that helps. Thats one of things im still learning is the different ways to do something. I suppose i should stick to "get it working" first and then make it better.

also, i realize i misspoke or it might not have been 100% clear, though i imagine the answer im looking for is very close to the answer already given.

Im trying to make an apartment building with rooms that all have kitchens and, more specifically, refrigerators in each kitchen. Now the location of the fridge in each room will never change, but when the level loads, i want 1 of 5 different fridges to load. Would that be as simple as like putting each type of fridge into an array (or something) and then doing a "for" loop that just calls the different fridges based on however i store them?

I dont think what i am asking about is terribly difficult, i just have a hard time trying to reason through code to get what i want out of it.
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 30th Jun 2011 00:42
ok, now i get ya, yeah, option 1 sounds like the go.

kezzla

Sometimes I like to use words out of contents

Login to post a reply

Server time is: 2026-07-11 07:05:49
Your offset time is: 2026-07-11 07:05:49