Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HasItem scripting help
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#11
RE: HasItem scripting help

(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. -.-

(This post was last modified: 01-30-2014, 07:54 AM by MsHannerBananer.)
01-30-2014, 07:27 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#12
RE: HasItem scripting help

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.

Trying is the first step to success.
01-30-2014, 09:04 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#13
RE: HasItem scripting help

Maybe the area is inactive?

01-30-2014, 05:17 PM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#14
RE: HasItem scripting help

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);
}

}


01-30-2014, 06:02 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#15
RE: HasItem scripting help

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.

Trying is the first step to success.
01-30-2014, 09:28 PM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#16
RE: HasItem scripting help

(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

(This post was last modified: 01-30-2014, 10:06 PM by MsHannerBananer.)
01-30-2014, 09:36 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#17
RE: HasItem scripting help

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

Trying is the first step to success.
(This post was last modified: 01-30-2014, 10:23 PM by FlawlessHappiness.)
01-30-2014, 10:23 PM
Find




Users browsing this thread: 3 Guest(s)