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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text ingame- Script help
Xeronaile Offline
Junior Member

Posts: 21
Threads: 2
Joined: Jan 2012
Reputation: 0
#1
Text ingame- Script help

Since I am an amateur at scripting, or I should say I have no scripting abilities at all besides Void Onstart, Etc.
I made a post asking how to make the custom story show up, and I have that working. But right now I'm trying to give you, the player the ability to see directions on the screen when I walk in front of my door that is locked.

Here is what my .Hps file looks like:

AddEntityCollideCallback("Player","AreaHelp","CollidePlayerWithAreaHelp");

void CollidePlayerWithAreaHelp()
{
if(HasItem("cellar_key") == true)
{
SetMessage("This key will unlock the door.", 5);
}
else
{
SetMessage("GAH! Locked... I will need a key.", 5);
}


}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

_______________________________________
As you can see I have everything above the OnStart or OnEnter (I was following the directions for scripting on the wiki). Near my locked door, or directly in front of it I have an area called AreaHelp, then near that area, I have a desk with a key inside of it with the name of (And yes the name that I gave it, not the actual name of the entity) cellar_key, but it's actually a key_study.


Does anyone see anything wrong with it? If someone could tell me how to take screenshots of my level editor on windows then please tell me (I've been too lazy to find out how), and if I have anything wrong please highlight them in bold, or just tell me.


Thanks
- Huh Xero
01-22-2012, 04:17 PM
Find


Messages In This Thread
Text ingame- Script help - by Xeronaile - 01-22-2012, 04:17 PM
RE: Text ingame- Script help - by Unearthlybrutal - 01-22-2012, 04:25 PM
RE: Text ingame- Script help - by Xeronaile - 01-22-2012, 04:39 PM
RE: Text ingame- Script help - by Unearthlybrutal - 01-22-2012, 04:42 PM
RE: Text ingame- Script help - by Xeronaile - 01-22-2012, 04:46 PM
RE: Text ingame- Script help - by Xeronaile - 01-22-2012, 07:22 PM
RE: Text ingame- Script help - by Unearthlybrutal - 01-22-2012, 07:26 PM
RE: Text ingame- Script help - by Xeronaile - 01-22-2012, 09:31 PM
RE: Text ingame- Script help - by Xeronaile - 01-22-2012, 11:24 PM
RE: Text ingame- Script help - by Unearthlybrutal - 01-23-2012, 12:02 PM
RE: Text ingame- Script help - by Xeronaile - 02-01-2012, 02:51 AM



Users browsing this thread: 1 Guest(s)