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
Script help
Rakez68 Offline
Junior Member

Posts: 11
Threads: 3
Joined: Mar 2013
Reputation: 0
#11
RE: Script help

Then you use AddUseItemCallback then.

I know. But there came this problem what I said earlier:

''I have another problem now, something I can't understand.

I pick up all four chemicals, and I try to put them into the pot (which is on the table). There does not come text ''Cannot use this item this way.'' But the SECOND time I try, there comes the text.
The item does not disappear from my inventory, and no sound effect plays.
After putting all four chemicals to the pot, nothing happens. It is supposed to play the event after all 4 chemicals have been put into the pot.''

But clearly there happens something when it doesn't give me ''Cannot use this item this way'' message when trying to put one of the chemicals into the pot. On second attempt however, it does give the message.

Never encountered something like this before.

This is the script once again:

void OnStart()
{
SetLocalVarInt("Var1", 0);
for(int i=1;i<=4;i++) AddUseItemCallback("Chemicals", "Chem"+i, "GetAcidComplete", "UsedChemsOnPot", true);
}
void UsedChemsOnPot(string &in asItem, string &in asEntity)
{

if("asParent" == "Chem1" && GetLocalVarInt("Var1") == 1)

{
AddLocalVarInt("Var1", 1);
RemoveItem("Chem1");
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}
else if("asParent" == "Chem2" && GetLocalVarInt("Var1") == 1)
{
AddLocalVarInt("Var1", 1);
RemoveItem("Chem2");
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}
else if("asParent" == "Chem3" && GetLocalVarInt("Var1") == 1)
{
AddLocalVarInt("Var1", 1);
RemoveItem("Chem3");
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}
else if("asParent" == "Chem4" && GetLocalVarInt("Var1") == 1)
{
AddLocalVarInt("Var1", 1);
RemoveItem("Chem4");
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}

if(GetLocalVarInt("Var1") == 4)
{
GiveSanityBoostSmall();
SetEntityActive("GetAcidComplete", false);
SetEntityActive("chemical_container_full_1", true);
PlayMusic("26_event_agrippa_head.ogg", false, 0.7, 0.1, 10, false);
}
}

Also:
All item names are correct.
(This post was last modified: 03-27-2013, 04:11 PM by Rakez68.)
03-27-2013, 04:09 PM
Find


Messages In This Thread
Script help - by Rakez68 - 03-27-2013, 01:36 PM
RE: Script help - by Adrianis - 03-27-2013, 01:56 PM
RE: Script help - by Rakez68 - 03-27-2013, 02:08 PM
RE: Script help - by Adrianis - 03-27-2013, 02:15 PM
RE: Script help - by Rakez68 - 03-27-2013, 02:46 PM
RE: Script help - by PutraenusAlivius - 03-27-2013, 02:55 PM
RE: Script help - by Rakez68 - 03-27-2013, 03:23 PM
RE: Script help - by PutraenusAlivius - 03-27-2013, 03:27 PM
RE: Script help - by Rakez68 - 03-27-2013, 03:39 PM
RE: Script help - by PutraenusAlivius - 03-27-2013, 03:40 PM
RE: Script help - by Rakez68 - 03-27-2013, 04:09 PM
RE: Script help - by Adrianis - 03-27-2013, 04:11 PM
RE: Script help - by Rakez68 - 03-27-2013, 04:50 PM
RE: Script help - by Adrianis - 03-27-2013, 05:44 PM



Users browsing this thread: 1 Guest(s)