Objects spawning ?

Posted By: Gino_Fabrizio

Objects spawning ? - 07/29/13 13:34

Hi there, its me again tongue
In the proccess of making my FPS game of zombies, I have a trouble , a big one frown
I make the map using "small.hmp", and then I spawn manually tree models on the sides for the player dont leave the map, and I also load the level endless to make it better.
Then I spawn trees and grassess for the map using "ent_terrain_place", to spawn it randomly. The idea is to make a "cementery", Im using all dark possible. The problem is that I make the player to search a pistol to use, but when I spawn the pistol with "ent_terrain_place", it get bad... sometimes it spawn inside a tree, or in a tree of the side that is blocking the player to leave the cementery, so he cant pick up the pistol frown for pick up, I make an action that checks the player dist to be <= 70 and he have to press the "E" key to pick up. So I want to know a way to spawn the pistol far from trees, if there is any way, thanks you laugh
Posted By: rayp

Re: Objects spawning ? - 07/29/13 13:42

Use a seed map. To avoid spawning trees in the gun, use another color where u want to put the gun. I would trace to look if the position is free for the gun ( or a c_scan ). Also i would use ent_create for the gun.

greets
Posted By: Gino_Fabrizio

Re: Objects spawning ? - 07/29/13 13:54

Thanks for replying laugh

What do you mean with "seed map"?
Posted By: rayp

Re: Objects spawning ? - 07/29/13 14:37

http://www.conitec.net/manual_d/level_c.htm
Quote:
ent_seed (char* name, ENTITY* terrain, BMAP* mask, COLOR* color, var dist, var mode, EVENT act): var


greets
Posted By: Ch40zzC0d3r

Re: Objects spawning ? - 07/29/13 14:46

well simply do a c_trace from the gun to the ground and see if you hit a tree or the map, in my eyes much more simple laugh
Posted By: rayp

Re: Objects spawning ? - 07/29/13 14:56

As i said above.
Quote:
I would trace to look if the position is free for the gun ( or a c_scan ). Also i would use ent_create for the gun.
But placing vegetation without seed map CANT be good btw.
Posted By: CanadianDavid

Re: Objects spawning ? - 08/01/13 12:05

As mentioned above, see:
c_scan
c_trace

And also maybe:
vec_dist

Another possibility is to randomly spawn the pistol at the same time one of trees is spawned at a position beside the tree. Use a global variable to store whether or not the pistol has been spawned yet or not so that you do not spawn more pistols.
© 2024 lite-C Forums