Frictional Games Forum (read-only)
Nothing is working. - 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: Nothing is working. (/thread-18167.html)



Nothing is working. - i3670 - 09-05-2012

I've had this problem for a while now and have yet found a solution. The issue I'm having is that even if the callbacks are called nothing is happening. I've split the script up and tested them each by individually and it seems that none of them work even though they work outside the map.

I tested with a simple "interact - something happens"- script on an area. The handicon appeared but when I clicked nothing happened.

Is there something wrong with the map itself? Because all other maps works just fine.


RE: Nothing is working. - Apjjm - 09-05-2012

We're probably going to need more information than that. Can you upload the script and map file you are using?


RE: Nothing is working. - FlawlessHappiness - 09-05-2012

I've had this problem... Simply what i did was closing Amnesia.exe. Then open it again.


RE: Nothing is working. - i3670 - 09-05-2012

Apjjm: sent download link to mapfile in pm
beecake: done that, didn't work.

Portcullis script
Spoiler below!

void OnStart()
{
ConnectEntities("D", "lever_simple01", "castle_portcullis_1", true, -1, "PortOpen1");
ConnectEntities("E", "lever_simple02", "castle_portcullis_2", true, -1, "PortOpen2");
ConnectEntities("F", "lever_simple03", "castle_portcullis_3", true, -1, "PortOpen3");
}
///Ports///
void PortOpen1(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("castle_portcullis_1", 1);
SetLeverStuckState("lever_simple01", 0, true);
}
else if(alState == -1)
{
SetMoveObjectState("castle_portcullis_1", 0);
}
}

void PortOpen2(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("castle_portcullis_2", 1);
SetLeverStuckState("lever_simple02", 0, true);
}
else if(alState == -1)
{
SetMoveObjectState("castle_portcullis_2", 1);
}
}

void PortOpen3(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("castle_portcullis_3", 1);
SetLeverStuckState("lever_simple03", 0, true);
}
else if(alState == -1)
{
SetMoveObjectState("castle_portcullis_3", 1);
}
}

///Ports End///



Graveyard script
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "GraveArea_1", "Grave1", true, 1);
AddEntityCollideCallback("Player", "GraveArea_2", "Grave2", true, 1);
AddEntityCollideCallback("Player", "GraveArea_3", "Grave3", true, 1);
AddEntityCollideCallback("Player", "GraveArea_4", "Grave4", true, 1);

SetLocalVarInt("Var1", 0);

SetEntityPlayerLookAtCallback("GraceAreaCorpse_1", "CorpseDisappear1", true);
SetEntityPlayerLookAtCallback("GraceAreaCorpse_2", "CorpseDisappear2", true);
}

void Grave1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_1", true);

AddLocalVarInt("Var1", 1);
func5();
}

void Grave2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_2", true);

AddLocalVarInt("Var1", 1);
func5();
}

void Grave3(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var1", 1);
func5();
}

void Grave4(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func5()
{
if(GetLocalVarInt("Var1") == 4)
{
SetEntityActive("coffin_dirty_3", true);
SetEntityActive("Flask_03", true);
}
}

void CorpseDisappear1(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse03_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}

void CorpseDisappear2(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse02_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}
///Graveyard End///



Tunnel script
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "WhisperArea_1", "WhisperTunnel_1", true, 1);
AddEntityCollideCallback("Player", "WhisperArea_2", "WhisperTunnel_2", true, 1);
AddEntityCollideCallback("Player", "WhisperArea_3", "WhisperTunnel_3", true, 1);
}

///Spike Tunnel///
void WhisperTunnel_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "05_event_bottles.snt", "Player", 1.0f, false);
}

void WhisperTunnel_2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_whisper.snt", "Player", 1.0f, false);
}

void WhisperTunnel_3(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_whisper.snt", "Player", 1.0f, false);
}

///Spike Tunnel End///


Lab script
Spoiler below!

void OnStart()
{
SetEntityInteractionDisabled("glass_container_1", true);

ConnectEntities("Ignite", "ValveIgnite", "Valve_1_AreaBottle", false, 0, "TurnOnAcidLab");
}

////////LAB///////
void TurnOnAcidLab(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
if(alState == 1)
{
for(int i=1;i<=4;i++) {
CreateParticleSystemAtEntity(asName+"Fire"+i, "ps_fire_candle.ps", "Valve_"+i+"_AreaBottle", false);

FadeLightTo("Valve_"+i+"_Light", -1, -1, -1, -1, 0.4f, 1);

SetWheelStuckState("Valve_"+i, 0, true);
}

PlaySoundAtEntity("IgniteSound", "general_fire_burning_low", "Valve_1_AreaBottle", 1, false);

SetWheelStuckState("ValveIgnite", 1, true);
}
else if(alState == -1)
{

}
}

///////LAB END//////


I don't have multiple OnStarts, it's just from when I split up the script.


RE: Nothing is working. - Apjjm - 09-06-2012

Firstly there is an error in the lab script section. Specifically in TurnOnAcidLab:
Code:
CreateParticleSystemAtEntity(asName+"Fire"+i, "ps_fire_candle.ps", "Valve_"+i+"_AreaBottle", false);
asName is undefined. What is this supposed to be? I commented this line out and the rest of the script ran fine.

Additionally, you are getting warnings from double->float conversions. These are in both CorpseDissappear functions:
Code:
StartScreenShake(0.1f, 0, 0.1, 0.1);

--should be-

StartScreenShake(0.1f, 0, 0.1f, 0.1f);
These warnings are harmless, but they do clutter up the error messages pane, so it's always good to fix them.

Aside from that, everything else seems to work. I cannot use the picked up jars on the flasks - but this is because you haven't added the relevant AddUseItemCallbacks yet.

If after doing the above fixes nothing still seems to work i suggest you look at renaming your map (e.g. storage_area) - perhaps there is a naming conflict, or you have two versions of the map and the game is loading an older one. Also make sure you have deleted any .map_cache files.


RE: Nothing is working. - i3670 - 09-06-2012

I made all the changes and it still won't work. I even changed the name of the map and the .hps file.

btw I haven't added the AddUseItemCallback because I thought I'd be best if I solved this problem/s first.