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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help String?
Author Message
Saren Offline
Member

Posts: 196
Joined: Jan 2012
Reputation: 1
Post: #1
String?
It was mentioned to me I need to make variables to strings... or something, in my .hps file.. how does that work exactly, I have tried to find something about it without luck..... can anyone clarify? The .hps file looks like this:
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false);
RemoveItem("Masterbedroomkey");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
As you can see, no errors, but apparently still wrong since my key won't open the door it suppose to

02-08-2012 08:54 AM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #2
RE: String?
Do any other scripts work?

02-08-2012 09:10 AM
Find all posts by this user Quote this message in a reply
Saren Offline
Member

Posts: 196
Joined: Jan 2012
Reputation: 1
Post: #3
RE: String?
My first xD
But my lang file works, there's description, name of the key, and all that

02-08-2012 09:24 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,229
Joined: Jul 2011
Reputation: 215
Post: #4
RE: String?
Is masterbedroomdoor a swing door or a level door?

Tutorials: From Noob to Pro
02-08-2012 09:32 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Saren Offline
Member

Posts: 196
Joined: Jan 2012
Reputation: 1
Post: #5
RE: String?
(02-08-2012 09:32 AM)Your Computer Wrote:  Is masterbedroomdoor a swing door or a level door?
Just a normal castle door

02-08-2012 09:34 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,229
Joined: Jul 2011
Reputation: 215
Post: #6
RE: String?
(02-08-2012 09:34 AM)Saren Wrote:  Just a normal castle door

Believe it or not, that is still vague. Swing doors can be swung open, level doors cannot. If the door is a swing door, then either the key name or door name or both are wrong, or the .hps file doesn't have the same name as the .map file. If it is not a swing door, then you're using the wrong function to unlock the door. Or it's a .map_cache conflict, or something random.

Tutorials: From Noob to Pro
02-08-2012 09:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Saren Offline
Member

Posts: 196
Joined: Jan 2012
Reputation: 1
Post: #7
RE: String?
(02-08-2012 09:39 AM)Your Computer Wrote:  
(02-08-2012 09:34 AM)Saren Wrote:  Just a normal castle door

Believe it or not, that is still vague. Swing doors can be swung open, level doors cannot. If the door is a swing door, then either the key name or door name or both are wrong, or the .hps file doesn't have the same name as the .map file. If it is not a swing door, then you're using the wrong function to unlock the door. Or it's a .map_cache conflict, or something random.
1. It's the second door, castle_Arched
2. both have the exact names in both the .lang and .hps
3. Same name
4. Map cache has already been destroyed

02-08-2012 09:45 AM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #8
RE: String?
Do it in void OnStart instead of void OnEnter

02-08-2012 10:11 AM
Find all posts by this user Quote this message in a reply
Saren Offline
Member

Posts: 196
Joined: Jan 2012
Reputation: 1
Post: #9
RE: String?
(02-08-2012 10:11 AM)flamez3 Wrote:  Do it in void OnStart instead of void OnEnter
Alright, gonna try that
Edit: Damn... no luck =(
Double Edit: wait, it worked, there was a spelling mistake on the door... that's why... lol, thanks for the help though guys =)

(This post was last modified: 02-08-2012 10:51 AM by Saren.)
02-08-2012 10:20 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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