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
Scripting noob returns. HALP
Solarn Offline
Junior Member

Posts: 36
Threads: 3
Joined: Mar 2011
Reputation: 0
#6
RE: Scripting noob returns. HALP

(04-10-2011, 06:18 AM)Bennick Wrote:
(04-09-2011, 09:11 PM)Youcef Wrote: void OnStart()
{
SetEntityPlayerInteractCallback("lantern_1", "monster",true);
}


void monster(string& asName)
{
SetEntityActive("servant_grunt_1", true);
}

That makes it look like the second half of this is redundant. With that first set of instructions (don't know the actual term, lol) I can see you're activating the monster by interacting with the lantern... Does the second set of instructions just specify which monster?
Also I typed that and it gave me a fatal scripting error.
Nevermind, I fixed the error. But it still doesn't work. I enter the level and the monster spawns before I even touch the lantern. Or does SetEntityActive just tell it to start walking along the nodes? What I'm trying to do is get it to spawn on the picking up of the lantern, as in everything is totally silent, then, upon lanternage, suddenly "RAWR" and presto, a walking gatherer.
Nope. The first instruction (SetEntityPlayerInteractCallback) just tells the game to run the function called "monster" when interacting with the entity "lantern_1" (picking it up, in this case). The game engine doesn't know what the word "monster" means any more than it knows what the word "strawberry" would mean. Then the second set of instructions defines the function called "monster", telling the game that when it is told to run it, it must set the entity called "servant_grunt_1" to active. Of course, for this to have any effect, "servant_grunt_1" must be inactive. In the level editor, when selecting any entity (in this case, the grunt), there is a checkbox named "Active". Uncheck that to make the grunt inactive on level start.
04-10-2011, 10:44 AM
Find


Messages In This Thread
Scripting noob returns. HALP - by Bennick - 04-09-2011, 06:50 PM
RE: Scripting noob returns. HALP - by Tanshaydar - 04-09-2011, 08:59 PM
RE: Scripting noob returns. HALP - by Youcef - 04-09-2011, 09:11 PM
RE: Scripting noob returns. HALP - by Bennick - 04-10-2011, 06:18 AM
RE: Scripting noob returns. HALP - by Solarn - 04-10-2011, 10:44 AM
RE: Scripting noob returns. HALP - by Youcef - 04-10-2011, 09:33 AM



Users browsing this thread: 1 Guest(s)