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:
  • 4 Vote(s) - 3.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting n00b in need of help.
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#1
Scripting n00b in need of help.

So I've done some action scripting (Flash), but not C++.
I see some stuff thats done the same way, but for the most part, I'm just confused.

So what I tried to make, was that when you walk in an area, a zombie spawns and walks into a door and then disappears.

I've gotten to the part that it spawns (I just place it down, but I'm not sure how to spawn it), and that it walks to the desired node I made.
The grunt automatically disappears as it should, so thats good Big Grin

void OnStart()
{  
   GiveItemFromFile("lantern", "lantern.ent");

   for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");    
}

void OnEnter()
{
AddEntityCollideCallback("Player", "scaretrigger", "scareactivate", true, 1);
AddEnemyPatrolNode("scaremonster", "scaremonsterpath1", 0, "");
}

void OnLeave()
{

}

I started out with the basic starting code, or however it was called Tongue
I'm going to delete the code of the tinderboxes and lantern later on when I'm going to do some actual play-testing.
I understand the code of the starting items a bit, except "int i=0;i<10;i++". What do the ";" mean in C++?

"scaretrigger" = the area I made in which it triggers. I've used the Area tool with the Script option...
"scareactivate" = the boolean that is created? If someone would explain this to me, I'd be gratefull.
"scaremonster" = the grunt, who is activated in the map editor.
"scaremonsterpath1" = the node where scaremonster walks to.

What I need now, is a way to trigger the monster to spawn and walk to "scaremonsterpath1".

I've searched through the forum, but I didnt get a real proper explaination of how it actually works. This might also be because I'm a real newbie to C++ though.

I've got the script functions from the wikipedia.
From what I've seen and done up to now, I understand that "string& asXXXX" is basically the name of an object/function?

Thanks in advance.
(This post was last modified: 11-13-2010, 01:02 AM by Akumasama.)
11-13-2010, 12:59 AM
Find


Messages In This Thread
Scripting n00b in need of help. - by Akumasama - 11-13-2010, 12:59 AM
RE: Scripting n00b in need of help. - by Cellrage - 11-13-2010, 01:37 AM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:02 AM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 02:52 PM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:15 PM
RE: Scripting n00b in need of help. - by Chilton - 11-13-2010, 03:41 PM
RE: Scripting n00b in need of help. - by anzki - 11-13-2010, 05:42 PM
RE: Scripting n00b in need of help. - by Cellrage - 11-14-2010, 03:08 AM
RE: Scripting n00b in need of help. - by Chilton - 11-14-2010, 03:33 AM
RE: Scripting n00b in need of help. - by Cellrage - 11-14-2010, 03:37 AM



Users browsing this thread: 1 Guest(s)