Help with your scripting

File editable property

File editable property

Postby SpiderMack » 29 Sep 2017, 17:57

Hi,

Actually we canhave editable properties for scripts

Code: Select all
--[[Prop|float]]   Run_Timeout       = 1000   


Would it be possible to make it editable for files path and name (sounds, images, text) ?

For example instead of having that code :
Code: Select all
audioFile_Footstep   = "Footstep_Grass_00.ogg";

It would be this code
Code: Select all
--[[Prop|file]]   audioFile_Footstep          = ""

This would display a little button that user can click to open explorer and choose some file, like Unity can do for example :
Image

It's not very important , but i think having this later will be very helpfull as this will decrease the amount of coding and allow to quickly edit and change files names used by a script (sound, images, text), or to customize some entity to use different sounds or texture images or effects.
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: File editable property

Postby StarFire » 29 Sep 2017, 18:07

As it is just a string containing the name of the file generally you would quickly type in the name but sure if you dont know and want to browse for a file then a file option would be great...

it can be done --[[Prop|file#*.ogg]] audioFile_Footstep = "Footstep_Grass_00"
the qualifier #*.ogg can be omitted for showing "All Files" ;)
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: File editable property

Postby SpiderMack » 29 Sep 2017, 18:13

it can be done --[[Prop|file#*.ogg]] audioFile_Footstep = "Footstep_Grass_00"

It's easy to do this way.

Indeed have some pop up explorer and pick up some file in Asset directory and you don't have to write all file names anymore :)
(i forget this is usefull to pick up animations files also)
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron