Need ideas to spawn player in a random position..

For info on the site, community and 'battlefieldy' things
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Need ideas to spawn player in a random position..

Post by fo0k »

Imagine a deathmatch scenario.. I want a huge map and for all players to spawn at random anywhere on it. (You might even spawn on top of a player on the opposing side right from the beginning.)

Needs to be totally random each time.

I need a 'SPAWN DEVICE'!

Ideas welcome!
User avatar
mikex222
Posts: 211
Joined: Mon Mar 08, 2010 11:47 pm

Re: Need ideas to spawn player in a random position..

Post by mikex222 »

you could have like a air vehicle that fly's around but is a spawn point... or even a land vehicle. but the location wouldn't be that randomized would it.
this would be csm as far as I'm concerned.
you could make the vehicles spawn invisible and have no sounds what so ever, so you randomly spawn by something invisible.
make the engines on the vehicle real fast and not just go straight forward, make them turn.

ugh! I know this is a stupid idea.

I forgot what they were called lols, scenery vehicles or something rather
:D hope this helps with ideas a little...
Image
Join Me At The West
You're Welcome To Join My Town Any Time, This Is Just a Internet Game. Nothing More.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Need ideas to spawn player in a random position..

Post by fo0k »

almost needs a big box above (actually.. below the terrain then they land on terrain straight away) the map.. invisible.. with a kinda super glitchy object inside just glitching around it super fast... whilst dropping soldiers :O

yeah will need to be some kinda vehicle i guess.
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Need ideas to spawn player in a random position..

Post by Poow »

Is it possible to attach a rotational bundle to a rotational bundle?

If yes: You could try to cross two bundles to something like this:
(other proportions etc)

Image

With some vehicle spawns like this you may get a pseudo random spawn thing.. object.. situation.. argument..stuff... gadget
:lol:
You’re entering a world of pain!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Need ideas to spawn player in a random position..

Post by fo0k »

actually.. that kinda thing.. multiple rotation bundles is possible and would throw up some random stuff :)
User avatar
mikex222
Posts: 211
Joined: Mon Mar 08, 2010 11:47 pm

Re: Need ideas to spawn player in a random position..

Post by mikex222 »

well i could try make a super glitchy object... like a new standardmesh.
Ive made a tower in the past. the tower had like 2 thin walls and you could squeeze through them and spit out at top some where... depending wot angle u ran into them... depends where at top u end up

i could just make like a big mess and try make it spit u....
oh oh.... i think i no how to make you teleport now...
ima go start another project now!!! =D
Image
Join Me At The West
You're Welcome To Join My Town Any Time, This Is Just a Internet Game. Nothing More.
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: Need ideas to spawn player in a random position..

Post by Jeronimo »

fo0k wrote:multiple rotation bundles is possible and would throw up some random stuff
The problem will be the little white spawn point selection knob (LWSPSK) on the screen that you see when you first arrive on the server or after you died. The position of it is calculated as the average of all soldier spawns that belong to its spawn group id. So to avoid the LWSPSK from shaking all over while the rotational bundles do what they do best - rotating :D - you'd somehow have to make sure that their average coordinates are always at the same place. Needs a little maths and tinkering, but it should be possible. Then put that crazy thing up high in the sky where it can't be seen and setPosition the spawners down back to the ground. Maybe even further under the ground, since this will always put the spawning soldiers back to ground level, independent on if he's been put on a hill or into a valley. Dunno what will happen if there's buildings at that place, though.
Anyway, nice ideas and theories :mrgreen:
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Need ideas to spawn player in a random position..

Post by Apache Thunder »

Has anyone attempted to have spawns associated with effect bundles? The benefit of using emitters is you can give them a range of position to spawn stuff in and it will be much closer to random them some complex rotation thing. :P

Have the effect spawn a PCO with a spawn point on it. The PCO last maybe 5 seconds at the most and the effect emitter spawns the PCO again at a new position in a completely new place. With the right settings it can essentially spawn anywhere on the map. ;) (set emitter intensity at 1 and timeToLive at 5 to match the lifespan of your new PCO. Increase intensity if you wish to spawn more then one PCO at a time. Adjust TimeToLive to match the lifespan of your PCO)

If your emitter is going to be set to emit PCOs, be sure to try adding this command to the emitter:

Code: Select all

ObjectTemplate.isSpawnEffect 1
Be sure the lod range set for the emitter is pretty high. Have it set to 2048 for 512 size maps for example. This assures the effect always activates. ;)

For emitters these commands should be used as follows: (512 sized map as an example)

Code: Select all

rem *** North/South Axis (front/back)***
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/512/0

rem *** Vertical Axis (up/down)***
ObjectTemplate.relativePositionInUp CRD_UNIFORM/0/512/0

rem *** East/West Axis (left/right)***
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0/512/0
You can give CRD_RANDOM a try if the CRD_UNIFORM function isn't random enough for you. ;)


Then set the rest of the effect bundle up and attach it to a bundle and place it on the map at 0/0/0 position. Make an effect bundle for each team and hopefully this should work out for you. :D
ImageImageImage
I have cameras in your head!
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

not sure this is the same thing but its in the game already and it doesnt work very good, it only works if you host from your game then you can see the raft spawn but as soon it goes into a server it dissapears

Code: Select all

ObjectTemplate.create PlayerControlObject Elco80
- lotsa code and then this line:
ObjectTemplate.addArmorEffect -1 e_PTBoatWreck 0/1.4/12.4

Code: Select all

rem *** e_PTBoatWreck ***
ObjectTemplate.create EffectBundle e_PTBoatWreck
ObjectTemplate.saveInSeparateFile 1
rem -------------------------------------
ObjectTemplate.addTemplate Em_PTBoatSpawnRaft
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.timeToLive CRD_NONE/1.8/0/0
rem -------------------------------------


rem *** Em_PTBoatSpawnRaft ***
ObjectTemplate.create Emitter Em_PTBoatSpawnRaft
ObjectTemplate.template Elco80Raft
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 375
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_NONE/1/0/0
ObjectTemplate.relativePositionInDof CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInUp CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0/0
ObjectTemplate.startRotation CRD_UNIFORM/0/0/0
ObjectTemplate.movetowatersurface 0
ObjectTemplate.IsSpawnEffect 1
maybe its something wrong with it and its fixable?
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Need ideas to spawn player in a random position..

Post by Apache Thunder »

I've always found armor effects to be a bit unreliable in multiplayer. (also note wreck effects don't work very well if the timeToLiveAfterDeath for the host vehicle is set to 0 or close to it)

Perhaps the lod distance for that emitter wasn't set high enough?

As for spawning PCOs via armor effects. I found it most reliable to have the armor effect spawn a spawner that spawns the pco instead of using an effect bundle. (this is how my destructible bunkers/bridges wreck meshes are spawned) it works 100% of the time in multplayer. Just be sure to add the "ObjectTemplate.removeAtRestart 1" command so that the spawner is removed at round restart. Since the spawner isn't part of the pco that spawned it, it will remain on the map for the duration of the round. If you don't have it removed it will then respawn your PCO at round restart and you could have random PCOs spawning all over the place and you don't want that. :D
ImageImageImage
I have cameras in your head!
Post Reply