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:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting an Entity Active
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#1
Setting an Entity Active

SetEntityCallbackFunc("lantern", "SetEntityActive"); (so when player picks up lantern, entity is set active (pretty sure this is right)


void SetEntityActive(string &in asEntity, string &in type)
{
SetEntityActive("monster1", "OnPickup");
SetEntityActive("monster2", "OnPickup");
}

that is what the script page seemed like it was saying.. here it is for reference:


void SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc


I think my callback syntax is messed up, but I don't know!

SetEntityCallbackFunc("lantern", "OnPickup");


void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster1", true);
ShowEnemyPlayerPosition("monster1");
SetEntityActive("monster2", true);
ShowEnemyPlayerPosition("monster2");
}

this should be a bit better, but it still won't work.
(This post was last modified: 06-02-2012, 07:27 AM by TheIcyPickle.)
06-02-2012, 06:31 AM
Find


Messages In This Thread
Setting an Entity Active - by TheIcyPickle - 06-02-2012, 06:31 AM
RE: Setting an Entity Active - by FlyingFruitcake - 06-02-2012, 01:12 PM
RE: Setting an Entity Active - by Xanthos - 06-02-2012, 01:21 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 03:24 PM
RE: Setting an Entity Active - by Putmalk - 06-02-2012, 07:09 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 07:37 PM
RE: Setting an Entity Active - by Putmalk - 06-02-2012, 07:46 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 07:54 PM
RE: Setting an Entity Active - by Putmalk - 06-02-2012, 08:05 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 08:11 PM
RE: Setting an Entity Active - by Putmalk - 06-02-2012, 08:18 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 08:51 PM
RE: Setting an Entity Active - by Putmalk - 06-02-2012, 09:02 PM
RE: Setting an Entity Active - by TheIcyPickle - 06-02-2012, 09:09 PM
RE: Setting an Entity Active - by Putmalk - 06-03-2012, 12:15 AM
RE: Setting an Entity Active - by TheIcyPickle - 06-03-2012, 12:58 AM
RE: Setting an Entity Active - by Putmalk - 06-03-2012, 04:10 AM
RE: Setting an Entity Active - by TheIcyPickle - 06-03-2012, 04:28 AM
RE: Setting an Entity Active - by Putmalk - 06-03-2012, 06:47 AM



Users browsing this thread: 1 Guest(s)