The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
LocalVar
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
LocalVar

Hi got this small problem with my script.

Spoiler below!

void OnStart()
{
SetLocalVarInt("InsaneImages", 0);
AddEntityCollideCallback("Player", "AreaActivateInteract", "ActivateInsaneImages", true, 1);
}

void ActivateInsaneImages(string &in asParent, string &in asChild, int alState)
{
for(int i=1;i<=3;i++) {
SetEntityPlayerInteractCallback("Flask_"+i+"", "AddLocalNumber", false);
}
}

void AddLocalNumber(string &in asEntity)
{
if(GetLocalVarInt("InsaneImages") == 1)
{
SetEntityActive("armour_nice_complete_1", true);
SetEntityActive("", true);

}

if(GetLocalVarInt("InsaneImages") == 2)
{
SetEntityActive("armour_nice_complete_2", true);
SetEntityActive("", true);

}

AddLocalVarInt("InsaneImages", 1);
All_Active();
}

void All_Active()
{
if(GetLocalVarInt("InsaneImages") == 3)
{
SetEntityActive("armour_nice_complete_3", true);
SetEntityActive("", true);
}
}



After I've interacted with 1 flask, doesn't matter which one, 1 armour is supposed to get active This, however, doesn't really work exactly to plan.

If I for instance interact with flask_3 first all armours gets activated, regardless if I've interacted with the other 2. If I interact with flask_1 nothing happens, this also goes for flask_2. However if I interact with 1 and then 2 or the other way around only 1 armour gets activated.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 09-12-2012, 12:46 PM by i3670.)
09-11-2012, 10:43 PM
Find


Messages In This Thread
LocalVar - by i3670 - 09-11-2012, 10:43 PM
RE: LocalVar - by Adny - 09-11-2012, 11:16 PM
RE: LocalVar - by Tomato Cat - 09-11-2012, 11:16 PM
RE: LocalVar - by FlawlessHappiness - 09-12-2012, 07:01 AM



Users browsing this thread: 1 Guest(s)