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
Script Help String?
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#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
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: String?

Do any other scripts work?

02-08-2012, 09:10 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: String?

Is masterbedroomdoor a swing door or a level door?

Tutorials: From Noob to Pro
02-08-2012, 09:32 AM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#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
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#8
RE: String?

Do it in void OnStart instead of void OnEnter

02-08-2012, 10:11 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#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




Users browsing this thread: 2 Guest(s)