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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Acid Scare
T122002 Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 1
#1
Acid Scare

Hi everybody! I'm trying to figure out how to do a simple Acid Scare.
I originally wanted to make something kind of close, but at the same time, not close to the original game when you have to get the acid in the Northern Prison level.

I tried using my own stuff, like names, however nothing worked. So I copied the original games coding and now everything works fine. However, now that the player has the jar filled with acid, I want him/her to collide with a script area shortly after which will spawn a suitor nearby. Although, that little script function wont work at all. I've tried using if statements and timers, but nothing will spawn the suitor.

Here is my coding:

void OnStart()
/////ADD USE ITEM CALLBACK/////
AddUseItemCallback("bottleEcon", "glass_container_1", "acid_container_1", "UseBottle", true);

void UseBottle(string &in asItem, string &in asEntity)
{
if(asItem == "glass_container_1"){
PlaySoundAtEntity("fillbottle", "puzzle_acid_success", asEntity, 1.0f, false);

RemoveItem(asItem);
GiveItemFromFile("glass_container_filled", "glass_container_filled.ent");

SetMessage("Ch02Level15", "AcidInJar", 0);

GiveSanityBoostSmall();

CompleteQuest("15Acid", "15Acid");
}
else if(asItem == "glass_container_filled"){
SetMessage("Ch02Level15", "AcidAlreadyInJar", 0);
}
else SetMessage("Ch02Level15", "AcidWithItem", 0);
}


/////SET ENTITY CALLBACK FUNC/////
SetEntityCallbackFunc("glass_container_filled", "SuitorScare");

void SuitorScare(string &in asEntity, string &in type)
{
SetEntityActive("SpawnEnemy", true);
AddEntityCollideCallback("Player", "SpawnEnemy", "SpawnSatan", true, 1);
}

void SpawnSatan(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy_1", true);
}


When I change the scripting on the SetEntityCallbackFunc from "glass_container_filled" to "glass_container_1" then the script box goes off before I even fill the container with acid. The script box to collide with to spawn the Suitor is called "SpawnEnemy" which is set to inactive. However, when I change the name of the container to "glass_container_1", the script goes off spawning the monster despite being inactive and with no acid.

Can anyone help me out here?
10-21-2013, 04:25 AM
Find


Messages In This Thread
Acid Scare - by T122002 - 10-21-2013, 04:25 AM
RE: Acid Scare - by DnALANGE - 10-21-2013, 01:35 PM
RE: Acid Scare - by FlawlessHappiness - 10-21-2013, 08:14 PM
RE: Acid Scare - by T122002 - 10-22-2013, 03:07 AM
RE: Acid Scare - by Wapez - 10-21-2013, 09:01 PM
RE: Acid Scare - by daortir - 10-22-2013, 02:55 PM
RE: Acid Scare - by T122002 - 10-23-2013, 03:57 AM
RE: Acid Scare - by Wapez - 10-23-2013, 08:11 AM
RE: Acid Scare - by T122002 - 10-23-2013, 09:58 PM
RE: Acid Scare - by Wapez - 10-24-2013, 10:45 AM
RE: Acid Scare - by T122002 - 10-24-2013, 06:26 PM
RE: Acid Scare - by Wapez - 10-24-2013, 08:55 PM
RE: Acid Scare - by Wapez - 10-25-2013, 10:38 AM
RE: Acid Scare - by T122002 - 10-26-2013, 03:49 AM
RE: Acid Scare - by Wapez - 10-26-2013, 01:56 PM



Users browsing this thread: 1 Guest(s)