Frictional Games Forum (read-only)
[SCRIPT] Messed up TIMERS! - Printable Version

+- 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: [SCRIPT] Messed up TIMERS! (/thread-14452.html)



Messed up TIMERS! - willsage - 04-02-2012

I am making a custom story for a youtuber and I get this error:


Quote:FATAL ERROR: Could not load script file
'custom_stories/CZtrollmaps_v.01/maps/Menu.hps'!
main (4, 3) : ERR : No matching signatures to 'AddTimer(string@&,
string@&, string@&)'
main (177, 3) : ERR : No matching signatures to 'AddTimer(string@&,
string@&, string@&)'
main (123, 3) : ERR : No matching signatures to 'AddTimer(string@&,
string@&, string@&)'
main (129, 3) : ERR : No matching signatures to 'AddTimer(string@&,
string@&, string@&)'
main (136, 3) : ERR : No matching signatures to 'AddTimer(string@&,
string@&, string@&)'
Here is my script... Menu.hps


Quote:void OnStart()
{
FadeOut(0.05f);
AddTimer("intro", "5.0f", "FadeIn1");

AddEntityCollideCallback("Door_TrollMaps", "TrollMapsTPScript", "TPTrollMaps", false, 0);
AddEntityCollideCallback("Door_FanMadeMaps", "FanMadeMapsTPScript", "TPFanMadeMaps", false, 0);
AddEntityCollideCallback("Door_ToMenu_1", "MenuTPScript_1", "TPMenu1", false, 0);
AddEntityCollideCallback("Tp_ToMenu_door_2", "MenuTPScript_2", "TPMenu2", false, 0);
AddEntityCollideCallback("Door_SurvivalMaps", "SurvivalMapsTPScript", "TPSurvivalMaps", false, 0);
AddEntityCollideCallback("Door_Minigames", "MinigamesTPScript", "TPMinigames", false, 0);
AddEntityCollideCallback("Door_ToMenu3", "MenuTPScript_3", "TPMenu3", false, 0);
AddEntityCollideCallback("Door_ToMenu4", "MenuTPScript_4", "TPMenu4", false, 0);

AddEntityCollideCallback("CollisionScript_1", "Player", "Stop1", true, 0);

RotatePropToSpeed("elevator_machine_cog_main_1", 1.0f, 2.0f, 0.0f, 0.0f, -1.0f, true, "");

SetEntityCustomFocusCrossHair("ObjMapsTPScript", "LevelDoor");

SetFogActive(false);
SetSanityDrainDisabled(false);
ClearSavedMaps();

SetEntityPlayerInteractCallback("level_barricade_01", "Barricade01Load", false);
SetEntityPlayerInteractCallback("castle_gate_arched01_2", "Open", true);
SetEntityPlayerInteractCallback("ObjMapsTPScript", "TpM", false);

}

//////Teleportation Scripts
///////////////////////////
void TPTrollMaps(string &in asParent, string &in asChild, int alState) //This teleports the player to the trolling maps lobby.
{
TeleportPlayer("PlayerStartArea_6");
SetPlayerMoveSpeedMul(2.5f);
SetPlayerRunSpeedMul(0);
}

void TPSurvivalMaps(string &in asParent, string &in asChild, int alState) //This teleports the player to the survival maps lobby.
{
TeleportPlayer("PlayerStartArea_7");
}

void TPMinigames(string &in asParent, string &in asChild, int alState) //This teleports the player to the minigames lobby.
{
TeleportPlayer("PlayerStartArea_8");
}

void TpM (string &in asEntity)
{
TeleportPlayer("PlayerStartArea_13");
}

void TPFanMadeMaps(string &in asParent, string &in asChild, int alState) //This teleports the player to the minigames lobby.
{
TeleportPlayer("PlayerStartArea_12");
}

void TPMenu1(string &in asParent, string &in asChild, int alState) //This teleports the player to the main lobby.
{
TeleportPlayer("PlayerStartArea_5");
}

void TPMenu2(string &in asParent, string &in asChild, int alState) //This teleports the player to the main lobby.
{
TeleportPlayer("PlayerStartArea_4");
}

void TPMenu3(string &in asParent, string &in asChild, int alState) //This teleports the player to the main lobby.
{
TeleportPlayer("PlayerStartArea_3");
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
}

void TPMenu4(string &in asParent, string &in asChild, int alState) //This teleports the player to the main lobby.
{
TeleportPlayer("PlayerStartArea_3");
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
}

//////Loading Screens
/////////////////////
void Barricade01Load(string &in asEntity)
{
SetupLoadScreen("LoadingScreens", "Barricade01", 1, "BarricadeLoadingScreen.png");
}

//////Interaction Callbacks
///////////////////////////
void Open(string &in asEntity)
{
SetEntityActive("castle_gate_arched01_2", false);
SetEntityActive("castle_gate_arched01_open_1", true);
}

//////Intro
///////////
void TimerMoveForward(string &in asTimer)
{
MovePlayerForward(2);
AddTimer("automove", 0, "TimerMoveForward");
}

void TimerCollapseWall(string &in asTimer)
{
StopSound("rumble", 4.0f);
PlaySoundAtEntity("rumble", "explosion_rock_large.snt", "Player", 3.0f, false);
CreateParticleSystemAtEntity("ps_dust_impact", "ps_dust_impact.ps", "rumble", false);
}

void FadeIn1(string &in asTimer)
{
FadeIn(4.5f);
AddTimer("intro", "5.0f", "FadeOut1");
}

void FadeOut1(string &in asTimer)
{
FadeOut(2.5f);
AddTimer("intro", "5.0f", "FadeIn2");
}

void FadeIn2(string &in asTimer)
{
FadeIn(4.5f);
AddTimer("intro", "6.0f", "LookScript1");
TeleportPlayer("PlayerStartArea_15");
StartPlayerLookAt("LookScript_1", 3.5f, 6.5f, "");
}

void LookScript1(string &in asTimer)
{
AddTimer("intro", "5.0f", "LookScript2");
AddTimer("automove", 0, "TimerMoveForward");
StopPlayerLookAt();
StartPlayerLookAt("rumble", 3.5f, 6.5f, "");
}

void LookScript2(string &in asTimer)
{
AddTimer("automove", 0, "TimerMoveForward");
StopPlayerLookAt();
StartPlayerLookAt("rumble", 3.5f, 6.5f, "");
}

void Stop1(string &in asParent, string &in asChild, int alState) //This teleports the player to the main lobby.
{
RemoveTimer("automove");
AddTimer("Escape", 2, "TimerCollapseWall");
StartScreenShake(0.03f, 3.0f, 1.0f, 2.0f);
PlaySoundAtEntity("rumble", "general_rock_rumble_no3d.snt", "Player", 2.0f, false);
}
PLEASE HELP!!


RE: Messed up TIMERS! - Xanthos - 04-02-2012

Er, I can't help you I use my timers like so...
---

void Lights(string &in asParent, string &in asChild, int alState)
{

StartPlayerLookAt("AreaLook01", 10, 100, "");
AddTimer("1", 3, "IntroTimer");
AddTimer("2", 4.5f, "IntroTimer");
}

void IntroTimer(string &in asTimer)
{
if(asTimer == "1"){
PlayGuiSound("player_cough.snt", 0.7f);
StopPlayerLookAt();
}
else if(asTimer == "2"){
FadePlayerRollTo(85, 1, 1);
}

}


RE: Messed up TIMERS! - Your Computer - 04-02-2012

Strings aren't floats.


RE: Messed up TIMERS! - willsage - 04-03-2012

(04-02-2012, 11:53 PM)Your Computer Wrote: Strings aren't floats.
Your saying I should use a ... float? I don't get it; an example please! :D


RE: Messed up TIMERS! - Your Computer - 04-03-2012

(04-03-2012, 12:20 AM)willsage Wrote: Your saying I should use a ... float? I don't get it; an example please! Big Grin

How to properly use the AddTimer function is shown in post #2.


RE: Messed up TIMERS! - Obliviator27 - 04-03-2012

The error message is telling you what's wrong.

No matching signatures to 'AddTimer(string@&,
string@&, string@&)'

This doesn't exist. AddTimer(string, string, string) isn't a function. However

AddTimer(string, float, string) is.
Basically your second parameter has to be a number. AKA, the how many seconds until the timer calls the function.



RE: Messed up TIMERS! - willsage - 04-03-2012

oHWOW THANK YOU! I feel so stupid after nearly a year of map making I make a mistake like this and yet I make amnesia rooms like a pro! Thankyou all of you +1 rep for all!