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
Multiple use of a void OnStart, need help D:
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#11
RE: Multiple use of a void OnStart, need help D:

(03-16-2013, 03:51 PM)JustAnotherPlayer Wrote:
(03-16-2013, 03:49 PM)No Author Wrote: You could have just create a new thread instead bumping a year old thread.

He's a new guy, just get off his back.

I'm sorry I'll keep an eye on the dates from now on.

Also I've fixed my problem, the script doesn't make the game crash anymore, instead it doesn't do anything.
03-16-2013, 03:57 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#12
RE: Multiple use of a void OnStart, need help D:

(03-16-2013, 03:57 PM)KeysOfMyMind Wrote:
(03-16-2013, 03:51 PM)JustAnotherPlayer Wrote:
(03-16-2013, 03:49 PM)No Author Wrote: You could have just create a new thread instead bumping a year old thread.

He's a new guy, just get off his back.

I'm sorry I'll keep an eye on the dates from now on.

Also I've fixed my problem, the script doesn't make the game crash anymore, instead it doesn't do anything.

Give us your fixed script.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-16-2013, 04:02 PM
Find
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#13
RE: Multiple use of a void OnStart, need help D:

void OnStart()
{
AddUseItemCallback("", "crowbar_1", "mansiondoor1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_Joint", "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("mansiondoor1", false, true);
AddPropImpulse("mansiondoor1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("mansiondoor1", true);
SetSwingDoorClosed("mansiondoor1", false, false);
SetMoveObjectState("mansiondoor1", 1);
PlaySoundAtEntity("","break_wood_metal", "ScriptArea_Dust", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "ScriptArea_Dust", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

void Scare()
{
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
}


void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(300000, 0, 0, false);
}


void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansiondoor1", true, true);
SetSwingDoorLocked("mansiondoor1", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_slam", 0, false);
}


Attached Files
.png   push area.png (Size: 345.65 KB / Downloads: 148)
.png   doorslam.png (Size: 461.4 KB / Downloads: 156)
.png   door.png (Size: 444.93 KB / Downloads: 161)
03-16-2013, 04:41 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#14
RE: Multiple use of a void OnStart, need help D:

PHP Code: (Select All)
void OnStart()

{
AddUseItemCallback("""crowbar_1""mansiondoor1""UsedCrowbarOnDoor"true);
AddEntityCollideCallback("crowbar_joint_1""ScriptArea_Joint""CollideAreaBreakDoor"true1);
AddEntityCollideCallback("Player""push""Push"true1);
AddEntityCollideCallback("Player""door_slam""Slam"true1);
}

void UsedCrowbarOnDoor(string &in asItemstring &in asEntity)
{
AddTimer(""0.2"TimerSwitchShovel");
RemoveItem("crowbar_1");
}

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

void CollideAreaBreakDoor(string &in asParentstring &in asChildint alState)

{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg"false0.70.110false);
SetSwingDoorLocked("mansiondoor1"falsetrue); AddPropImpulse("mansiondoor1"00, -50"World");
SetSwingDoorDisableAutoClose("mansiondoor1"true);
SetSwingDoorClosed("mansiondoor1"falsefalse);
SetMoveObjectState("mansiondoor1"1);
PlaySoundAtEntity("","break_wood_metal""ScriptArea_Dust"0false);
CreateParticleSystemAtEntity("""ps_hit_wood""ScriptArea_Dust"false);
SetEntityActive("crowbar_joint_1"false);
SetLocalVarInt("Door"1);


void Push(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""react_pant.snt""push"0false);
AddPlayerBodyForce(-30000000false);
}

void Slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("mansiondoor1"truetrue);
SetSwingDoorLocked("mansiondoor1"truetrue);
PlaySoundAtEntity("""00_laugh.snt""door_slam"0false);

There, i fixed it. You obviously need to understand how a simple script works BEFORE posting a problem on the forums.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 03-17-2013, 02:12 AM by PutraenusAlivius.)
03-17-2013, 02:10 AM
Find
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#15
RE: Multiple use of a void OnStart, need help D:

(03-17-2013, 02:10 AM)JustAnotherPlayer Wrote:
PHP Code: (Select All)
void OnStart()

{
AddUseItemCallback("""crowbar_1""mansiondoor1""UsedCrowbarOnDoor"true);
AddEntityCollideCallback("crowbar_joint_1""ScriptArea_Joint""CollideAreaBreakDoor"true1);
AddEntityCollideCallback("Player""push""Push"true1);
AddEntityCollideCallback("Player""door_slam""Slam"true1);
}

void UsedCrowbarOnDoor(string &in asItemstring &in asEntity)
{
AddTimer(""0.2"TimerSwitchShovel");
RemoveItem("crowbar_1");
}

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

void CollideAreaBreakDoor(string &in asParentstring &in asChildint alState)

{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg"false0.70.110false);
SetSwingDoorLocked("mansiondoor1"falsetrue); AddPropImpulse("mansiondoor1"00, -50"World");
SetSwingDoorDisableAutoClose("mansiondoor1"true);
SetSwingDoorClosed("mansiondoor1"falsefalse);
SetMoveObjectState("mansiondoor1"1);
PlaySoundAtEntity("","break_wood_metal""ScriptArea_Dust"0false);
CreateParticleSystemAtEntity("""ps_hit_wood""ScriptArea_Dust"false);
SetEntityActive("crowbar_joint_1"false);
SetLocalVarInt("Door"1);


void Push(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""react_pant.snt""push"0false);
AddPlayerBodyForce(-30000000false);
}

void Slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("mansiondoor1"truetrue);
SetSwingDoorLocked("mansiondoor1"truetrue);
PlaySoundAtEntity("""00_laugh.snt""door_slam"0false);

There, i fixed it. You obviously need to understand how a simple script works BEFORE posting a problem on the forums.
Gee thanks for the help, nice attitude.
Maybe you might want to work on that BEFORE you post on the forums.
03-17-2013, 08:51 PM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#16
RE: Multiple use of a void OnStart, need help D:

(03-17-2013, 08:51 PM)KeysOfMyMind Wrote: Gee thanks for the help, nice attitude.
Maybe you might want to work on that BEFORE you post on the forums.

He did just help you... (although what he said was rather rude, too). People on here can be a little bit touchy about answering the same question twice (or just sending you to the wiki page). Try these links for help before you post your questions about scripting on the forum:

Beginner's Scripting Guide
List of Scripting Functions

If those don't help, type in a keyword in the search bar on the development-support section of the forum. Chances are other people have the same questions you do. If you've tried that and you're still stuck, open up a script file from TDD in notepad++ (preferably one you know has the function you're looking for) and look at how they did it. Once you've done that, post your question on the forum

And for what it's worth, you can PM me if you have any other questions (scripting or mapping). Not going to lie, I'm not a good scripter - but I understand the basic concepts of it and I know my way around the HPL2's level editor decently.

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 03-18-2013, 05:37 AM by CarnivorousJelly.)
03-18-2013, 05:33 AM
Find
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#17
RE: Multiple use of a void OnStart, need help D:

(03-18-2013, 05:33 AM)Kiandra Wrote:
(03-17-2013, 08:51 PM)KeysOfMyMind Wrote: Gee thanks for the help, nice attitude.
Maybe you might want to work on that BEFORE you post on the forums.

He did just help you... (although what he said was rather rude, too). People on here can be a little bit touchy about answering the same question twice (or just sending you to the wiki page). Try these links for help before you post your questions about scripting on the forum:

Beginner's Scripting Guide
List of Scripting Functions

If those don't help, type in a keyword in the search bar on the development-support section of the forum. Chances are other people have the same questions you do. If you've tried that and you're still stuck, open up a script file from TDD in notepad++ (preferably one you know has the function you're looking for) and look at how they did it. Once you've done that, post your question on the forum

And for what it's worth, you can PM me if you have any other questions (scripting or mapping). Not going to lie, I'm not a good scripter - but I understand the basic concepts of it and I know my way around the HPL2's level editor decently.

Thanks Smile

I do appreciate the help he gave me but the way in which he conveyed his malcontent was rude, so I had to say something about it.

So don't take that post as me not being thankful for his help.
I just don't like people who are overly snarky.
If you have a problem with something I do or say, then you may voice that concern in a polite manner.
03-18-2013, 01:58 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#18
RE: Multiple use of a void OnStart, need help D:

(03-18-2013, 01:58 PM)KeysOfMyMind Wrote:
(03-18-2013, 05:33 AM)Kiandra Wrote:
(03-17-2013, 08:51 PM)KeysOfMyMind Wrote: Gee thanks for the help, nice attitude.
Maybe you might want to work on that BEFORE you post on the forums.

He did just help you... (although what he said was rather rude, too). People on here can be a little bit touchy about answering the same question twice (or just sending you to the wiki page). Try these links for help before you post your questions about scripting on the forum:

Beginner's Scripting Guide
List of Scripting Functions

If those don't help, type in a keyword in the search bar on the development-support section of the forum. Chances are other people have the same questions you do. If you've tried that and you're still stuck, open up a script file from TDD in notepad++ (preferably one you know has the function you're looking for) and look at how they did it. Once you've done that, post your question on the forum

And for what it's worth, you can PM me if you have any other questions (scripting or mapping). Not going to lie, I'm not a good scripter - but I understand the basic concepts of it and I know my way around the HPL2's level editor decently.

Thanks Smile

I do appreciate the help he gave me but the way in which he conveyed his malcontent was rude, so I had to say something about it.

So don't take that post as me not being thankful for his help.
I just don't like people who are overly snarky.
If you have a problem with something I do or say, then you may voice that concern in a polite manner.
I'm deeply sorry for giving you the wrong impression but, you need to learn about scripting more, okay?

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-18-2013, 03:27 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#19
RE: Multiple use of a void OnStart, need help D:

(03-18-2013, 03:27 PM)JustAnotherPlayer Wrote: I'm deeply sorry for giving you the wrong impression but, you need to learn about scripting more, okay?

So do you. So do I, and Kiandra, and everyone. We avoid being rude about it, however.

03-18-2013, 03:48 PM
Find
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#20
RE: Multiple use of a void OnStart, need help D:

(03-18-2013, 03:48 PM)Adrianis Wrote:
(03-18-2013, 03:27 PM)JustAnotherPlayer Wrote: I'm deeply sorry for giving you the wrong impression but, you need to learn about scripting more, okay?

So do you. So do I, and Kiandra, and everyone. We avoid being rude about it, however.

I know my knowledge is basic and if I had the further knowledge this wouldn't even have been a problem, thus I wouldn't have posted it here.
03-18-2013, 05:57 PM
Find




Users browsing this thread: 1 Guest(s)