Jump to content

Amnesia style notes.


lxFirebal69xl
 Share

Recommended Posts

Just wondering if any of you guys would like to help me do this one script, where the player interacts with an object, and a screen like the one below pops up. It either plays a sound or not, and it has a button to interrupt it, it also should dissapear after it's been used, but I already did that part tongue.png

 

post-13811-0-28477800-1423263260_thumb.jpg

  • Upvote 3
Link to comment
Share on other sites

Something like that would be a really nice addition. I can see alot of possibilities especially at the start of a game, entering a new level and those sorts of things. Id probably set up it on collision if it were something I could manage to create.

 

maybe DrawRect: for the shaded box to cover the screen and DrawImage: for the background image and then DrawText for the text?

 

Just throwing ideas out there for thoughts or ideas. I liek the idea none the less.

 

Im digging the new hat there Josh.

Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M,

Link to comment
Share on other sites

post-60-0-01129000-1423278678_thumb.jpg

 

 

i just hacked together a script like that.

 

it works together with the default FPSPlayer.lua script.

 

You also need to disable Sandbox LUA mode in the editor to read the text-files. (i might look at it if i can use lua files for the text instead)

 

Tools -> Options -> Sandbox LUA = disabled

 

 

Notes.zip

 

 

 

 

- got the texture from here: http://www.wildtextures.com/free-textures/old-grunge-paper-texture/

Link to comment
Share on other sites

What a nice contribution. Works great and looks very nice. Im trying to change the font on the text but it dont seem to work if you just edit the text file.

 

Edit: Got the new font to load. Stupid fingers dont understand when i push the Shift keya nd then a letter, its supposed to be CAPITALIZED!

 

A new Keyboard that isnt crusty would be nice :) Poor lil G510 has seen some hours, alot of liquor and even more cigarettes than i would care to share.

 

Again, awesome contribution!

  • Upvote 1

Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M,

Link to comment
Share on other sites

no problem. was fun to code. I needed something else and i thought this is a good way to keep scripting. :)

 

some small things i didn't got to work like changing the text color. it was every color but not the one i had set. :)

 

also i tried to bakup the original font so i can revert back to it after drawing but that didn't seemed to work. will need to look into that further to see if that are bugs or i did something wrong.

Link to comment
Share on other sites

If I might ask, what did you try to set the color? Im sure its the same as what i would think of trying.

 

Something like the context:SetColor(1,1,1,1) command?

Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M,

Link to comment
Share on other sites

don't know about the texture. Maybe some wrong setting in the Texture Editor?

 

The text does currently not know when to break to a new line on its own. So you need to have the lines short enough to fit on the texture.

But i agree that it would be nice. But then there is also the issue about different display resolutions that could limit the available space or text-size.

 

another nice feature would be to have multiple pages to read

Link to comment
Share on other sites

You can make the text lines shorter so that they dont run off the screen. Try using wordpad instead of notepad to edit the text, use the centered justification. Look at the screen when you "use" the object to make the screen come up and find a line that fits and make the other lines similar in size by just pressing "enter". Change the font by changing the font line in the script. I didnt have any issues with the texture not showing up but I did use the one that was with the DL as it fits my theme already.

 

multiple pages would be cool as well to tell a story or set up a scene for the player.

 

I am going to try and have a character that is just standing there running its idle animations as the object to use. Ive done this before and it worked but as of recent, there seems to be something wrong with my process of setting it up :/

Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M,

Link to comment
Share on other sites

looks like you call context:SetColor() somewhere in your script.

 

As a quick workaround you can call context:SetColor(1,1,1,1) right before context:DrawImage() in the Note.lua file in the PostRender function.

 

 

//Edit: I just added the setcolor for the texture drawing and also added some more text settings like text alignment, size and line spacing.

I just uploaded it to the steam workshop (first item i uploaded to the workshop) http://steamcommunity.com/sharedfiles/filedetails/?id=388493460

Edited by beo6
Link to comment
Share on other sites

looks like you call context:SetColor() somewhere in your script.

 

As a quick workaround you can call context:SetColor(1,1,1,1) right before context:DrawImage() in the Note.lua file in the PostRender function.

 

 

//Edit: I just added the setcolor for the texture drawing and also added some more text settings like text alignment, size and line spacing.

I just uploaded it to the steam workshop (first item i uploaded to the workshop) http://steamcommunity.com/sharedfiles/filedetails/?id=388493460

 

 

Thank you that fixed it! And the we need more workshop files like that one :)

Link to comment
Share on other sites

hi. i just updated the script in in the steam workshop with some features.

  • like you wrote i added a selection for font (if none is selected the Arial.ttf is used)
  • flowgraph outputs so you can for example have a monster chasing you as soon as you have closed the note ( slenderman anyone? smile.png )
  • open / close sounds
  • loading of lua text files so the script also works in Sandbox lua mode. (there is a text1.lua for an example how they should look)

Link to comment
Share on other sites

hi. i just updated the script in in the steam workshop with some features.

  • like you wrote i added a selection for font (if none is selected the Arial.ttf is used)
  • flowgraph outputs so you can for example have a monster chasing you as soon as you have closed the note ( slenderman anyone? smile.png )
  • open / close sounds
  • loading of lua text files so the script also works in Sandbox lua mode. (there is a text1.lua for an example how they should look)

 

All these updates are just making your only workshop item one of the best around :)

Keep it up!

Link to comment
Share on other sites

hey beo, you need to add this in the release function to make sure if the sound isn't nil before trying to release it other wise it will try to release something that is nil and crash the game all together (happened to me pressing esc to go to the menu map)

if self.openSound ~= nil then
 self.openSound:Release()
end

OS: Windows 7

Processor: AMD A6-3420M APU integrated Radeon HD Graphics 1.50 GHz

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...