I'm sure you guys hear this at least twice a day from new users and by now you probably have gotten sick of it, but I got a new PC a month ago and bought Amnesia. I played a bunch of custom stories (About 20 or so) and then got the idea of "Maybe I should try making my own"
It started as just a bit of messing around with no real intent to create an actual map, but it's evolved a lot. The physical map itself is pretty much done with the exception of adding items like keys and oil and tossing in a few decorations to make it less bland, then I gotta script it all together and make a few notes. I know nothing of scripting but I've been gradually learning (Woke my girlfriend up at 3 AM by cheering because I managed to get a monster to walk across a room)
I wanted to wait as long as possible before asking for help and I've solved many of my problems by researching and watching/reading tutorials. But now I've encountered some problems I couldn't find solutions to. 3 so far (Probably will be more later on)
Problem 1: (This is the major problem, the other 2 I can work around on my own if I can't find a solution)
My doors keep getting stuck. I've followed every door tutorial I could find, but to no avail. It seems like they're rubbing against the door frame. It seems to worsen the more I open/close the door, but other times it does it right away. I tried fixing this by changing the proportions of the door to be slightly smaller so that the door is sorta "floating" within the doorway but unless I leave BIG gaps on each side it still gets stuck, and doing that allows the player to look through the gaps and also the door just looks goofy floating there.
Problem 2: Spotlight won't deactivate. I dunno what's going on here as all my other entities that start deactivated stay that way while I'm testing the level, but when I place a spotlight and uncheck the "active" box, I can still see the light while testing the level. I'll attach screenshots to show what it looks like in the editor vs. in game.
Problem 3: Is there any way to briefly make the player invincible? I have a part where the players slides down an incline but when I test the level he repeatedly gets hurt during it leaving him almost dead when he gets to the bottom. I know I could just put some laudanum at the bottom but it still breaks the immersion to have him constantly getting hit by nothing during the slide. I've thought of making the incline less steep then just taking control of the player once they get to it and making them run at full speed down it to simulate sliding but 1: Doing so leaves the incline not steep enough to make sliding down it believable and 2: the running speed isn't really fast enough to make the sliding believable.
Sorry to smack everyone with a wall of text on my first post. Thanks in advance to anyone willing to help my dumb ass.
P.S. I didn't put this as one of my problems as it'll be quite a while before I have to worry about this, but I have some custom entities in my story. When someone else goes to play it will the map be able to read them from the custom story folder (right now I have them in the main game folder under Entities>Gameplay>folder name of each one) or would I have to tell the player to manually put those entities in his main entity folder too?
Problem 1: Most doors should work fine if you leave Snap to Grid on (set to 0.25). I think the arched castle door is one of the weird ones that needs to be adjusted. Most likely, the door is coilliding with ther frame or something else which is causing it to be stuck. Also, I'd try to avoid resizing the doors because it looks pretty strange and could also cause further problems. What are the doors that you are having problems with?
Problem 2: I think that is just a glitch with the editor. If you want the spotlight to not show up, you can set it's colour to 0 0 0 (black). Or alternatively, in your script you can use the function SetLightVisible(string& asLightName, bool abVisible) which will make the light invisible.
Problem 3: You can create a script area at the bottom of the incline, and script it so that when the player collides with the area, they receive some health. For example:
void OnStart() { AddEntityCollideCallback("Player", "Script Area name here!", "GiveHealth", true, 1); }
void GiveHealth(string &in asParent, string &in asChild, int alState) { AddPlayerHealth(50.0f); // or use SetPlayerHealth to set the players health to a specific value }
(this script is not tested and could contain errors)
You could also just leave it the way it is, because it makes sense that the player would get hurt a bit from falling. Of course, it's your choice though.
Problem 4...(?): The game will be able to read them from your custom story folder. Make a folder called "entities" in your custom story folder, and place all your custom entities in there.
The door I'm using is the regular metal door (Metal.ent) with the castlebase door frame (door_frame.dae) and the doorway wall from the castlebase (doorway.dae) and I keep 0.25 snap to grid on at all times unless I'm lining up a torch or something.
I had a thought, is there any way to make it so that my door won't "collide" with the door frame, without effecting their collisions of the player or other entities? Then as far as the door is concerned there is no doorframe and it can swing all it wants. I know the door itself has a "collide" checkbox but that effects everything colliding with it.
Alternatively maybe I can import the door frame into the model editor and create a new body that's a bit smaller than the door frame to give the door more leeway while still colliding with the player and objects.
For the spotlight, setting it to 0,0,0 worked fine but is there a script to change it back once the player gets to the point where it's supposed to appear? Something like this: (I know the script probably has a lot of errors but since I don't know if a script like this exists I'm just throwing together what I think it might look like)
As I said, I know nothing about the actual inner workings of scripts (yet, I'm trying to learn) I've just been able to jury-rig my scripts by copying sample scripts from tutorials and figuring out which bits to change to suit what I'm trying to do.
For the slide, I was thinking and I think I'll leave it as is and put a few wooden beams "collapsed" diagonally along the way and turn their collide off so the player goes through them and thinks they're hitting his head. Will take time to get the timing of the damage right but if I manage it'll probably look cool.
Try moving the door up +0.035 on the y-axis. I haven't actually tested whether it will work or not, but from what I can see in the level editor, the bottom of the door was inside in bottom of the frame.
For the light, you can use the FadeLightTo function:
asLightName - internal name afR - red value afG - green value afB - blue value afA - alpha value afRadius - radius of the light. -1 means keeping the radius afTime - time in seconds until change is done
The door fix worked great. Thank you. I just have to make sure I turn snaptogrid off whenever I'm gonna mess with the door so it doesn't jump back down.
As for the spotlight, I'm an idiot so I can't figure out where to put that "function" in my script. I tried it like this and the game crashed when I tired to load the level.
void SpotlightOn(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime); { [b](This is Line 15 in my Notepad++)[/b] FadeLightTo(Spotlight_4, 0.7, 0.7, 0.55, 1, -1, 1); }
Dunno if this helps but the crash said that line 15 was the culprit and that it was an unrecognized token, I made a note up there of where my line 15 is.
I know you probably just looked at that and thought "How could he have got that so wrong? I didn't know dumb like that existed." Sorry about that.
Hmm. Got the game to load but when I walk through the script area nothing happens. I decided to try your other solution and it crashes telling me my true isn't declared and my false isn't declared. I did some research and declared seems to mean it needs quotes around it but putting quotes around them still crashed it. Here's my script as it is now.
I'm gonna move on for now since I still gotta put down my notes and items, add the notes to my lang file, decorate my level a bit more, and a few other little bits.
Thanks for your help though, Once I get to the point where I'm ready to make my credits, I'll put you for script help.