Scripts / [SOLVED] Need help for my house building script

Author
Message
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 11th Apr 2020 13:07
Hello everybody

At first: Thank you to smallg and all the other scripting gods in this forum - since I discovered game guru, last year I have learned so much about scripting through your scripts

I had an idea for a simple script: I love the house building part in games like Skyrim and I want to to similiar things in Game Guru
I have two scripts, the first one is called housebuilder_house.lua (it should be attached to an always active, non-static entity like a barrel):


the second one is called housebuilder_coin.lua (because my test item is a collectable coin)


it works well, but there is only one problem - when I spawn the house, there is no collision (an that is a problem for the effect, I want in my game)...could anyone give me a hint to solve this little problem?

I´m sorry for my bad English - I´m not a native speaker

greetings from Germany

The author of this post has marked a post as an answer.

Go to answer
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th Apr 2020 13:18
This post has been marked by the post author as the answer.
Attach the first script to the house entity.
Put:
Hide( e )
CollisionOff( e )

in the _init function.

Put:
Show( e )
CollisionOn( e )

in the _main function instead of the spawn part.
Been there, done that, got all the T-Shirts!
PM
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 11th Apr 2020 14:25
Thank you for your help and the quick response AmenMoses...I was too fixed on the Spawn(e) command - the solution was so easy

You are great!!!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 12th Apr 2020 05:28 Edited at: 3rd Apr 2021 05:06
....
oops, I think I posted wrong thread.
PM
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 12th Apr 2020 19:59
Hey GubbyBlips - this Idea with the animation sounds great...I haven´t thought about it but it´s a nice idea but it´ll need some kung-fu, which is better than my actual skills My plan was to build at first a simple shed and than "upgrade" to other models as the gameplay goes on...I´m working on a short demo-game but this will take time, because I´m working on two other, bigger projects at the moment...when I´m ready with the demo, I´ll publish it in the work in progress-section of the forum...Your idea is great and I should learn more about controlling animations via lua - I love this idea
PM
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 14th Apr 2020 22:02 Edited at: 14th Apr 2020 22:05
here is another idea to build
https://forum.game-guru.com/thread/221746#msg2629318
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 15th Apr 2020 00:41 Edited at: 15th Apr 2020 00:44
@PCS nice script - I´m very jealous^^ what exactly is the lua-command you´ve used in this script to scale up the model? I think it would be very useful to simulate growing plants, too

Edit: I should have read the whole thread, to answer the question - nice work, you did there
PM
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 15th Apr 2020 10:26
here is a link were i grow tree and flowers.
https://forum.game-guru.com/thread/221750#msg2629386
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 15th Apr 2020 21:02
Thank you PCS - your script looks amazing...well done - I think I´ll just play around with this
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2020 10:36
Yh you could just add some dust particles (the fog would work ok) and maybe even a standard construction animation to go around the outside (think building something in one of those mobile phone city building games) and it'll do the job just fine.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 16th Apr 2020 19:06
You could divide the house into several sections, and show each section when the player collects the necessary coins.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Duncan_Idaho
4
Years of Service
User Offline
Joined: 29th Jul 2019
Location:
Posted: 17th Apr 2020 20:13 Edited at: 3rd Apr 2021 03:41
Hey smallg - I love the idea, that wasn´t something i haven´t thought about...btw thank you for you scripts I´ve learned so much about lua mostly through your scripts

@3com that was something I had in mind

Unfortunately the development of my current game has stopped, because I have some problems with the zombie ai, which I can´t solve at the moment...It seems to me, that I have to start from scratch or I´ll have to begin a new project, so all ideas about house building features are theoretically...I should make more backups in future
PM

Login to post a reply

Server time is: 2024-04-18 04:54:56
Your offset time is: 2024-04-18 04:54:56