Extended Version v1.5.9 - mod for KS & Level Editor

  • 119 Replies
  • 110081 Views
*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Extended Version v1.5.9 - mod for KS & Level Editor
« on: October 31, 2010, 21:33:11 »
Here is my mod for KS: https://sites.google.com/site/sergroj/ks
Extract it into your KS folder. You'll also find 3 levels on the page. The first is just an example level with comments in the script, GrayFace - Ball Tutorial is a real level introducing the bouncing ball game mode and Platforms Room is a little test chamber with falling platforms.
Template objects thread.
Custom characters thread.
Speedrun of The Machine with a ball.

Knytt Stories Ex

1. First, changes that may be helpful for any player:
  • Bouncing ball mode.
  • VVVVVV mode.
  • You can take screenshots with Print Screen key and then view them with "[" and "]" keys. The savegame also stores coordinates of screens where the shots were taken (which makes it useful for keeping track of bugs you found in a level).
  • Map. It's activated in Options or with "AllowMap = true" for individual levels.
  • When you go to a new screen there's no delay before objects appear.
  • New "Keep resolution in full screen" menu item to play the game in native monitor resolution, "Zoom" for windowed mode.
  • F2 works in full screen.
  • May set quick death without white flash.
  • Keyboard shortcuts. Most menu buttons have their first letter as a shortcut. Levels in levels list are chosen by pressing buttons '1' to '8'. Save slots are chosen by pressing buttons '1' to '3'. 'Play', 'Start a new game' and 'Load game' have the right arrow as additional shortcut. Additional shortcut for 'Back' is BackSpace.
  • Sorting by date, search and page buttons in level selection screen. Page buttons can be turned off by setting "No Level Page Numbers=1" in Data\settings.ini. Previous/Next page buttons now react double clicks and repeat if you hold them.
  • Play button in Install Level dialog.
  • Now you can drag & drop .knytt.bin files to install them while you're anywhere the menu screen.
  • Ctrl+M (Sound -> Music) turns music on/off.
  • Now all sounds are stopped when KS is inactive.
  • Clickable links in Credits, a list of links for "Get More Levels" button.
  • High priority of game process, so background tasks won't spoil the gameplay.
  • Controls can be configured.
  • Set "NoHologramDoubleDown = true" in Data\UserScript.lua to turn off triggering the Hologram when you press Down twice.
  • Cheat improvements. You can now teleport between screens, save, turn powers on/off and turn ball mode on/off (in ragular levels).
  • Prettier pick up light. It's smoother now, but there's a chance you won't notice it. In an unlikely case you want to get the standard pick up light back, add "OriginalPickUpLight = true" line to Data\UserScript.lua.
  • Bug fixed: Ctrl+S and F2 sometimes didn't work in full screen mode.
  • Bug fixed: Diagonal scrolling now works correctly with warps.
  • Bug fixed: After removing Detector or Hologram powers they still were on.
  • Bug fixed: egomassive's fix for objects facing bug is applyed, see http://nifflas.lpchip.nl/index.php?topic=4648.0
  • Bug fixed: Music wasn't playing after cutscenes, see http://nifflas.lpchip.nl/index.php?topic=4744.0
  • Bug fixed: Worlds directory subfolders without World.ini are no longer listed as levels.
  • Bug fixed: Now Juni will no longer briefly appear in her old position when shifting to a new relative position on a new screen.
  • Bug fixed: If you go to a screen with different ambiance and then quickly go back the ambiance doesn't restart now.
  • Bug fixed: The music didn't stop when a fatal error message is shown.
  • Bug fixed: Custom objects were leaking resources, causing bugs after a period of playing.


To use bouncing ball mode in a regular level, press Ctrl+Shift+C, then press Space+B. 8) I've finished all Nifflas' levels in this mode, they were much harder than usually.
Spoiler: Ball Controls (click to show/hide)

2. Now, changes that level designers can take advantage of:
  • Lua.
  • Bank 254 - objects templates. See this thread for more info.
  • Bank 0, Obj 32 - No Wall Swim object.
  • All graphics can be changed. Most important sounds (Juni sounds and save sound) can be replaced too.
  • Text objects. You can use text of any color, use any custom font.
  • Fullscreen is available when KS is started from editor.
  • "Level Editor" button instead of "About MMF". "About MMF" is still accessable from Credits.
  • Music can loop in a level. Add "MusicLoops = 0" to Script.lua for it. There is also an event "MusicLoops", so you can choose where it should loop.
  • If FixCutscenes is set to 'true' by Script.lua, shifts with cutscenes and without Autosave flag won't return you to the last save point - instead you'll continue from where you triggered the cutscene, but the game won't be saved.
  • Animals don't walk on air if you call NoWalkOnAir() from your script.
  • Fish don't swim through walls if you call NoFishInWalls() from your script.
  • Signs of any length can be read using Page Up, Page Down, Home and End buttons to scroll them.
  • Fonts for signs: egomassive's Clean font contains characters missing in original font, Russian font contains Cyrillic letters. To use a font add "Font=FontName" line to [KS Ex] section of World.ini. WorldPath\Fonts can contain custom fonts.
  • Support for gradients of any width.
  • Game.MusicVolume, Game.AmbianceVolumeA, Game.AmbianceVolumeB control music and ambiance volumes.
  • Game.AmbiFadeSpeedA, Game.AmbiFadeSpeedB control ambiance fade speed.


With Lua scripts you can make a lot of things, even completely new game modes, as demonstrated by the BouncingBallMode.
Play through the example level, then go to its folder and open Script.lua file. That's what powers all the unusual stuff.
Information on Lua can be found at http://www.lua.org/manual/5.1/ and http://www.lua.org/pil/
Information on XLua interfaces can be found here: https://sites.google.com/site/sergroj/ks/XLuaInterfaces.rar?attredirects=0&d=1
Yet, I haven't done any documentation on my stuff, so feel free to ask.

The simplest thing to do is to add BouncingBallMode() line into your Script.lua to make a level played with a ball. Here are some other similar one-liners that may help you:
Code: [Select]
FixCutscenes = trueLets you use cutscenes that don't autosave, but don't reset to the last save point.
Code: [Select]
LoadGhostsWhenEyeIsTaken = trueWhen the Eye is taken, ghosts would immediately show up. You'll also need to set "NeedObjects = true".
Code: [Select]
NoWalkOnAir()Animals would respect platform edges and won't walk on air anymore. This includes ground-walking enemies.
Code: [Select]
NoFishInWalls()Fish won't swim through walls.
Code: [Select]
NoLoadScreenDelay = trueThis would remove the 1 tick delay that happens after screen tiles are rendered, but before objects are created. However, in object-intensive screens combined time to load tiles and objects becomes too big, so you may want to turn it on and off in BeforeLoadScreen event.

Level Editor Ex
  • List of objects, you can scroll it by clicking an object and holding the left button
  • Adjacent screens previews.
  • Now World.ini is automatically reloaded when it is changed by an external program (that is, 3rd Party Tools changes are no longer overwritten by the editor)
  • "Screen -> Hide error messages" menu item added that disables errors that inform of transparent tilesets, invalid music etc.
  • Automatic template Objects (Bank 254) creation from current view of the screen (with or without background gradient). This lets you layer a picture made of tiles on top of Juni for example. Choose an unused Template object and you'll see a camera button to the right of Object selector.
  • Bug fixed: Ctrl+R didn't reload World.ini if the editor is invisible
  • Bug fixed: When KS is in full screen mode the editor no longer reacts clicks and no longer gets resized
  • Level -> Script menu item opens Script.lua
  • Bug fixed: Editor reacted Ctrl+C, Ctrl+S, Ctrl+V and some other keys even if it's not focused.
  • Bug fixed: Backup of World.ini was placed into world folder when the world is loaded, thus changing the folder Date. Now it's placed there only when World.ini is changed.
  • Bug fixed: EditorSettings.temp was placed into world folder when the world is loaded, thus changing the folder Date.
  • Bug fixed: If Tileset B was selected and the tile (0,0) of tileset was a part of the selection, Tileset A was used instead for painting.
  • Ctrl+Q shortcut for KSManager (current screen).
  • Full set of object icons for bank 255 in the original style.
  • Now pressing Ctrl+arrow moves the view by 100.
  • Author field for New Level is remembered.
  • When "Show custom objects" option is active, objects graphics is shown together with object index icon.
  • There was a major slowdown when going from screen to screen in big levels due to world.ini editor line searching. Some other performance improvements have been done.
  • When you edit text of a sign in World.ini editor you see a preview of how it will look in the game.
  • You can click on INI editor's margin near [x****y*****] to go to corresponding screen.
  • Music and Ambients play buttons are now toggled by click.
  • "Run Knytt Stories" menu item.
  • Layer 3 is selected by default (can be changed by setting "Default Layer" in Worlds\EditorSettings.temp).
  • Less flashy selection marks (set "Standard Markers=1" in Worlds\EditorSettings.temp to get back to default).
  • Exit/Reset warning.
  • The editor selects the last edited level at start up.
  • Set options "ResolutionX" and "ResolutionY" in "Worlds\EditorSettings.temp" to make the editor switch to that resolution while you're working with it.
  • Almost no CPU usage when inactive.
  • Support for gradients of any width.
  • Simple 1-frame custom objects (Bank 255) are displayed in objects list.
  • Other small things like Alt+F2 shortcut for Reset and double click reaction for minimap.
  • Bug fixed: Undo shortcut (Ctrl+Z) didn't work sometimes.
  • Bug fixed: World.ini editor was catching Ctrl+Z and Ctrl+V shortcuts, thus messing things up.
  • Bug fixed: Hiding layers in an empty screen caused the contents of the last visited non-empty screen to be pasted.
  • Bug fixed: Level -> Script menu item didn't work sometimes.
  • Bug fixed: Ctrl+Del was causing corruption and crashes due to no check for workspace existence.
  • Bug fixed: Sometimes custom objects were cropped with "Show custom objects" option.
  • Bug fixed: Flood-fill (Shift+click) didn't work for Tileset B.

« Last Edit: April 11, 2015, 18:05:43 by GrayFace »

*

Offline Yoeri

  • 256
  • 15
  • Normality is relative
    • View Profile
    • Bumper's business
Re: Extended Version - mod for KS & Level Editor
« Reply #1 on: October 31, 2010, 22:53:02 »
Yes finally an use for the only programming language I know!


*

Offline egomassive

  • 1852
  • 250
    • View Profile
    • egomassive games
Re: Extended Version - mod for KS & Level Editor
« Reply #2 on: November 01, 2010, 01:21:05 »
The play button in the install dialogue is a great idea. It was on my mod wish list.

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version - mod for KS & Level Editor
« Reply #3 on: November 01, 2010, 01:54:30 »
I took it from KSA :)

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #4 on: November 08, 2010, 22:35:24 »
Version 1.1
The first post has been updated. Here are changes from version 1.0:

Game:
  • Animals don't walk on air if you call NoWalkOnAir() from your script
  • Fish don't swim through walls if you call NoFishInWalls() from your script
  • Signs of any length can be read using Page Up, Page Down, Home and End buttons to scroll them
  • My bugs fixed: Fixed screen edge glitches of ball mode
  • My bug fixed: Springs and direction-tracking monsters didn't work in ball mode
  • Bug fixed: Diagonal scrolling now works correctly with warps
  • Bug fixed: Ctrl+S and F2 sometimes didn't work in full screen mode
  • The change to scrolling from v1.0 disabled by default and only would take place if "ScreenScrollDetectionDelta = 0" is added to the script
Editor:
  • Level -> Script menu item opens Script.lua
  • Bug fixed: Editor reacted Ctrl+C, Ctrl+S, Ctrl+V even if it's not focused.
  • My bug fixed: After using Reset or Reload, object list was scrolled by 2, then by 3 and so on.
  • My bug fixed: "Executable=Knytt Stories Ex.exe" was added to DefaultSavegame.ini on world opening.
  • Bug fixed: Backup of World.ini was placed into world folder when the world is loaded, thus changing the folder Date. Now it's placed there only when World.ini is changed.
  • Bug fixed: EditorSettings.temp was placed into world folder when the world is loaded, thus changing the folder Date.
  • Bug fixed: If Tileset B was selected and the tile (0,0) of tileset was in selection, Tileset A was used instead for painting.


BTW, I've finished all Nifflas' levels in bouncing ball mode now, including secrets endings.
« Last Edit: November 08, 2010, 23:47:37 by GrayFace »

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #5 on: November 09, 2010, 03:05:32 »
Gave this a very quick look (very late here), nice what you made out of this :)

"Bug fixed: If Tileset B was selected and the tile (0,0) of tileset was in selection, Tileset A was used instead for painting."
From what I recall that's not a bug. 0,0 is always empty, you should write a 0 value to the data file in that case.

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #6 on: November 09, 2010, 11:33:31 »
Not with a rectangular selection :) I've changed the description of bug in the 1st post, so now it should be a bit clearer. In fact, in flood fill it was the opposite - 128 was written for (0, 0) of B, although I never checked the actual file and there's no other way to tell the difference.
« Last Edit: November 09, 2010, 11:41:53 by GrayFace »

*

Offline egomassive

  • 1852
  • 250
    • View Profile
    • egomassive games
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #7 on: November 09, 2010, 12:06:00 »
How does diagonal scrolling work with warps? What happens when the side destinations are unrelated?

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #8 on: November 09, 2010, 13:59:46 »
Oh, okay. I will have another look at this later. Man, I hope I didn't lose my dignity by exposing the editor source code... it's horrible :D
Looking forward to testing the Lua stuff, I always love scripting in games.

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #9 on: November 10, 2010, 03:03:45 »
I've found a bad bug caused by my recent change of signs. Sometimes signs stop updating, always showing the same message. It's not easy to reproduce, so I wasn't able to fix it yet. Game restart fixes this when the bug happens (F2 should be enough).

How does diagonal scrolling work with warps? What happens when the side destinations are unrelated?
It first triggers X warp on this screen, then Y warp on the screen to which X warp has lead. Before the fix it just added the deltas of two warps together resulting in a totally wrong screen. And I've just realized I haven't completely fixed this in v1.1.

Man, I hope I didn't lose my dignity by exposing the editor source code... it's horrible :D
Doesn't seem horrible to me. It's MMF2, after all.
The horrible thing is my extension, which is basically a slightly modified extension template. It does its thing well, but from MMF2 it looks similar to the template. So, for example, a check that the window has focus looks like this: "Condition example: 0 + 0 = 0" :D

Looking forward to testing the Lua stuff, I always love scripting in games.
Cool.
« Last Edit: November 10, 2010, 04:09:43 by GrayFace »

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #10 on: November 10, 2010, 17:46:14 »
Oh, that was your extension :) No wonder I couldn't open it. To check that the window has focus you could also use the Window Control object.

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version v1.1 - mod for KS & Level Editor
« Reply #11 on: November 15, 2010, 02:12:26 »
Version 1.1.1
The first post has been updated. Here are changes from version 1.1:

Game:
  • "Version" variable added to Lua.
  • My bug fixed: The diagonal scrolling wasn't completely fixed in the last version.
  • My bug fixed: Sometimes signs displayed wrong text. I hope it's fixed now.
Editor:
  • Ctrl+Q shortcut for KSManager (current screen).
  • Bug fixed: Some keys were reacting presses when KS Editor isn't focused.
  • My bug fixed: if a level without EditorSettings.temp file was opened and "Test Level" was used, the next time the level was opened at position x0y0. Not fixed here. To be fixed soon.
  • My bug fixed: Level -> Script menu item didn't work correctly.
  • Bug fixed: Undo shortcut (Ctrl+Z) didn't work sometimes.


Did I tell you that the example map was updated with version 1.1?
« Last Edit: November 28, 2010, 17:46:58 by GrayFace »

*

Offline Artix

  • 30
  • 0
    • View Profile
Re: Extended Version v1.1.1 - mod for KS & Level Editor
« Reply #12 on: November 18, 2010, 07:03:05 »
It's not working for me, I installed it, and extracted everything to my Knytt Stories folder.

Well, the tutorial level is broken, and as the picture shows, they're walking on air, but the dialog scrolling works fine.

*

Offline GrayFace

  • 805
  • 61
    • View Profile
    • my site
Re: Extended Version v1.1.1 - mod for KS & Level Editor
« Reply #13 on: November 18, 2010, 16:47:12 »
Oops, the problem was in level compression. This also means that you are the first one who actually tried the mod out.

Version 1.1.2

Game:
  • Files with *.lua extension are allowed in compressed levels.
Editor:
  • Files with *.lua extension are included in compressed levels.
« Last Edit: November 18, 2010, 16:54:56 by GrayFace »

*

Offline egomassive

  • 1852
  • 250
    • View Profile
    • egomassive games
Re: Extended Version v1.1.2 - mod for KS & Level Editor
« Reply #14 on: April 13, 2011, 01:07:09 »
I just heard you are still working on this. I finally tried it out a short while ago, and I was really impressed with the capabilities. However, I don't think it'll see much use without a manual. Also, I was wondering if the level editor could be used to make normal KS 1.2.1 levels. The auto-reloading of the World.ini sounds extremely helpful.