Scripts / Quick help if possible please :)

Author
Message
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 21:35
Iam making a demo game to learn more in lua and increase my skill with this engine.
I just want to know how to do 4 things.
1-On the start of the game i wanna make the Player receive a message saying whether in a text or a note .. Just that this place is dangerous like in the demo the big escape.


2- I want to know how to make the player Speak to a certain NPC.. When the player Does the NPC asks him to Kill a certain person, Upon pressing Accept .. that person spawns and Upon killing him a portal Spawns or just a door opens .. w/e is the easiest to pull off .. and the player can go through it.

3-Explosive traps ? like Grass that explodes i want to make alot of things explode, fake doors , instant death.

4- I want to make any NPC just target my player Just one NPC .. That spawns upon player pressing a trigger .. That NPC moves so fast and so hostile to the player only and only chases the player and upon hitting the player it does 1 hit.
I can do the damage , HP , Speed part .. but the Ai for chasing the player and spawning at certain part i don't know how.

5- i want the player to be like a detective .. Like to be able to press E on every thing and when he does he receive a text explains what this is ( Like i write a script on each object , NPC) But what do i write i don't know.

6- how to spawn waves of enemies and upon killing them the player moves to the next level, and how to make NPC follow him like a pet.

7- and last thing Like cartoon antics , i want the player to collect few coins and upon collecting them he finishes the level or just a door Appears to the next level .

I would really appreciate the instructions cause most of them are quit similar as i suppose in script idk i have no knowledge at all so i really appreciate any help .
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 21:45
I know i said 4 .. but i wrote 7 ... am sorry i suck at math from the start
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 19th Feb 2016 22:52 Edited at: 19th Feb 2016 22:53
Quote: "Iam making a demo game to learn more in lua and increase my skill with this engine."

Ok, now I have a problem, because the best learning stategy for any programming language like Lua is "learning by doing" yourself. So it would be the best if you try it yourself with small looks into the standart scripts in the scriptbank. It is hard at the very beginning, but this is how you should do it.
In the second post is a first introduction into Lua from myself:
https://forum.game-guru.com/thread/211236

So now to your questions:
1) go into scriptbank\stories\The Big Escape and open startdisplay.lua. There is all you must know. Load a picture and so on.
2) This is something you must decide how you do it. With mouse, without mouse and just with keys.
Simplest way is to do it with prompt("Text"), Timer commands, and scancode like Y(yes) N(No)
3) Go into entity properties and select explodabe=Yes and set the damage very high. Then in the scripts, create some conditions when it should explode. That´s it.
4) I do not understand what you mean.
5) You mean a random text generator? This would need a script for every entity. Of course you can read the name of the entity and then print it. This is maybe the best solution.
6) Waves spawn of enemies, there is anywhere a script. I can´t remeber. Mabye in smallg thread(link at the end). An character follow the player should be easy. RotateToPlayer, If player is more than 1 away, move.
7) Look at the scripts for the level. They are here: scriptbank\stories\Cartoon Antics

Hope this helps you a little bit.

Here is a great resource for scripts
https://forum.game-guru.com/thread/207801
Thanks smallg
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 23:18
Thank you .. but as you can see i have 0 to -100 Experience in lua .. i don't even know how to does the scripting start .. or like what the hell i should do or write or where or when or why .. so you sure about what you wrote above ?
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 23:25 Edited at: 19th Feb 2016 23:25
hmm
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 23:28
That link for lua is huge .. and the chapter one is like the boring basics i will never use ..
Type hello world .. I just don't know really this made me even more lost .. like where i will start in this 10 chapter guide.
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 19th Feb 2016 23:39
search for this in the search engine "some example scripts" smallg has written a shed load of scripts that might fit your bill
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 19th Feb 2016 23:49
Oh saw them. Thank you.. I think i can learn how did he write those from just looking at them i guess.
Thank's.

But i still don't know how to get a zombie to chase the player Upon Just spawning like player just spawned .. And zombie too how do i get that zombie to chase the player.
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 19th Feb 2016 23:56 Edited at: 19th Feb 2016 23:59
change the ai click the zombie choose properties and change the ai script to one of the ai ones sometimes takes alittle testing/playing around to get the effect you want I would check but I'm saving a standalone atm which takes about 45 mins you'll see the ai and GG will take you to the correct folder
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 20th Feb 2016 12:23
Okay i will check so thank you.
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Feb 2016 15:54 Edited at: 20th Feb 2016 16:25
Quote: "That link for lua is huge .. and the chapter one is like the boring basics i will never use ..
Type hello world .. I just don't know really this made me even more lost .. like where i will start in this 10 chapter guide."

Ok, I promise you without text command, you will never make a good script. Because this needs debugging. Textcommands to show variables are essential for every programmer.

Here are some tutorials from the developer, maybe this will help you:
https://forum.game-guru.com/thread/212794

Quote: "I think i can learn how did he write those from just looking at them i guess."

Maybe you understand what he did, but never how. He is a GG_Lua God (small joke)

Quote: "But i still don't know how to get a zombie to chase the player Upon Just spawning like player just spawned .. And zombie too how do i get that zombie to chase the player."

I will upload something. Maybe I need some time.

Edit:
Ok this is the part you must uncomment:

But the Zombie follows the player with AIEntityGoToPosition(EntObjNo,g_PlayerPosX+rndx2,g_PlayerPosZ+rndz2)
so there is a strange behavior. He always stop without a reason. I will ask around if I find a workaround.
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 20th Feb 2016 18:41
Thank you alot, And maybe if you got just few minutes tell me which chapters i should read in lua guide .. because i don't think every chapter is useful in game programming.
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Feb 2016 18:59
Can you tell me which lua guide?
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 20th Feb 2016 20:57
This one
http://www.lua.org/pil/1.html
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Feb 2016 22:06 Edited at: 20th Feb 2016 22:09
this is the best guide to get started with Lua in game guru
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 20th Feb 2016 23:07
I will check the guide right away thank you.
PM

Login to post a reply

Server time is: 2024-05-03 07:55:35
Your offset time is: 2024-05-03 07:55:35