Help with Scripts please

By chance could anyone help me please with the creation of a couple of scripts for I am trying to learn python but I am not really good at scripting or learning scripting so I am having hard time im more of a visual & arts person not a scripting guy T.T.

Oh and these will most likely be used many times as I make my blender games I am trying to ask for ones that could easily work for many projects than only one.

I will remove from the description the list and add the link to the script file in its place so that others can benefit off of your work also =) THANK YOU SO MUCH.

Mainly Need-

-Spawning- I can of course spawn the enemy with a empty however I couldnt spawn a group of them or something like that without them stacking and screwing up is their a way your could make a script so that they spawn same spot but they dont stack they just place next to each other if I spawn multiple ? and maybe a way to select how many are spawned, what enemy, and maybe a random between spots maybe so that I could spawn them randomly between several spots so it doesnt look like a perfect set pattern ?

-Smarter enemy- Is their a way to make the enemy move just a little smarter like to go around corners rather than get stuck on the walls and corners or something like that ?

not SO needed-

-Multiplayer- Is it possible to get a multiplayer working maybe by connecting to a certain ip address and having people join 1 single match were a player model in a diffrent layer and when player joins it spawns them at a random empty with the player model and using a camera connected to that player model ? maybe a hamachi server ip address or something ? or any ideas for this?

Spawning is easy(ish); Use a python script to place your objects. Also, don’t use an empty, use an invisible, non-collision enabled cube. Empties mess with added objects in my experience. For the code, do something like:



sce = logic.getCurrentScene()

# When you want to spawn something

sp = sce.addObject('spawnobject', obj)

sp.position.x += logic.getRandomFloat() * howfaroutyouwanttheobjectstospawnmax
sp.position.y += logic.getRandomFloat() * howfaroutyouwanttheobjectstospawnmax
sp.position.z += logic.getRandomFloat() * howfaroutyouwanttheobjectstospawnmax


You’ll have to check that position for a collision using the object’s rayCast function, though, as you still need to make sure that position is free for spawning; if it isn’t you would just do that script again.

For a smarter enemy, do a forum search, as you might want to do A* pathfinding if you have many walls and corridors in your level that the enemy needs to navigate around.

Multiplayer is covered; do a forum search - I don’t know really how to do it, and I don’t think it’s one of those ‘can you give me a script for it’ kinds of things.

is their by chance a way your could input the spawn script in a .blend by chance ? that way I could better understand it please ? I am going to try to do it as I can but that would really help, and thank you so much for helping me =)

and basically for the smarter enemy I found a few really complicated and hard to understand (implement) path finders I couldnt figure out. when I say "Is their a way to make the enemy move just a little smarter like to go around corners rather than get stuck on the walls and corners or something like that ? ", all I really need is a actor that knows when he is approuching a wall as he is chasing a player and will turn as needed to go around the wall or corner. Idk if that absolutely requires a pathgrid or what ever you call it XD.