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 cant get multi script to work
BirdMan1988 Offline
Junior Member

Posts: 5
Threads: 3
Joined: Aug 2012
Reputation: 0
#1
cant get multi script to work

Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{
}

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

}

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

}
08-11-2012, 05:51 AM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#2
RE: cant get multi script to work

(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}

[Image: theshanusyoutube.jpg]
(This post was last modified: 08-11-2012, 10:19 AM by The Shanus.)
08-11-2012, 10:18 AM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#3
RE: cant get multi script to work

(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}

CURRENT PROJECT:
A Fathers Secret == Just started
08-11-2012, 02:23 PM
Find
BirdMan1988 Offline
Junior Member

Posts: 5
Threads: 3
Joined: Aug 2012
Reputation: 0
#4
RE: cant get multi script to work

(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}
[/quote]

thanks for the help , the script loads on the map with out crashin , but how ever they key wont show in inventory . eny help would be apreshated thanks agin

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");
}

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

}

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

}
(This post was last modified: 08-11-2012, 04:56 PM by BirdMan1988.)
08-11-2012, 04:09 PM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#5
RE: cant get multi script to work

(08-11-2012, 04:09 PM)BirdMan1988 Wrote:
(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}

thanks for the help , the script loads on the map with out crashin , but how ever they key wont show in inventory . eny help would be apreshated thanks agin

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");
}

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

}

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

}


What is it you're trying to say? I don't understand.

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
08-12-2012, 10:23 PM
Website Find




Users browsing this thread: 1 Guest(s)