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
"if" remove message [Solved :D]
DannieWest Offline
Member

Posts: 156
Threads: 13
Joined: Apr 2011
Reputation: 0
#1
"if" remove message [Solved :D]

Searched the forum, and couldn't really find a thread to help me, neither could I fully understand the one on the wiki, so I hope maybe one of you guys can make me understand a bit more Undecided
So I've been trying to understand how "if" actually works, I know it's something with locked door got state 0 and unlocked like 1, and if it's 1 something happens, and 0 something else happens, but i have no clue how to script it, and where to put which line of code Confused

This is my script, and what I wanna do is remove the message after the door is unlocked :o
Spoiler below!
void OnStart()

{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
}
AddUseItemCallback("", "Honey", "mansion_1", "UsedHoneyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "TriggerFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Ragdoll", true, 1);
SetEntityPlayerInteractCallback("mansion_1", "LockedDoor", false);
}

void LockedDoor(string &in entity)
{
SetMessage("TestStory", "ItemDesc_mansion_1", 0);
}

void UsedHoneyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
RemoveItem("Honey");
}
(This post was last modified: 06-28-2011, 12:36 AM by DannieWest.)
05-30-2011, 02:34 PM
Find


Messages In This Thread
"if" remove message [Solved :D] - by DannieWest - 05-30-2011, 02:34 PM
RE: "if" remove message - by Apjjm - 05-30-2011, 02:56 PM
RE: "if" remove message - by Kyle - 05-30-2011, 02:57 PM
RE: "if" remove message - by DannieWest - 05-30-2011, 04:13 PM
RE: "if" remove message - by Apjjm - 05-30-2011, 05:19 PM
RE: "if" remove message - by Kyle - 05-30-2011, 04:53 PM
RE: "if" remove message - by DannieWest - 05-30-2011, 10:00 PM



Users browsing this thread: 1 Guest(s)