The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Work in progress Using Lights to make any Image using only scripting
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#1
Using Lights to make any Image using only scripting

This isn't exactly going to be a tutorial just yet. Rather, a WIP tutorial Wink. I'm not really going to go into why i made this - as it is a rather long story with some spoilers in it, but here are some reasons you may want to use it:
  1. Displaying images / text that isn't simply an "image" in some resource folder
  2. Very weak obfuscation / protection of initial settings. Note that i say "very weak" as anybody can just open up your script file and add some "AddDebugMessages" or bypass the decoding!!! It might help if you want to hide a secret message in your level though.
  3. Creating a string which stores variables/settings for some purpose in non-plain text (E.g: Automatically creating an huge array by storing all the data in the string).
  4. Showing Representations of numbers in any base (Note: floats don't count here)
Short story of initial development
Spoiler below!

Anyway, I initially started work by creating a small console app which would take in two command line arguments - an input file and an output file - encoding the contents of the input file using an alphabet + token size to the output file. The output file was just a big string which I would copy into amnesia. Below is a rather redundant example using the tool to generate numbers in base 10:
0123456789
4
U1
U12
U123
U6789
The top line specified the input alphabet, the next line specifies the .no tokens (in this case digits) each number must take up. For example "1" would become "0001". This is necessary for the decoding stage.
The next 4 lines specify numbers, "U" just means "unsigned" and the numbers are the numbers you want to store. The output looks as follows:
0001001201236789
I then wrote a decoder - and added support for floats, signed ints and strings.




However, the final goal was to have an image stored in as little text as possible in my script file, and to then display it on the screen! All I needed to do here was to turn an image into a series of commands above, and supply an alphabet and token size. Luckily, this isn't too hard, and one quick program in c# later i have an image generator, and a few functions (and a few hours debugging Sad) later, I can generate the following using box lights ONLY and no gobos:
Spoiler below!

Problem?
[Image: yILHE.png]

From a level editor with only one box light (until scripting runs) for illuminating the player:
Spoiler below!

[Image: vf48d.png]


After I finish tweaking a few things, and finish documenting the newest functions I'll be posting the tools up and a tutorial on how to use the scripting commands. If you can't wait though, here's the amnesia scripting stuff minus the image loading shenanigans - note that this was designed with the updated notepad++ files which can be found here

Encoding functions HPS file: Mediafire D/L
(This post was last modified: 10-21-2011, 01:38 AM by Apjjm.)
10-21-2011, 01:26 AM
Find


Messages In This Thread
Using Lights to make any Image using only scripting - by Apjjm - 10-21-2011, 01:26 AM



Users browsing this thread: 1 Guest(s)