[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4771: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4773: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4774: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4775: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
Skyline Forums • View topic - getting started in LUA for Skyline
Help with your scripting

getting started in LUA for Skyline

getting started in LUA for Skyline

Postby AuShadow » 22 Oct 2015, 07:16

Hey guys, Just wanted to start making some basic scripts but am basically full blown noob in this area, what i want to do is

1. check player distance to object
2. if player is within said distance allow an action to happen if a key is pressed, sort of as follows with script attached to a tree

starting variable of each tree would be 5 on starting

if PlayerDistance <50 then
if KeyPressE =1 then
wood = wood + 1
tree = tree - 1
end
else
end
else
end


if tree == 0 then
destroy(tree) -- the one that the script is attached to and not all trees
else
end


any help appreciated, just thinking along the lines of a survival game where you collect resources, cheers
User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative

Re: getting started in LUA for Skyline

Postby epsilonion » 22 Oct 2015, 10:58

Using rays to check distance, I have done something like this before by adding a trigger to a tree and if the distance is less then ten then press e to chop down tree. This plays an animation then gets the position of the tree deletes the model and places a model of a log with a pick up script so when the player presses e on the log it gets placed in the inventory and delete the log model or a timer runs out and deletes the model..

I am on my phone at the moment so will look at this later for you..
Skyline Help:

User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: getting started in LUA for Skyline

Postby ant0N » 22 Oct 2015, 15:16

Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: getting started in LUA for Skyline

Postby SolarPortal » 22 Oct 2015, 16:29

Thanks for responding guys, i didn't respond on purpose to see if the community would bring a script up and you did :) Very happy :D



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby epsilonion » 22 Oct 2015, 19:15

been busy all day still have not had chance to do anything but I will soon.. :)
Skyline Help:

User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: getting started in LUA for Skyline

Postby epsilonion » 23 Oct 2015, 00:33

Not having much look here, couldnt get raycast working (first attempt with skyline), tried the AI sensor thing and it couldnt see the Player when it entered the dome..

Completely lost now, heads exploding and tired...
Skyline Help:

User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: getting started in LUA for Skyline

Postby AuShadow » 23 Oct 2015, 00:40

thanks all, better rest that head Liam i know the feeling of about to explode, had so much going before during and since the wedding im still waiting for everything to calm down a bit around here :), thanks for all the help I am going to start playing around with that one now ant0N cheers.

another quick question, just want to know how to display a prompt on the screen with the value of the variable, just so i can see things working, thanks again
User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative

Re: getting started in LUA for Skyline

Postby epsilonion » 23 Oct 2015, 00:45

Skyline Help:

User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: getting started in LUA for Skyline

Postby CreativeOcclusion » 23 Oct 2015, 08:43

Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: getting started in LUA for Skyline

Postby ant0N » 23 Oct 2015, 11:04

Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: getting started in LUA for Skyline

Postby SolarPortal » 23 Oct 2015, 13:05




Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby AuShadow » 23 Oct 2015, 15:33

Thanks guys will have a crack at this Monday, got family duties for the weekend :), young fella walking already so keeps me busy :)
User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative

Re: getting started in LUA for Skyline

Postby SolarPortal » 23 Oct 2015, 19:05

:)



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby AuShadow » 24 Oct 2015, 04:21

User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative

Re: getting started in LUA for Skyline

Postby Shando » 24 Oct 2015, 05:25

Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby SolarPortal » 24 Oct 2015, 10:38

Instead of raycast or distance check, you could use an AI Sensor or triggerbox as well. Then an AI could harvest the tree aswell :)

It all sounds like it is starting to get where you want now :)



Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby AuShadow » 26 Oct 2015, 01:46

User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative

Re: getting started in LUA for Skyline

Postby SolarPortal » 26 Oct 2015, 02:21




Twitter:
Instagram:
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: getting started in LUA for Skyline

Postby AuShadow » 26 Oct 2015, 02:26

yes, that works perfectly, thank you very much for this, now to play with it some more :P
User avatar
AuShadow
Skyline Ensen
 
Posts: 129
Joined: 17 Feb 2015, 11:18
Skill: Great creative


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 6 guests