The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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 Area's wont work
sHock Offline
Junior Member

Posts: 2
Threads: 1
Joined: Mar 2012
Reputation: 0
#1
Script Area's wont work

Ohai there, i dont think my "Script Areas" work.. Not sure if its a problem in the level editor, or in the code so ill post pic's of the editor and the code.
I tried to make a "Flying jesus" scare but when i walk into that area, nothing happends..

[Image: 38508]


[Image: 38512]

[Image: 38511]

[Image: 38513]



The code is a bit messy.. it is my first map.. hopefully you can make something out of it
/////////////////////Run when starting mapvoid OnStart(){ AddUseItemCallback("", "OutKey", "OutDoor", "UseKey1", true); AddUseItemCallback("", "Room1_key", "Room1_door", "UseKey2", true); AddEntityCollideCallback("Player", "Scriptarea_1", "Chairmode", true, 1);
AddEntityCollideCallback("Player", "FlyingJesus_1", "HolyJesus", true, 1); AddEntityCollideCallback("Jesus_1", "FlyingJesus_1", "Sound", true, 1); AddEntityCollideCallback("Player", "Scary_Area_4", "Scary_4", true, 1); SetPlayerLampOil(0);}
void d2(string &in asItem, string &in asEntity){ SetSwingDoorLocked("door2", false, true); PlaySoundAtEntity("", "unlock_door", "d2", 0, false); RemoveItem("OutKey");}void UseKey1(string &in asitem, string &in Door){ SetSwingDoorLocked("OutDoor", false, true); PlaySoundAtEntity("", "unlock_door", "door", 0, false); RemoveItem(asitem); SetMessage("M", "v1", 3); SetEntityActive("Mansion_Monster1", true); AddEnemyPatrolNode("Mansion_Monster1", "Mansion_monster_path_1", 0.1, ""); SetEntityActive("Mansion_Monster1_1", true); AddEnemyPatrolNode("Mansion_Monster1_1", "Mansion_monster_path_1", 0.1, ""); SetEntityActive("Mansion_Monster1_2", true); AddEnemyPatrolNode("Mansion_Monster1_2", "Mansion_monster_path_1", 0.1, ""); GiveSanityDamage(20, true); StartScreenShake(0.10f, 0.1f, 0.10f, 0.1f); PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0, false);}void UseKey2(string &in asitem, string &in Door){ SetSwingDoorLocked("Room1_Door", false, true); PlaySoundAtEntity("", "unlock_door", "door", 0, false); RemoveItem(asitem);}
void Chairmode(string &in asItem, string &in asEntity) { SetLampLit("candlestick_wall_1", true, false); PlaySoundAtEntity("", "chair.ogg", "MrChair", 0, false); }
void HolyJesus(string &in asParent, string &in asChild, int alState){SetEntityActive("Jesus_1", true);AddPropForce("Jesus_1", 0, 30000, 0, "World");} void Sound(string &in asParent, string &in asChild, int alState){PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);}
(This post was last modified: 03-22-2012, 06:40 PM by sHock.)
03-22-2012, 10:29 AM
Find


Messages In This Thread
Script Area's wont work - by sHock - 03-22-2012, 10:29 AM
RE: Script Area's wont work - by pandasFTW - 03-22-2012, 11:46 AM
RE: Script Area's wont work - by Obliviator27 - 03-22-2012, 12:20 PM
RE: Script Area's wont work - by sHock - 03-22-2012, 06:42 PM
RE: Script Area's wont work - by JordanWeigle - 03-22-2012, 07:47 PM
RE: Script Area's wont work - by Your Computer - 03-22-2012, 08:00 PM



Users browsing this thread: 1 Guest(s)