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
[HELP] Script Enabling/Variables
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#21
RE: [HELP] Script Enabling/Variables

Yes, try it out anyway.

Think, before you speak Google, before you post
07-05-2012, 10:14 PM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#22
RE: [HELP] Script Enabling/Variables

Doesn't work.
07-06-2012, 01:16 AM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#23
RE: [HELP] Script Enabling/Variables

Sorry, messed up.
Instead of using a UseItematEntity Callback, use this:

SetEntityCallbackFunc("name of furnace here", "IgnitetheFurnace");

void IgnitetheFurnace(string &in asEntity, string &in type)
{
if(type == "OnIgnite")
{
//Stuff to happen here
}
}

Think, before you speak Google, before you post
(This post was last modified: 07-06-2012, 01:54 AM by Cruzore.)
07-06-2012, 01:39 AM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#24
RE: [HELP] Script Enabling/Variables

ERR: 'type' is not declared
ERR: Expression must be of a boolean type
07-06-2012, 03:24 AM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#25
RE: [HELP] Script Enabling/Variables

Ah, and when I put "" around type it still does not operate correctly.
07-06-2012, 05:50 AM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#26
RE: [HELP] Script Enabling/Variables

paste your script again.

Think, before you speak Google, before you post
07-06-2012, 09:21 AM
Find
himynamebob1 Offline
Member

Posts: 57
Threads: 12
Joined: Jun 2012
Reputation: 0
#27
RE: [HELP] Script Enabling/Variables

//===========================================
// This runs when the player enters the map
void OnStart()
{
AddUseItemCallback("phekeg", "breakkegknife", "winekegpop", "boomkegopen", true);
AddTimer("brute", 13.0f, "noisy");
SetEntityCallbackFunc("bonfire_1", "boomkegopen22");

}
void boomkegopen22(string &in asItem, string &in asEntity)
{
if("type" == "OnIgnite")
{
AddUseItemCallback("phekegs2", "fullowine", "sheetmet", "boomkegopen23", true);
}
}


void boomkegopen23(string &in asItem, string &in asEntity)
{
SetEntityActive("glasnotdone", true);
RemoveItem("fullowine");
AddTimer("brute223", 5.0f, "outahere34");
}

void outahere34(string &in asTimer)
{
if(GetGlobalVarInt("proccess")==2)
{
SetEntityActive("glasnotdone", false);
SetEntityActive("done", true);
}

}

void boomkegopen2(string &in asItem, string &in asEntity)
{
SetEntityActive("glass_container_2", true);
AddTimer("brute223", 5.0f, "outahere3");
RemoveItem("glass_container_1");
PlaySoundAtEntity("bruto23", "19_pour_blood.snt", "Player", 0.0f, false);
}

void outahere3(string &in asTimer)
{
SetEntityActive("glass_container_2", false);
SetEntityActive("fullowine", true);
}

void boomkegopen(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("bruto2", "19_inject.snt", "Player", 0.0f, false);
SetEntityActive("breakkeg_1", true);
AddTimer("brute23", 2.0f, "outahere");
RemoveItem("breakkegknife");
AddUseItemCallback("phekegs", "glass_container_1", "boardone", "boomkegopen2", true);
}

void outahere(string &in asTimer)
{
SetEntityActive("wineout", true);
SetEntityActive("breakkeg_1", false);
FadeInSound("wineout", 1.0f, true);
CreateParticleSystemAtEntity("hhgh", "ps_liquid_epoxy.ps", "breakkeg_1", true);
}

void noisy(string &in asTimer)
{
PlaySoundAtEntity("bruto", "enabled01.snt", "brutenoise", 0.0f, false);
AddTimer("brute2", 4.5f, "noie");
}

void noie(string &in asTimer)
{
PlayMusic("04_amb.ogg", true, 1.0, 0.0f, 0, false);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}
07-06-2012, 07:49 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#28
RE: [HELP] Script Enabling/Variables

SetEntityCallbackFunc("bonfire_1", "boomkegopen22");

}
void boomkegopen22(string &in asItem, string &in asEntity)

wrong callback snytax.
change it to:

void boomkegopen22(string &in asEntity, string &in type)

It doesn't really matter what you name them, but you asked for "type", but you declared the type as "asEntity".

Think, before you speak Google, before you post
07-06-2012, 08:58 PM
Find




Users browsing this thread: 3 Guest(s)