Scripts / Few questions .

Author
Message
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 3rd Mar 2016 18:00
I know what am about to ask is some where scattered here in the forums but please bare with me almost my first chapter of this game is completed as a map design and level.. just some events left i need scripts for them to happen..

i hope i don't bother any one here but here is what i want. i know this isn't a request script thread .. but if it's possible to help me that would be nice .

1- I need a script when the player enter a trigger zone the (X) npc spawns dead instantly like the npc spawns normaly but then dies . i tried to excute this by my self but ended up for 2 hours with errors.

2- i want when approach a certain NPC to get prompted with press E to talk to (X) when i talk a simple text appears i just want 3 phrases i don't want any thing complicated, i tryed Small GG notesprite but it makes my game crash with error 501
i tried to combine things like If GetPlayerDistance < 100
Prompt "Press E to talk"
but i then realized .. i don't know how to say make text appear , or how to even start my script so i ended up asking for this too.

3- If it's possible upon entering a certain Place or picking a certain object a few enemies spawn.

4- a question about sounds, where do people get all those different sounds, Like jumpscares (scream) , Scary music..
I don't know where is the source cause i need few screams for jumpscares.

5- Also how can i make a certain music playing with another.
Ex : the player spawned so the whole level is now running ( Scary music) which is like a church or something .. and while the player is walking he stepped on music zone which sets on a( record) of some one speaking .. like omg this place sucks .. how do i make those two work with out stopping the scary music with the record.

6- Last thing how do i make same request as 2 but for objects .. where the player go to object and presses E near a chair and gets ( That is a chair *Press E to close)

i hope i don't ask for much and i really sorry if i bother any one but i really hit a wall while working on the game and my experience in lua is dead .. am trying to improve it .. i memorized alot of variables and commands .. but really have no idea how to put them all together in one page. so am learning from the provided scripts from you guys and the game.. but having a hard time.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 3rd Mar 2016 23:45
function chat_init(e)
end
function chat_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 then
Prompt ("Press E to talk")
if g_KeyPressE == 1 then
Prompt ("We missed you.")
end
end
end

MY FIRST SCRIPT
and it's working i wanted it for my request number 2.. but it keeps repeating Press E .. although i pressed it and got the text,it keep repeating over and over again.

and i wanted more advanced text type of this .. but i just wanted to show u guys my progress with lua
PM
Isagabe
10
Years of Service
User Offline
Joined: 12th Sep 2014
Location:
Posted: 4th Mar 2016 05:13
most of what you are looking for is already available in downloadable scripts or to copy/paste into note pad. Get them here.

https://forum.game-guru.com/thread/207801

You will also find stuff you did not know you needed or even thought possible. Requires some reading though.
in fact the whole script section of this forum is a trove of knowledge. I am not a coder myself but the basic stuff certainly becomes a lot easier. And if you ask for something more complex, someone here, like smallg (one of many) will come to your assistance.

As for audio - numerous sources around but the store has lots of sounds - fx - music - ambient etc.
Back to the forum, in free models and media, you will find classy music from Tarkus1971. In this section you will find great free media and models you never knew you needed. As for changing sounds - there is a basic sound tutorial in guru docs (search your program folder) but more recently there was a very good twitch broadcast.

These broadcasts - all available on you-tube will answer many questions and even teach you how to make a survival game from scratch if that is your thing. https://www.youtube.com/channel/UC1q1e3Q9IKMk4nDlAGb_5Jg

This should keep you busy for a while. Good luck.

RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 09:04
Thank you i already checked SmallG forum it's a legendary forum indeed with everything i could have hoped for
but my number 1,2,6 i don't find them in his forum i searched already not as i want them to be they are not complex .. but i still don't find them.
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Mar 2016 11:43 Edited at: 4th Mar 2016 13:51
For number 1 you don't need a script. Watch this video and learn


Number 2, there's dozens of scripts for that, and three or four in the smallg thread.

This is one of them:

Save it as story.lua




Number 6, do you mean something like this? https://en.tgcstore.net/product/23424

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:27
1 got it thank's.
2 i still don't find it .. >.<
I want something like in the Killquest.lua
https://www.youtube.com/watch?v=NqDR6PEXpEk
but with out the actual quest just the text that appears.
3 got it too thank's
4 got it too
5 got it too
6 i messed with note ++ till i have created my own script for first time with objects .. thank's
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:31
iam also wondering about how to make a script abit more complicated like the following
If playerdist < 100
( here i want to say And g_keypressE = 0) then
Prompt ("Die")
what variable represents and ? cause else don't fit in.
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Mar 2016 12:39 Edited at: 4th Mar 2016 12:41
Quote: "2 i still don't find it .. >.<"


How can you not find it? I wrote it right here in my reply, a whole script script, just click the code tag.

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Mar 2016 12:42
i made a simple to use object interaction code for you
https://forum.game-guru.com/thread/207801?page=13#msg2543299
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:47
Quote: "How can you not find it? I wrote it right here in my reply, a whole script script, just click the code tag."

now am really stupid .. sorry didnt see it... my fault. Thanks

i made a simple to use object interaction code for you
https://forum.game-guru.com/thread/207801?page=13#msg2543299
Thank youuuuuu
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:55
beliods there is an error with ur script it's something in player distance.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:57
fixed it .. it shouldn't be GetPlayerDist .. supposed to be GetPlayerDistance xD that's all .. now am fixing the texture spot cause it's far off the right haha
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 12:59
can you please help me fix text spot cause xD i just messed it up .. the text (Hello) is not even here it's on the max right what do i fix to make it in the middle of the screen
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 4th Mar 2016 13:20
Quote: "i made a simple to use object interaction code for you
https://forum.game-guru.com/thread/207801?page=13#msg2543299"

Can you please tell me how do i spawn a dead NPC ? Like once i trigger the Npc to spawn it spawns with 0 Health and dies.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Mar 2016 13:44 Edited at: 4th Mar 2016 13:51
change the numbers to move the text
TextCenterOnX(x,y,size,"str")


see attachment for dead on spawn script, i assume you already know how to spawn entities with zones by now?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Mar 2016 13:54
Quote: "Can you please tell me how do i spawn a dead NPC ? Like once i trigger the Npc to spawn it spawns with 0 Health and dies."


https://forum.game-guru.com/thread/208737

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.

Login to post a reply

Server time is: 2024-12-22 13:36:40
Your offset time is: 2024-12-22 13:36:40