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
Scripts with AddLocalVarInt
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
Scripts with AddLocalVarInt

I've got one last script to complete until my custom story is finished. However I cannot get it to work. This is how I intended it to be.

1. Pull a lever (collide script) and you will get AddLocalVarInt

2. Then I've made a script that checks if the player has this localvarint, which he now got.

3. Now, a timer SHOULD start and play a sound + shake the entire room.

Now the last thing does not happen. I would think I'm not supposed to use AddLocalVarInt. But what am I supposed to use instead? Script down below incase you need it. I'm very sorry if I might confuse you with my english, but I cannot help it Sad

//Western piston
void ActivateWestPiston(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("barrier_piston_1", -0.3);
PlaySoundAtEntity("", "17_piston_move", "barrier_piston_1", 1.0f, false);
SetEntityInteractionDisabled("button_simple_4", true);

AddLocalVarInt("EastPiston", 1);
}
//Eastern piston
void ActivateEastPiston(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("barrier_piston_2", -0.3);
PlaySoundAtEntity("", "17_piston_move", "barrier_piston_2", 1.0f, false);
SetEntityInteractionDisabled("button_simple_3", true);

AddLocalVarInt("WestPiston", 1);
}
//Pour down the potion in the machine
void PotionOnMachine(string &in asItem, string &in asEntity)
{
GiveSanityBoostSmall();
SetMessage("Messages", "PotionPouredDown", 0);
RemoveItem(asItem);

GiveItemFromFile("glass_container_1", "glass_container.ent");

AddLocalVarInt("PotionPoured", 1);

//The pistons are pulled and the potion has been poured in the machine
if(GetLocalVarInt("WestPiston")==1)
{
AddTimer("explosion", 3.0f, "TimerMachineTheme");
AddTimer("quests", 9.0f, "TimerMachineTheme");

SetEntityActive("ScriptArea_1", false);
SetEntityActive("AreaGetPotionBack", false);
}
}
//The timer for the machine
void TimerMachineTheme(string &in asTimer)
{
if(asTimer == "explosion"){
PlaySoundAtEntity("implodoelexplodo", "27_orb_implode.snt", "Player", 0.0f, false);
StartScreenShake(0.2f, 6, 0.5f, 3);
}
if(asTimer == "quests"){
//Complete all quests that has anything to do with this
CompleteQuest("MagicPotionFail", "MagicPotionFail");
CompleteQuest("PotionPourDownManual", "PotionPourDownManual");
CompleteQuest("BrokenButtonsDownstairs", "BrokenButtonsDownstairs");

GiveSanityBoostSmall();
PlayMusic("13_puzzle_machine.ogg", false, 1.0f, 0.5f, 10, false);

SetGlobalVarInt("BarrierMachineFixed", 1);
}
}
06-12-2013, 08:08 PM
Find


Messages In This Thread
Scripts with AddLocalVarInt - by Neelke - 06-12-2013, 08:08 PM
RE: Scripts with AddLocalVarInt - by Bridge - 06-12-2013, 09:14 PM
RE: Scripts with AddLocalVarInt - by Neelke - 06-12-2013, 09:30 PM
RE: Scripts with AddLocalVarInt - by Bridge - 06-12-2013, 09:59 PM
RE: Scripts with AddLocalVarInt - by Adrianis - 06-13-2013, 12:25 PM
RE: Scripts with AddLocalVarInt - by Bridge - 06-13-2013, 10:09 PM



Users browsing this thread: 1 Guest(s)