mrsomeepicrandomguy
Member
Posts: 74
Threads: 15
Joined: Feb 2013
Reputation:
0
|
Script order?
Hello, i have a question. If a have a message before a door unlock in my script, why cant i use the key before i see the message? is it just me being retard? :p
|
|
03-10-2013, 10:26 AM |
|
OriginalUsername
Posting Freak
Posts: 896
Threads: 42
Joined: Feb 2013
Reputation:
34
|
RE: Script order?
Could you post the script please?
|
|
03-10-2013, 10:33 AM |
|
mrsomeepicrandomguy
Member
Posts: 74
Threads: 15
Joined: Feb 2013
Reputation:
0
|
RE: Script order?
(03-10-2013, 10:33 AM)Smoke Wrote: Could you post the script please?
void OnStart()
{
void Message1(string &in asChild, string &in asParent, int alState)
}
SetMessage("Messages", "Popup4", 6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
AddEntityCollideCallback("player" , "Scriptarea_1" , "FunctionName" , true , 1);
}
{
AddUseItemCallback("", "key_2", "EXAMPLE_DOOR", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}
void FunctionName(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "unlock_door", "Scriptarea_1", 0, false);
}
void OnLeave()
{
}
|
|
03-10-2013, 10:43 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script order?
(03-10-2013, 10:43 AM)mrsomeepicrandomguy Wrote: (03-10-2013, 10:33 AM)Smoke Wrote: Could you post the script please?
void OnStart()
{
void Message1(string &in asChild, string &in asParent, int alState)
}
SetMessage("Messages", "Popup4", 6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
AddEntityCollideCallback("player" , "Scriptarea_1" , "FunctionName" , true , 1);
}
{
AddUseItemCallback("", "key_2", "EXAMPLE_DOOR", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}
void FunctionName(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "unlock_door", "Scriptarea_1", 0, false);
}
void OnLeave()
{
}
The script is a mess. Are you sure this is your full script ?
|
|
03-10-2013, 10:47 AM |
|
mrsomeepicrandomguy
Member
Posts: 74
Threads: 15
Joined: Feb 2013
Reputation:
0
|
RE: Script order?
(03-10-2013, 10:47 AM)No Author Wrote: (03-10-2013, 10:43 AM)mrsomeepicrandomguy Wrote: (03-10-2013, 10:33 AM)Smoke Wrote: Could you post the script please?
void OnStart()
{
void Message1(string &in asChild, string &in asParent, int alState)
}
SetMessage("Messages", "Popup4", 6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
AddEntityCollideCallback("player" , "Scriptarea_1" , "FunctionName" , true , 1);
}
{
AddUseItemCallback("", "key_2", "EXAMPLE_DOOR", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}
void FunctionName(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "unlock_door", "Scriptarea_1", 0, false);
}
void OnLeave()
{
}
The script is a mess. Are you sure this is your full script ? Yes, Its kinda messy but it does what it should, just that i have to walk into the message area befor i can unlock the door.
|
|
03-10-2013, 10:51 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script order?
Have you tested it ?
|
|
03-10-2013, 11:10 AM |
|
mrsomeepicrandomguy
Member
Posts: 74
Threads: 15
Joined: Feb 2013
Reputation:
0
|
RE: Script order?
(03-10-2013, 11:10 AM)No Author Wrote: Have you tested it ? Yes, everything works, but you have to do it in order, and I don't want that.
|
|
03-10-2013, 11:16 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script order?
I'm very confused right now.
Cuz, the script you post has a void Message on the void OnStart, there's a double "}" on the void OnStart, AND the game doesn't give an error because of that.
|
|
03-10-2013, 11:27 AM |
|
mrsomeepicrandomguy
Member
Posts: 74
Threads: 15
Joined: Feb 2013
Reputation:
0
|
RE: Script order?
(03-10-2013, 11:27 AM)No Author Wrote: I'm very confused right now.
Cuz, the script you post has a void Message on the void OnStart, there's a double "}" on the void OnStart, AND the game doesn't give an error because of that. Thats weird.. know when i looked at it you right. Don't really know what my game is doing..
|
|
03-10-2013, 11:29 AM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Script order?
Try do it like this.
void OnStart()
{
AddEntityCollideCallback("player" , "Scriptarea_1" , "FunctionName" , true , 1);
AddUseItemCallback("", "key_2", "EXAMPLE_DOOR", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
}
void FunctionName(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("", "unlock_door", "Scriptarea_1", 0, false);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup4", 6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
}
void OnLeave()
{
}
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 03-10-2013, 11:45 AM by Lizard.)
|
|
03-10-2013, 11:44 AM |
|
|