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 wont work :S
CptLogicDev Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 0
#1
Script wont work :S

Hey got some problem with my Script for making a vase move away from a box down to the floor :S

here is the hps

void OnStart()
{
[u][i][b]AddEntityCollideCallback("Player", "ScriptArea_4", "paranormal1", true, 1);[/b][/i][/u]
AddEntityCollideCallback("Player", "scriptarea1", "LookAt", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "InsanityArea_1", "Lookatdamage", false, 1);
AddEntityCollideCallback("Player", "Lookat2", "Lookat2Func", true, 1);
AddEntityCollideCallback("Monster", "MonsterDie", "MonsterDie", true, 1);
AddEntityCollideCallback("Player", "Inactivescriptarea", "Scream", true, 1);
PlayMusic("01_amb_darkness", true, 5, 2, 0, true);
SetEntityPlayerInteractCallback("Lab_key", "ActiveArea", true);
SetEnemyDisabled("graveyard_corpse_1", true);
SetEntityPlayerInteractCallback("EXAMPLE_DOOR", "frontdoor", false);
}
[u][b][i]void paranormal1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("vase", 5, 0, 0, "world");
AddBodyForce("vase", 5, 0, 0, "world");
PlaySoundAtEntity("", "react_scare", "Player", 10, true);
}[/i][/b][/u]
void func_slam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Doorslam", 1, 1, "");
SetSwingDoorClosed("Doorslam", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);  
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
StopPlayerLookAt();
}


void Lookatdamage(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(30, true);
}
void frontdoor(string &in asEntity)
{
SetMessage("Message", "LockedDoor", 0);
}


void MonsterDie(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", false);
}
void DoorLockedPlayer(string &in entity)

{
    if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
    {

        SetMessage("Messages", "LockedDoor", 2);

    }
}

void Scream(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 2, "");
AddTimer("", 10, "Timertrigger2");
}
void Timertrigger2(string &in asTimer)
{
SetMessage("Message", "Whatwasthat", 5);
}

void ActiveArea(string &in asEntity)
{
SetEntityActive("Inactivescriptarea", true);
SetEntityActive("script_slam", true);
}
void LookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAt", 1, 2, "");
SetPlayerActive(false);
SetMessage("Message", "whathappend", 5);
AddTimer("", 5, "Timertrigger1");
}

void Timertrigger1(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}

void Lookat2Func(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("ScriptArea_1", 1, 2, "");
SetPlayerActive(false);
SetMessage("Message", "whatis", 5);
AddTimer("", 5, "Timertrigger3");
}
void Timertrigger3(string &in asTimer)
{
StartPlayerLookAt("ScriptArea_2", 1, 2, "");
AddTimer("", 5, "Timertrigger4");
}

void Timertrigger4(string &in asTimer)
{
StartPlayerLookAt("ScriptArea_3", 1, 2, "");
AddTimer("", 5, "Timertrigger5");
}
void Timertrigger5(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}




void OnLeave()
{

}
12-29-2012, 03:25 AM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#2
RE: Script wont work :S

See all those lines with forum formatting tags - those things in []? Like this one:
[u ][i ][b ]AddEntityCollideCallback("Player", "ScriptArea_4", "paranormal1", true, 1);[/b ][/i ][/u ]

Well, those [u ][i ][b ] and [/b ][/i ][/u ] are a problem, since that's not HPL script, but just some forum tags the poster used to underline, italicize, and make bold that line of code for some reason. It should just be:
AddEntityCollideCallback("Player", "ScriptArea_4", "paranormal1", true, 1);

Clear those, or go back to where you copied that from, and just copy the plain text (unless there was some forum error, and the [] tags are visible anyway).
(This post was last modified: 12-29-2012, 04:02 AM by TheGreatCthulhu.)
12-29-2012, 04:00 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#3
RE: Script wont work :S

I guess it looks fine to me, does the "ScriptArea_4" match the Area in the map?
Does "vase" match the object's name in question that you wish to move.
12-29-2012, 04:04 AM
Find
CptLogicDev Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 0
#4
RE: Script wont work :S

(12-29-2012, 04:04 AM)Rapture Wrote: I guess it looks fine to me, does the "ScriptArea_4" match the Area in the map?
Does "vase" match the object's name in question that you wish to move.

yes it has :S got no catch to :S

this is driving me crazy...
12-29-2012, 05:10 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#5
RE: Script wont work :S

Your forces are much too low to notice anything.

AddPropForce("vase", 5, 0, 0, "world");
AddBodyForce("vase", 5, 0, 0, "world");

Change those vales to something really large (like 5000) and see if it works. If it does work, then reduce the values so that it works how you want it to.

In Ruins [WIP]
(This post was last modified: 12-29-2012, 05:46 AM by NaxEla.)
12-29-2012, 05:46 AM
Find
CptLogicDev Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 0
#6
RE: Script wont work :S

(12-29-2012, 05:46 AM)NaxEla Wrote: Your forces are much too low to notice anything.

AddPropForce("vase", 5, 0, 0, "world");
AddBodyForce("vase", 5, 0, 0, "world");

Change those vales to something really large (like 5000) and see if it works. If it does work, then reduce the values so that it works how you want it to.

ah ty mate
12-29-2012, 09:12 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#7
RE: Script wont work :S

(12-29-2012, 09:12 PM)CptLogicDev Wrote:
(12-29-2012, 05:46 AM)NaxEla Wrote: Your forces are much too low to notice anything.

AddPropForce("vase", 5, 0, 0, "world");
AddBodyForce("vase", 5, 0, 0, "world");

Change those vales to something really large (like 5000) and see if it works. If it does work, then reduce the values so that it works how you want it to.

ah ty mate

Anytime, man Big Grin

In Ruins [WIP]
12-29-2012, 11:25 PM
Find




Users browsing this thread: 3 Guest(s)