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
Multiple Issues Help hps scripting and .lang errors?
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#7
RE: hps scripting and .lang errors?

One thing I'd like to offer advice on that I noticed is that you have 6 callbacks (all of which are exactly the same ) for unlocking doors when you only need one.

The callback syntax for the function is "(string &in asItem, string &in asEntity)"; asItem and asEntity represent whatever corresponding items you used to make the callback (the door and the key in this case); so instead of writing six separate functions, you can write one function using asItem and asEntity instead of the exact name of the key/door. This can greatly reduce scripting clutter:


void OnStart()
{
AddUseItemCallback("", "mansionkey1","mansion3_2","UsedKeyOnDoor",true);
AddUseItemCallback("", "mansionkey2", "mansion3_3", "UsedKeyOnDoor", true);
AddUseItemCallback("", "mansionkey3", "mansion4", "UsedKeyOnDoor", true);
AddUseItemCallback("", "mansionKey4", "mansion4_2", "UsedKeyOnDoor", true);
AddUseItemCallback("", "mansionkey5", "mansion4_3", "UsedKeyOnDoor", true);
AddUseItemCallback("", "mansionkey6", "mansion5", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("note5", "ActivateMonster", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}



As for the lang, you're not supposed to hit enter to create separate lines for entries (your journal for example), you can only use the break "[br]" to do that. I used the xml language in my notepade c++ and it was apparent that using enter caused it to read one entry as several. This fix should work:





Welcome to my first custom story.[br][br]Your name is John Robinson, and you recieve a letter from your father explaining that Brad, your older brother who always picked on you when you were little, has gone missing. His last known whereabouts was when he and other achaeologists were invited to uncover the lost history of old castle Havaria in Prussia.



What was that thing! It was hidious and terrifying, how does such a creature exist? What is going on in this castle?
I'm not really sure what to call it, was it divine protection that saved me or was it just luck. Either way, that thing is trying to kill me anymore.
I feel a sort of calm when i'm in the lab. After what happened with the cave in, it makes me feel like someone is watching over me.



Exit
Eastwing Prison
Eastwing Lab
Eastwing Guest Quarters
Upper Levels
Lower Levels



This door is locked by some sort of mechanism, maybe there is a lever around here somewhere.
The note mentioned that there was a secret door in Ian's study, maybe there is a way to open it around here somewhere
The door to the upper levels is locked, I must find a key somewhere to open it.


Brad's Journal Entry 17
Journal Entry 17[br][br]Dr. Brad Robinson[br][br]It has been several days since my arrival and since we opened that secret door to the depths it has just been one long nightmare. First it was Ian to go missing, then Hilda. I do not know the fate of the other guests, I don't even know if Dad got my letter. I get the feeling that I too will soon end up like Ian and Hilda. If that is to be my fate than there is only one thing that I regret, I wish I could see John again and tell him how sorry I am for all the things I did to him when we were growing up.

Discoveries
Discoveries[br][br]Dr. Ian O'Connell[br][br] We have made some fabulous discoveries since our arrival here at the castle. Just today, Alan stumbled upon a secret lever that opened a passage way, inside we found many texts about the history of the castle, some of the texts referred to other secret rooms through out the castle and one of them being in my study, but I have failed to make this discovery.[br][br]Amongst the texts we uncovered, we found a very peculiar tomb, there was no name of the deceased or a description of whom they were, what they did, or when they were born. we also found what looked to be a ceremonial dagger upon an alter with writings of a language I have never seen before that was inked, to what appeared to be, blood. We removed the dagger for further study and as we did, the tomb began to shake and a glow was coming from inside the sarcophagus, Alan and I gathered what texts we could and we fled the tomb.

Alan's Journal Entry 5
Journal Entry 5[br][br]Dr. Alan Lewis[br][br] Yesterdays discovery was very intriguing and a little nerve racking. I have been studying the dagger we recovered from the tomb for many hours, and I can't make heads or tails of it. The dagger is not like any I have seen and I can't make out what it's even made of, it's as light as a feather and as hard as steel. It's been down in that tomb for a least a hundred years, probably longer, and it looks as if it was just forged yesterday. I gave the dagger to Hilda to study because she used to work with her father at a forgery, maybe she can make some sense of the thing. I keep thinking about what happened in the tomb yesterday, and I can't help but feel as if we have disturbed something that was better left forgotten.



I should read the letter on the desk before I go.
It's locked, I don't want to go back that way anyway.
It's locked, there must be a way to open it.
It won't budge.



Holstein, Prussia[br]Castle Harvaria[br] 1843
Nothing is getting through that door... I don't think.
What just happened?
Is there an angel watching over me?
It's locked.
I don't know what this does, I should leave it alone right now.
This wall looks pretty weak, maybe I and push some of the bricks out of the way.



Upper levels key
This is the key to the upper levels.





Hope that helped! (drunkmonk, Y U STEAL MY LINE? xD)

I rate it 3 memes.
07-06-2012, 05:22 PM
Find


Messages In This Thread
hps scripting and .lang errors? - by Lizard - 07-06-2012, 04:26 PM
RE: hps scripting and .lang errors? - by Lizard - 07-06-2012, 04:59 PM
RE: hps scripting and .lang errors? - by Lizard - 07-06-2012, 05:09 PM
RE: hps scripting and .lang errors? - by Lizard - 07-06-2012, 05:29 PM
RE: hps scripting and .lang errors? - by Adny - 07-06-2012, 05:22 PM
RE: hps scripting and .lang errors? - by Adny - 07-06-2012, 05:39 PM
RE: hps scripting and .lang errors? - by Lizard - 07-06-2012, 05:40 PM
RE: hps scripting and .lang errors? - by Adny - 07-06-2012, 05:47 PM
RE: hps scripting and .lang errors? - by Lizard - 07-06-2012, 05:55 PM



Users browsing this thread: 1 Guest(s)