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
How to make a hallucination event.
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#7
RE: How to make a hallucination event.

(04-09-2011, 02:40 PM)ZxBrad Wrote: I put those in heres my hps file rite now.

*insert code*

And when i try to start my map up it crashes on me.
As you can see in the AddUseItemCallback you have a "AutoDestroy" parameter, that means you can set that too true and you won't have to remove the item with RemoveItem("doorkey_1");.
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);

Allows the player to use items on the world.
Callback syntax: void MyFunc(string &in asItem, string &in asEntity)

asName - internal name
asItem - internal name of the item
asEntity - entity to be able to use the item on
asFunction - function to call
abAutoDestroy - determines whether the item is destroyed when used

The thing that is crashing your game is this part
{
  AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
That's supposed to be in the OnStart function. Here is a cleaned up script for you
// Run first time starting map
void OnStart()
{
    SetMessage("Journal", "start", 8.0f);
    AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
    AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("castle_1", false, true);
    PlaySoundAtEntity("", "unlock_door.snt", "castle_1", 0, false);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
  SetEntityActive("servant_grunt_1" , true);
}
04-09-2011, 03:01 PM
Find


Messages In This Thread
How to make a hallucination event. - by ZxBrad - 04-09-2011, 01:29 PM
RE: How to make a hallucination event. - by Dalroc - 04-09-2011, 03:01 PM



Users browsing this thread: 1 Guest(s)