did u use a logic brick for random number generation? r did u use a script of random generation. btw i never saw this tutorial i just listen to it while i was doing something else.
Thx for quick lessons! Im learning some scripting so I tried to make a city generator script for you. import bge import random def main(): cont = bge.logic.getCurrentController() spawnpt = cont.owner scene = bge.logic.getCurrentScene() # draw one of the city blocks rndCityblock = random.randint(1, 4) cityBlock = scene.addObject(str(rndCityblock), spawnpt, 0) main() Just add an Always sensor for the empty object and connect it to script controller with this code.
Foremost, thank you for this tutorial. It has been really helpful. Will this work if I model detailed buildings? Also would this same procedure work if I modeled cars?
SkyCrafting i think it would just need some bigger empty's and same size planes, or even better would be with some cubes, but any way you do it it would take you a long while. Good luck anyway
+John Hamilton yeah, it works. I set a property, like you did, and made a random from 1 to 10. if the property is 1-6, the object will always go forward, and 7-8, it will stop, by 9 turn left, and 10 turn right. thanks.
Would also be handy for randomly placing characters on a map!
Awesome tutorial!
Thanks 😃
I have a slight problem. Whenever i click play, the same randomness is generated every time. Any idea how to fit that?
SoMuchChili's script worked nicely, though!
did u use a logic brick for random number generation? r did u use a script of random generation. btw i never saw this tutorial i just listen to it while i was doing something else.
In my case I didn't use 0 as the start of the random actuator, intead I used 1, it solved my problem.
I wanna keep any of this random. How can i do?
Don't know made this a while back probably would have to implement some type of save load system :D
Thx for quick lessons! Im learning some scripting so I tried to make a city generator script for you.
import bge
import random
def main():
cont = bge.logic.getCurrentController()
spawnpt = cont.owner
scene = bge.logic.getCurrentScene()
# draw one of the city blocks
rndCityblock = random.randint(1, 4)
cityBlock = scene.addObject(str(rndCityblock), spawnpt, 0)
main()
Just add an Always sensor for the empty object and connect it to script controller with this code.
Can you do the same thing with polygons?..
Foremost, thank you for this tutorial. It has been really helpful. Will this work if I model detailed buildings? Also would this same procedure work if I modeled cars?
What if like we want to generate a terrain that looks like minecaft landscapes?
SkyCrafting i think it would just need some bigger empty's and same size planes, or even better would be with some cubes, but any way you do it it would take you a long while. Good luck anyway
I love that city
by this way, we could also make a randomly moving object, right?
+John Hamilton yeah, it works. I set a property, like you did, and made a random from 1 to 10. if the property is 1-6, the object will always go forward, and 7-8, it will stop, by 9 turn left, and 10 turn right. thanks.
@@TravelpalTV Cool thx
great job John!!
Thank you very much, this was a great tutorial!
Awesome!!!!! Great respect for author
I'm really annoyed that you can't make procedural geometry in the game engine....there has got to be a way around this D:
statikreg there is a way to edit a mesh in game. Take a look at the python API documentation. There's a lot of cool things in there.
wow this has soo many appplications!! OO
genius
I found DotOnTheCheek-2 × FirstArt Jerry Kuijper QWERTYVFX - THANKS FOR 1K SUBS :D Baloek Zerume
=o