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
scrip help please
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
scrip help please

this scrip wont work help please
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "sewer_arched_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}



void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
////////////////////////////
// Run when entering map
void OnEnter()
{
}

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

}
04-03-2012, 02:55 PM
Find
stonecutter Offline
Member

Posts: 140
Threads: 17
Joined: Feb 2011
Reputation: 4
#2
RE: scrip help please

you missed an " } " at the end of the "void CollideAreaBreakDoor" function !

We Shall Arise - Death / Grind from Bavaria
Musicvideo : http://goo.gl/HzxvLK
Facebook : http://goo.gl/9YfYCV
Free Album : http://goo.gl/sEBW2X
04-03-2012, 03:07 PM
Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#3
RE: scrip help please

where
oh thanks

how should it look
(This post was last modified: 04-03-2012, 03:16 PM by abe.lloyd.)
04-03-2012, 03:15 PM
Find
stonecutter Offline
Member

Posts: 140
Threads: 17
Joined: Feb 2011
Reputation: 4
#4
RE: scrip help please

simply :

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

We Shall Arise - Death / Grind from Bavaria
Musicvideo : http://goo.gl/HzxvLK
Facebook : http://goo.gl/9YfYCV
Free Album : http://goo.gl/sEBW2X
(This post was last modified: 04-03-2012, 03:29 PM by stonecutter.)
04-03-2012, 03:29 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: scrip help please

More specifically, if you just want to copy and paste:

Everything will work with that script, but please know what you did wrong, instead of just copying the new script! Smile

////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "sewer_arched_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 04-03-2012, 03:42 PM by JetlinerX.)
04-03-2012, 03:40 PM
Website Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#6
RE: scrip help please

it says cannotuse item this way
04-03-2012, 03:57 PM
Find
Musier Offline
Junior Member

Posts: 19
Threads: 3
Joined: Jan 2012
Reputation: 0
#7
RE: scrip help please

OK.I think I should help you ... After the turn of the script you have used?


[Image: lolfeminizemasteryibyki.jpg]


I will show you the path
04-03-2012, 04:04 PM
Website Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#8
RE: scrip help please

um ok
04-03-2012, 04:08 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#9
RE: scrip help please

Are you sure all the names in the level editor are correct?

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 04-03-2012, 04:15 PM by JetlinerX.)
04-03-2012, 04:14 PM
Website Find
abe.lloyd Offline
Junior Member

Posts: 15
Threads: 2
Joined: Mar 2012
Reputation: 0
#10
RE: scrip help please

no why
04-03-2012, 04:15 PM
Find




Users browsing this thread: 3 Guest(s)