Hello again, I guess. I'm trying to make a script where if you look at a object, a message appears, but it ain't working. I'm pretty noobish at scripting, and I know that everyone says that, but hey.
.hps code:
void OnStart()
{
AddUseItemCallback("", "key1", "door01", "func", true);
AddUseItemCallback("", "chip", "door01", "afunc", true);
SetPlayerLampOil(0);
SetMessage("Messages", "start", 4);
AddEntityCollideCallback("Player", "act", "actfunc", true, 1);
}
void func(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
AddQuest("", "KeyBroke");
}
void afunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
CompleteQuest("", "KeyBroke");
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
}
void actfunc (string &in asItem, string &in asEntity)
{
SetMessage("Messages", "uh", 6);
}
.lang code:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">A small custom story.</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_key1">My Room Key</Entry>
<Entry Name="ItemDesc_key1">Rusty as hell.</Entry>
<Entry Name="ItemName_chip">a Nail</Entry>
<Entry Name="ItemDesc_chip">A little bit too big for it's own good. Presumebly I can use this on the door.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_Note01_Name">What?</Entry>
<Entry Name="Note_Note01_Text">What for sure.</Entry>
<Entry Name="Quest_KeyBroke_Text">The key broke somehow, I need to look for some key-like item around my room.
</Entry>
</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name ="start">What was that noise?!</Entry>
<Entry Name ="uh">Uh oh... That does not look good.</Entry>
</CATEGORY>
</LANGUAGE>
And again, any help is appreciated.