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
If the lamp is lit, monster deactivates ?
Nice Offline
Posting Freak

Posts: 3,812
Threads: 37
Joined: Jan 2012
Reputation: 153
#1
If the lamp is lit, monster deactivates ?

Hey all, so i've run into a little problem..

what would the script look like if i wanted to make it that when the player lits a candle, it deactivates a monster ?

i dont think SetEntityPlayerInteractCallback would work, because then the player would deactivate the monster just by clicking on the candle without setting it lit (no tinderboxes)

i'm preety basic with scripting so... i have no idea how to make it work.

edit: so i tried messing around with the "if statement" to see if i could use it but all i got was a bunch of errors xD this is what i tried

void warning(string &in asTimer) //candle off in opozorilo
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetLampLit("candlestick01_1", false, true);
StartScreenShake(0.1f, 0.1f, 1.0f, 1.0f);
if(SetLampLit("candlestick01_1") == false)
{
SetMessage("DONTKNOWIFWORKS", 10);
}
else
{
SetEntityActive("closetgrunt", true);
ShowEnemyPlayerPosition("closetgrunt");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("closetgrunt1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("closetgrunt", "PathNodeArea_9", 0, "");
AddTimer("", 10, "open");
}
}

so yeah, here i wanted to test i know how to use "if statement".. what i wanted to achieve was that if the candle was NOT lit i get the message "DONTKNOWIFWORKS" otherwise.. well you can see the rest Smile


Sorry but we cannot change your avatar as the new avatar you specified is too big. The maximum dimensions are 80x80 (width x height)
(This post was last modified: 03-02-2013, 12:35 PM by Nice.)
03-02-2013, 12:01 PM
Find


Messages In This Thread
If the lamp is lit, monster deactivates ? - by Nice - 03-02-2013, 12:01 PM



Users browsing this thread: 1 Guest(s)