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
AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#1
AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

Hey guys, my scriptarea called "spawn1" wont trigger anything. Please take a look. Thanks.

The Callback in void OnStart() is:
AddEntityCollideCallback("Player", "spawn1", "ActivateMonster3", true, 1);


And my "ActivateMonster3" looks like this:

void ActivateMonster3(string &in item)
{
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_15", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_16", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_17", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_18", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_19", 0, "Idle");
PlaySoundAtEntity("", "amb_alert.snt", "spawn1", 0, false);

//ADD RED LIGHT
SetEntityActive("candlestick_floor_red_1", true);
SetEntityActive("candlestick_floor_red_2", true);
SetEntityActive("candlestick_floor_red_3", true);
SetEntityActive("candlestick_floor_red_4", true);
SetEntityActive("candlestick_floor_red_5", true);
SetEntityActive("candlestick_floor_red_6", true);
SetEntityActive("candlestick_floor_red_7", true);
SetEntityActive("candlestick_floor_red_8", true);
SetEntityActive("candlestick_floor_red_9", true);
SetEntityActive("candlestick_floor_red_10", true);
SetEntityActive("candlestick_floor_red_11", true);
SetEntityActive("candlestick_floor_red_12", true);
SetEntityActive("candlestick_floor_red_13", true);
SetEntityActive("candlestick_floor_red_14", true);
SetEntityActive("candlestick_floor_red_15", true);
SetEntityActive("candlestick_floor_red_16", true);
SetEntityActive("candlestick_floor_red_17", true);
SetEntityActive("candlestick_floor_red_18", true);
SetEntityActive("candlestick_floor_red_19", true);
SetEntityActive("candlestick_floor_red_20", true);
SetEntityActive("candlestick_floor_red_21", true);
SetEntityActive("candlestick_floor_red_22", true);
SetEntityActive("candlestick_floor_red_23", true);
SetEntityActive("candlestick_floor_red_24", true);
SetEntityActive("candlestick_floor_red_25", true);
SetEntityActive("candlestick_floor_red_26", true);

SetEntityActive("candlestick_floor_red_27", true);

//DESTROY NORMAL LIGHT
SetEntityActive("candlestick_floor_23", false);
SetEntityActive("candlestick_floor_24", false);
SetEntityActive("candlestick_floor_25", false);
SetEntityActive("candlestick_floor_26", false);
SetEntityActive("candlestick_floor_27", false);
SetEntityActive("candlestick_floor_28", false);
SetEntityActive("candlestick_floor_29", false);
SetEntityActive("candlestick_floor_30", false);
SetEntityActive("candlestick_floor_31", false);
SetEntityActive("candlestick_floor_32", false);
SetEntityActive("candlestick_floor_33", false);
SetEntityActive("candlestick_floor_34", false);
SetEntityActive("candlestick_floor_35", false);
SetEntityActive("candlestick_floor_36", false);
SetEntityActive("candlestick_floor_37", false);
SetEntityActive("candlestick_floor_38", false);
SetEntityActive("candlestick_floor_39", false);
SetEntityActive("candlestick_floor_40", false);
SetEntityActive("candlestick_floor_41", false);
SetEntityActive("candlestick_floor_42", false);
SetEntityActive("candlestick_floor_43", false);
SetEntityActive("candlestick_floor_44", false);
SetEntityActive("candlestick_floor_45", false);
SetEntityActive("candlestick_floor_46", false);
SetEntityActive("candlestick_floor_47", false);

SetEntityActive("candlestick_floor_48", false);
SetEntityActive("candlestick_floor_49", false);
}

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
05-25-2012, 06:24 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

Wrong callback syntax.

Tutorials: From Noob to Pro
05-25-2012, 06:34 PM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#3
RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

Should be this syntax instead:
void ActivateMonster3(string &in asParent, string &in asChild, int alState)
{
...
...
}

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 05-25-2012, 06:37 PM by Cranky Old Man.)
05-25-2012, 06:36 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#4
RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

Clean up your code. This whole block of:

SetEntityActive("candlestick_floor_23", false);

SetEntityActive("candlestick_floor_24", false);

SetEntityActive("candlestick_floor_25", false);

SetEntityActive("candlestick_floor_26", false);

SetEntityActive("candlestick_floor_27", false);

SetEntityActive("candlestick_floor_28", false);

SetEntityActive("candlestick_floor_29", false);

SetEntityActive("candlestick_floor_30", false);

SetEntityActive("candlestick_floor_31", false);

SetEntityActive("candlestick_floor_32", false);

SetEntityActive("candlestick_floor_33", false);

SetEntityActive("candlestick_floor_34", false);

SetEntityActive("candlestick_floor_35", false);

SetEntityActive("candlestick_floor_36", false);

SetEntityActive("candlestick_floor_37", false);

SetEntityActive("candlestick_floor_38", false);

SetEntityActive("candlestick_floor_39", false);

SetEntityActive("candlestick_floor_40", false);

SetEntityActive("candlestick_floor_41", false);

SetEntityActive("candlestick_floor_42", false);

SetEntityActive("candlestick_floor_43", false);

SetEntityActive("candlestick_floor_44", false);

SetEntityActive("candlestick_floor_45", false);

SetEntityActive("candlestick_floor_46", false);

SetEntityActive("candlestick_floor_47", false);

SetEntityActive("candlestick_floor_48", false);

SetEntityActive("candlestick_floor_49", false);

can be simplifed to two lines of code:

for(int i=23;i<=49;i++)
   SetEntityActive("candlestick_floor_"+i, false);

Tada. Smile

05-25-2012, 06:41 PM
Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#5
RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

(05-25-2012, 06:41 PM)Putmalk Wrote: Clean up your code. This whole block of:

for(int i=23;i<=49;i++)


Tada. Smile

Okay, so i started learning coding for Java and c++, but i still don't have any idea what
for(int i=23;i<=49;i++) means and how it works. I need some full explanation of it Big Grin.

Signature to awesome to be displayed.
(This post was last modified: 05-25-2012, 08:26 PM by Stepper321.)
05-25-2012, 08:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: AMNESIA CUSTOM STORY-SCRIPT AREA DOESN'T WORK

(05-25-2012, 08:25 PM)Stepper321 Wrote: Okay, so i started learning coding for Java and c++, but i still don't have any idea what
for(int i=23;i<=49;i++) means and how it works. I need some full explanation of it Big Grin.

http://www.frictionalgames.com/forum/thr...#pid112331

Tutorials: From Noob to Pro
05-25-2012, 09:26 PM
Website Find




Users browsing this thread: 1 Guest(s)