Scripts / I can't finish this script.

Author
Message
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 22nd May 2016 15:51
I have a few scripts some i took from the forums and youtube from experienced people Like smallg
and some i tried to write my self .. and ended up horribly but i will post it still.

1- First script i tried to write my self was when you get close to a certain NPC it disappears. like just totally so from what i know i wrote that script will be attached below called (destroy) it gives me an error and ofc it don't function properly.

2- Second script is about i tried to make a similar script where the door requires you to collect 3 Objects .. once you collect those 3 objects the door automatically function or just opens i tried Kill quest similar but i couldnt transform it to what i want.

3- i was trying to make an npc chase the player like those slender game and slender games clone where a hostile Npc chases the player till he kills him, Or to be exact upon for example collecting the first page, The npc spawns , upon collecting second page or pressing a certain trigger area the npc detects the player position and starts chasing him. i couldnt find any way to use the commands and variables to create such script so if you guys could help me abit that would be nice.


My first game i created with the help of almost 12 members but i didn't spread it to public i made my friends play it .. but i felt icould do better so this time after am done with this game am putting it here for everyone to see their effort of helping me coming to use.

Also i reviewed this guide and it was helpful
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770
and Smallg scripts but haven't checked them since a while.

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd May 2016 16:36
needs to be:

if GetPlayerDistance (e) < distance then

You're missing the (e)

Been there, done that, got all the T-Shirts!
PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 22nd May 2016 17:20 Edited at: 22nd May 2016 17:23
I fixed it to that below
but instead i get error calling a global value (nil)

Am totally new to lua am using what i learned from the current scripts and that guide just ... that's why i can't figure out why those continous errors keeps appearing.

Attachments

Login to view attachments
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd May 2016 18:21 Edited at: 22nd May 2016 18:59
dont give up, just keep practising and you will get there, we all had to learn once

your script should look like this



killquest is an advanced script to be editing as a new user, you don't really need it to be that complicated for your requirement
i have created and commented the scripts for you, tested and working so hopefully they will set you on the right track

you need 1 script that will control the door but also check the 3 items are collected like so
door_with_requirement.lua


and then a script to apply to the 3 (or more) objects that will be collected to unlock/activate the door
door_requirement_item.lua
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: 22nd May 2016 18:27 Edited at: 22nd May 2016 18:50
Thank's smallg.
but can you help me with my second and third request in the post above when ever you have free time ?

Also ur script gives me the same error mine did look below !

Attachments

Login to view attachments
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd May 2016 19:00
ah sorry, yes, capital D in Destroy(e)
edited my post to correct it and answer your 2nd request
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: 22nd May 2016 19:01 Edited at: 22nd May 2016 19:04
1- if you do not want to destroy item, but just hide/show it distance based, this may help...




2-
a- Attach this script to the collectable item. IE: if you want collect some milk box, so attach script to milk box.



b - attach this script to the door.

-- attach this script to the door



About the number 3 I've not idea, since I'm not familiar with that sort of game, so I do not get right your point; maybe another user can help you.

Edit: smallg is a faster boy.
3com
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

PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 22nd May 2016 19:12
Quote: "ah sorry, yes, capital D in Destroy(e)
edited my post to correct it and answer your 2nd request"



Thank you so much bro for the help YOU NEED A HUG *Hugs* and when ever you feel about helping me with my hardest and last request in this post please feel free xD to start .




Quote: "About the number 3 I've not idea, since I'm not familiar with that sort of game, so I do not get right your point; maybe another user can help you.

Edit: smallg is a faster boy.
3com
"


LOL i appreciate the idea that you took time to help me just like smallg just thank you so so much you and him are really supprotive people thank's.
Also if you didn't understand my third request .. i want a hostile monster to chase the player like Slender games.. that's all.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd May 2016 19:16
dont know if it still works or not but there is an old slenderman script(s) i did here that might help
https://forum.game-guru.com/thread/212821
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: 22nd May 2016 19:31
@ RvD
You'r welcome.

3com
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

PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 22nd May 2016 21:15 Edited at: 22nd May 2016 21:16

A small assistance i have been giving this script before by smallg and i have been tweaking and playing in it .. but the text size is so small i tried to change the numbers but it changes the text position At X and Y, is there is any thing in this script that can make the letters abit bigger, am trying to figure out how to create this Chat box where it goes like
you press E when your distance is close to the npc which displays a box of text .. upon pressing E again it closes this box .. that's all.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd May 2016 21:51 Edited at: 22nd May 2016 21:52
Quote: "TextCenterOnX(x,y,size,"str")"

so change the '2' in TextCenterOnX(50,50,2... to 3 or 4 should be fine.
the scale is 1 ~ 5 with 1 being smallest and 5 being the largest

also that is not my script
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: 22nd May 2016 22:03
Quote: "
so change the '2' in TextCenterOnX(50,50,2... to 3 or 4 should be fine.
the scale is 1 ~ 5 with 1 being smallest and 5 being the largest

also that is not my script "

I noticed there is no smallg in the comment side of the script yes..
still thank you a lot.
who ever did the script thank's to you and him.
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 26th May 2016 07:23
Quote: "Do you know the script where it starts

function ### init
function ### main
If player press E
Display Image in folder ####
Something like this ?

And then you attach this script above to a paper in the game and when the player presses E it shows him an image or something written, what I want is to add That part to the script To the collectable_door script, Do you understand me now ?
So now the collectable_door script makes two actions, One it is the script for the items required for the door and two it also displays an image first from the image folder second it counts as +1 for the items required to open the door."


Well, let's see If I get your point right now.

Attach this script to your "note" item, make it dynamic. (refer to the video below)



This is a smallg's script modified by me, to fit yours needs.

Original here: https://forum.game-guru.com/thread/207801?page=9#msg2522535



3com

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

PM
RvD
8
Years of Service
User Offline
Joined: 17th Feb 2016
Location:
Posted: 8th Jun 2016 06:01
Quote: "
This is a smallg's script modified by me, to fit yours needs.

Original here: https://forum.game-guru.com/thread/207801?page=9#msg2522535"

First of all thank you so much i used it and it is wonderful thank you alot.

also a question


In that script above am trying to attach it to a note and it should load an image from folder named Notes with images called 000 and 001 etc.......

now the problem is i have like 5-6 Different notes in my map and i want 5-6 different images that comes with each note.
i tried renaming this note script to note 2, note 3, but it still Loads the first image .. i just can't set it to Load the image that in it's order for example


Note.lua = Loads 000
Note1.lua = Loads 001
note2.lua = Loads 002 , 003.
etc .. it doesn't work so why ?
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2016 09:47
The quickest solution is to rename the script as you tried and then create new folders to store each doors different images and finally update this line to reflect the relevant image folder
LoadImages("note",0)
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: 8th Jun 2016 18:42 Edited at: 8th Jun 2016 18:45
thank's i played with the script lines abit and it worked.
PM

Login to post a reply

Server time is: 2024-05-04 11:10:38
Your offset time is: 2024-05-04 11:10:38