Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"if" remove message [Solved :D]
Author Message
DannieWest Offline
Member

Posts: 156
Joined: Apr 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 


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



User(s) browsing this thread: 1 Guest(s)