dim3 Forum

Full Version: Scripting functions "library file"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It would be great to be able to define new functions that can be called from every script without having to redefine them everytime.
Like a functions.js in the scripts folder that contains useful functions that are needed in more than one script. (For example a function that displays an interface text for a certain time or a function that starts a cutscene.)
It would really help me and result in much cleaner scripts and a faster workflow. Smile
YES! I always wanted to do stuff like that but never thought about asking Smile.
We also need a way to call one script from another....
I vote YES! Smile This is something I always wanted to add, and I have a way to do it but it messes up error reporting. There's no "include" in javascript, so I'd need to do it by a substitution, which would mess up the line numbers.

I'll put some more work into this and figure out if there's a way around this.

[>] Brian
Oh heck yes!! Fantastic idea Bink!
This has been discussed several times before. The resolution that it was a "Good Idea" ™. someone link to the posts.
I thought it was mentioned before, but I wasn't sure, so I just made a new thread instead of searching for the old one for hours.

http://www.idevgames.com/dim3/showthread...7#pid26917
This is the "original" post, so all credit for that idea belongs to mafoo, because he was faster than me. Smile
Brian: Just make a note in the error when it uses one of those, that way you can tell if it's possible that it's in a different script.

It's messed up anyway!! When I fire a gun and the enemy has an error it says that the error is in the bullet script XD.
Would like to see this. This would be good for script learning and experimentation.
giantrock73
Reference URL's