Go Back   Savage 2: A Tortured Soul Forum > Savage 2 Modding > Documentation

Notices

Documentation Post useful tutorials and other informative material.

Reply
 
Thread Tools Display Modes
Old 12-31-2011, 04:43 AM   #1
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Grenade K2 Scripting Framework

About
The idea behind this project is to create an efficient and stable code pattern for the K2 script language. If you have already written a script for Savage 2, then you know that there are a lot coding pitfalls and annoyances. For instance, there are only 3 options to structure and organize your code: scripts, world triggers and labels. Another major downside is that you cannot create your own functions and that everything is non-object-oriented.

This is where the K2 framework comes to help by creating a code pattern which mimics basic features known from other scripting languages (eg. PHP) such as classes and methods. To achieve this, the framework consists of two components: the script compiler and the script modules. The compiler takes the code of all the modules and converts them into a single K2 script file so that it can be used in your Savage 2 map. Modules are essentially a number of scripts and variables, formed into a single class (upon compilation) within the framework script.

Links
Screenshot

Last edited by eaxs; 12-31-2011 at 04:49 AM.
eaxs is offline   Reply With Quote
The Following User Says Thank You to eaxs For This Useful Post:
meankitty2 (05-04-2013)
Old 12-31-2011, 02:31 PM   #2
Taawus
Area Moderator

Taawus's Avatar
 
Join Date: Dec 2008
Location: Above the behind you jokes.
Posts: 11,499
Thanks: 2
Thanked 714 Times in 572 Posts
Default

Me gusta.
__________________



FORUM GAMES
Taawus is offline   Reply With Quote
Old 12-31-2011, 02:31 PM   #3
Pidgeoni

Pidgeoni's Avatar
 
Join Date: Jul 2009
Posts: 1,734
Thanks: 185
Thanked 317 Times in 190 Posts
Default

That was a hell of a documentation! You are tempting me to rewrite some mods
Pidgeoni is offline   Reply With Quote
Old 12-31-2011, 03:46 PM   #4
Holleau

Holleau's Avatar
 
Join Date: Mar 2009
Posts: 46
Thanks: 5
Thanked 9 Times in 7 Posts
Default

Love it! I hope this framework can help me to rearrange the logical maze, what my script became lately.
__________________
There is always a workaround!
Holleau is offline   Reply With Quote
Old 01-01-2012, 05:26 AM   #5
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Default

I can't wait to see it in action, guys If you have any questions, just post them here. I'd rather not have any PM's about it because knowledge and experience should be shared with the rest of the community
eaxs is offline   Reply With Quote
Old 01-02-2012, 12:32 PM   #6
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Default

Hey again, sry for double post. I just updated the whole thing, please upgrade to the latest version by overwriting the files (your work in the modules folder won't be lost).

- Fixed error in framework routing logic. This should further improve the overall stability.
- Updated the Cron module to no longer overwrite the "activeframe" trigger. Should also run more stable now.
eaxs is offline   Reply With Quote
Old 01-04-2012, 04:53 AM   #7
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Default

Another update:
- Added new methods to the Array module: rmkey, empty, copy and reverse.
eaxs is offline   Reply With Quote
Old 10-14-2012, 01:20 AM   #8
Old55

Old55's Avatar
 
Join Date: Jun 2009
Posts: 2,586
Thanks: 14
Thanked 428 Times in 209 Posts
Default

Tried to give it a try, but i just get parsing errors when the latest triggerlist is put into a map. I didn't see anything else that needed to be done.

EDIT: just had to re-paste the K2 script in the triggerlist in the script editor. Not sure why the distributed triggerlist didn't work.
__________________

Last edited by Old55; 10-14-2012 at 02:14 AM.
Old55 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:51 AM.