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 order?
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#1
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
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Script order?

Could you post the script please?
03-10-2013, 10:33 AM
Find
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#3
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()
{

}
(This post was last modified: 03-10-2013, 10:44 AM by mrsomeepicrandomguy.)
03-10-2013, 10:43 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#4
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 ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 10:47 AM
Find
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#5
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#6
RE: Script order?

Have you tested it ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 11:10 AM
Find
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#7
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#8
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.

[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 11:27 AM
Find
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#9
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
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#10
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
Find




Users browsing this thread: 1 Guest(s)