+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: WHAT IS WRONG?!!!!!!!!!!!!! (/thread-25439.html)
RE: WHAT IS WRONG?!!!!!!!!!!!!! - Daemian - 06-06-2014
Add a debug message to see if the function is working.
RE: WHAT IS WRONG?!!!!!!!!!!!!! - Romulator - 06-06-2014
You seem to have two Again voids. Change one of them and adjust your code to reflect that.
I also believe you're not expressing your code somehow on what eSpeed1 is, therefore while it is being passed into the void, you don't have a time set for the timer to occur. Is there a reason why you cannot simply just add a collide function or generate a random float and set that to be eSpeed1?
(06-06-2014, 07:15 AM)Romulator Wrote: I also believe you're not expressing your code somehow on what eSpeed1 is, therefore while it is being passed into the void, you don't have a time set for the timer to occur. Is there a reason why you cannot simply just add a collide function or generate a random float and set that to be eSpeed1?
You could just define what eSpeed1 is in the OnStart OnEnter, or just you know, use regular syntax.
RE: WHAT IS WRONG?!!!!!!!!!!!!! - Mudbill - 06-06-2014
If I read it correctly, this is what happens:
When you enter this level, it immediately calls Again(0.0f);
This function checks the health of the player, and if the player has more than 0, it cancels out the rest of the script. This could be the problem.
If the player is dead when he enters this level (I don't see how that's possible), the rest is ran. There's a lot of dead code right here, because since you input 0.0f in the Again parameter, the timer for changing the level is also 0.0f (instantly). The sound and screen shake never get time to do anything. If the script gets this far, the player is also dealt 110 damage (if the player is dead, why must you torture him so? ;_;). A variable is ticked and the map is changed right away.
It's a very strange series of events you have here. I'm not sure what you intended with it.
RE: WHAT IS WRONG?!!!!!!!!!!!!! - ProyectV - 06-07-2014
(06-06-2014, 01:11 PM)Mudbill Wrote: It's a very strange series of events you have here. I'm not sure what you intended with it.
What i'm trying to do is, if you die on the game you'll have to start over from the begining like an infinte loop that will break if you survive
I think the engine is confused which one to call. Also what is eSpeed1?
0.0f = eSpeed1
again(0.0f);
void again(float eSpeed1)
What I meant is what is eSpeed1. eSpeed1 is definitely not a default string so it's unrecognizeable.
RE: WHAT IS WRONG?!!!!!!!!!!!!! - Mudbill - 06-07-2014
eSpeed1 is defined as a float in the parameter of Again. The other Again that uses a string parameters does not conflict with the float one. Only constructors with the same parameters can conflict. For example, you can make OnStart("Answer") and OnStart(42) and neither of them will cause any issues for the normal OnStart() with no parameters.
@OP
So you're trying to reset the level if the player dies? I don't think OnEnter is called again when you respawn. You should use the CheckPoint script. It has a callback for when the player dies and where to respawn them.