Frictional Games Forum (read-only)
HasItem scripting help - 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: HasItem scripting help (/thread-24480.html)

Pages: 1 2


RE: HasItem scripting help - MsHannerBananer - 01-30-2014

(01-30-2014, 07:14 AM)FlawlessHair Wrote: Ok. So this is how it works right now.

You pass the script box without any key.
- The dialogue appears.
You pass the script box with a key
- Does the dialogue still appear?

If it does then something is wrong with your key, because it's not getting that you have "SpecialKey".

The dialogue doesn't appear after I've gone through it once, regardless of having the key. I have the key, dialogue still appears the first time I go through the script box, but not the second or third, etc.

I kind of figured it had something to do with "SpecialKey", I just can't put my finger on what. This is so aggrivating. This is the last thing I have to do with this map! Bah!

(01-30-2014, 07:27 AM)HannahDJA Wrote:
(01-30-2014, 07:14 AM)FlawlessHair Wrote: Ok. So this is how it works right now.

You pass the script box without any key.
- The dialogue appears.
You pass the script box with a key
- Does the dialogue still appear?

If it does then something is wrong with your key, because it's not getting that you have "SpecialKey".

The dialogue doesn't appear after I've gone through it once, regardless of having the key. I have the key, dialogue still appears the first time I go through the script box, but not the second or third, etc.

I kind of figured it had something to do with "SpecialKey", I just can't put my finger on what. This is so aggrivating. This is the last thing I have to do with this map! Bah!

I'm going to go back to the beginning and try this particular script over once more, via an example script I grabbed from another custom story. See if I can get a different result by starting from scratch.

My efforts didn't help. Still looking for a solution/answer. -.-


RE: HasItem scripting help - FlawlessHappiness - 01-30-2014

The whole function is only calling once.

Simply something must be wrong with the line in the void OnStart.

Please post your WHOLE script, by simply copying it at pasting it into here.


RE: HasItem scripting help - Daemian - 01-30-2014

Maybe the area is inactive?


RE: HasItem scripting help - MsHannerBananer - 01-30-2014

Script

Spoiler below!

void OnStart()
{
//QUEST//
AddEntityCollideCallback("Player", "searchHome_Quest_Area", "GetSearchHome", true, 1);
//VOICEQUEST//
AddEntityCollideCallback("Player", "voiceSearchHome_Area", "PlaySearchHome", true, 1);
AddEntityCollideCallback("Player", "voiceBathroom_Area", "PlayBathroomNo", true, 1);
AddEntityCollideCallback("Player", "voiceGuestroom_Area", "PlayGuestroomMaybe", true, 1);
AddEntityCollideCallback("Player", "voiceCheck_Area", "PlayVoiceCheck", true, 1);
//CHECK//
AddEntityCollideCallback("Player", "voiceCheck_Area", "NoLeave", false, 1);

}



//SEARCH HOME QUEST//
void GetSearchHome(string &in asParent, string &in asChild, int alState)
{
AddQuest("searchhome", "searchHomeQuest");
}


//PLAY THOUGHTS//
void PlaySearchHome(string &in asParent, string &in asChild, int alstate)
{
AddEffectVoice("iah_katethought_searchhome.ogg", "", "Dialogue", "KateThought_SearchHome", false, "", 1, 1);
}

void PlayBathroomNo(string &in asParent, string &in asChild, int alstate)
{
AddEffectVoice("iah_katethought_bathroomno.ogg", "", "Dialogue", "KateThought_BathroomNo", false, "", 1, 1);
}

void PlayGuestroomMaybe(string &in asParent, string &in asChild, int alstate)
{
AddEffectVoice("iah_katethought_guestroommaybe.ogg", "", "Dialogue", "KateThought_GuestroomMaybe", false, "", 1, 1);
}

void PlayVoiceCheck(string &in asParent, string &in asChild, int alstate)
{
AddEffectVoice("iah_katethought_voicecheck.ogg", "", "Dialogue", "KateThought_VoiceCheck", false, "", 1, 1);
}


//CHECK AND BLOCK//
void NoLeave(string &in asParent, string &in asChild, int alState)
{

if(HasItem("SpecialKey") == false)
{
SetMessage("Dialogue", "KateThought_VoiceCheck", 5);
}

if(HasItem("SpecialKey") == true)
{
SetLevelDoorLocked("twoHospital", false);
}

}




RE: HasItem scripting help - FlawlessHappiness - 01-30-2014

Ok, when skimming down over the script I didn't see any errors.
Have you tried deleting your map.cache?

Else, it's gotta be something with the entities.


RE: HasItem scripting help - MsHannerBananer - 01-30-2014

(01-30-2014, 09:28 PM)FlawlessHair Wrote: Ok, when skimming down over the script I didn't see any errors.
Have you tried deleting your map.cache?

Else, it's gotta be something with the entities.

I don't have a map cache that I can find. Not in my folder anywhere.

I'm gonna delete the entity and try again with a different key, and see if that changes anything. If not, I'm at a loss. I suppose I'll just have to delete that script and go with something else.

It didn't. Deleting the script all together. Won't be having a HasItem function in this map.

Thanks for your help guys. Smile


RE: HasItem scripting help - FlawlessHappiness - 01-30-2014

It sucks that we didn't find error. It had to be there somewhere.

But hey. If you can't find a direct path, try sneaking around the backdoor