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 issue
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#1
script issue

I have this script under void onstart () and it wont work, does it go under void onenter () onstead ?

AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScript", true, 1);
}
void CollideScript(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
10-03-2010, 02:32 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#2
RE: script issue

(10-03-2010, 02:32 PM)LoneWolf Wrote: Void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScript", true, 1);
}

void CollideScript(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}

nope it is supposed to be like this.
Make sure the names are correct and that there are no spelling errors.
10-03-2010, 03:26 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#3
RE: script issue

Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map.

Check my thread saying, hwo to make water work i have stated my problems there, as my water should also work btu it wont update, and yes ive saved my map as the right one and quit and restart it all works on my level editor but not in my game.
10-03-2010, 04:09 PM
Find
Mofo Offline
Member

Posts: 71
Threads: 4
Joined: Sep 2010
Reputation: 2
#4
RE: script issue

(10-03-2010, 04:09 PM)LoneWolf Wrote: Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map.

Check my thread saying, hwo to make water work i have stated my problems there, as my water should also work btu it wont update, and yes ive saved my map as the right one and quit and restart it all works on my level editor but not in my game.

It might have something to do with the update, check this notice: http://www.frictionalgames.com/forum/thread-4822.html
10-03-2010, 04:14 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#5
RE: script issue

(10-03-2010, 04:14 PM)Mofo Wrote:
(10-03-2010, 04:09 PM)LoneWolf Wrote: Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map.

Check my thread saying, hwo to make water work i have stated my problems there, as my water should also work btu it wont update, and yes ive saved my map as the right one and quit and restart it all works on my level editor but not in my game.

It might have something to do with the update, check this notice: http://www.frictionalgames.com/forum/thread-4822.html



Thanks thats it all fixed now. Im off to test everythign out Big Grin Thanks!
10-03-2010, 04:20 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#6
RE: script issue

Hmm... everythign works apart from that script i'm not sure where to use tokens to here my script in full. Please tell me if theres anythign wrong because the script for the door works perfect but the door close and the enemy sees player doesnt work.



////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_arched01_3", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_arched01_3", 0, false);
RemoveItem("StudyKey");
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
10-03-2010, 07:41 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#7
RE: script issue

AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);

Shouldn't this part be under the OnStart()?

If not you functions are dependent and may be causing your problem.
10-03-2010, 09:46 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#8
RE: script issue

(10-03-2010, 09:46 PM)HakePT Wrote: AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);

Shouldn't this part be under the OnStart()?

If not you functions are dependent and may be causing your problem.

Okay this is what i changed it all to now - (i will try it out tomorrow but if anyone knows how to get all my scripting to work then please tell me, my door+key works but i dont want to mess aroudn more and end up with nothing working).

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
{
AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
10-03-2010, 10:02 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#9
RE: script issue

(10-03-2010, 10:02 PM)LoneWolf Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
{
AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
*(shouldn't there be code here unlocking the door? your door unlock won't work like this)*
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
10-04-2010, 12:49 AM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#10
RE: script issue

Thanks it all works now, and yes i missed 3 lines out from my script dont know how i missed it when copying.

My only issue is that the stupid monster doesnt know how to open doors, i put it in the room and when it finds me it just stays in the room not knowing how to get out of it, even when i make a noise or hit door it stays in then eventually after 1 min of hitting the door it'll break the door down. Is there anythign i can do to sort this issue out?
10-04-2010, 09:35 AM
Find




Users browsing this thread: 1 Guest(s)