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
I need help with scripting! SCRIPT INSIDE
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#1
I need help with scripting! SCRIPT INSIDE

Hello, ive been working hours for this to work, and well im no awesome programmer. Here's what i want to do?

I want player to walk to a script area, named "ScriptArea_1". when the player walk in the area, i wanted a monster to spawn behind player, and make the camera on the monster for 1.5 seconds. the monster i wish to be behind him is "servant_grunt_2" (02 for being another one in the level) i have no idea how to do this, i have looked on google and youtube and all the tutorials for triggering are on making doors shut behind people and not the things i want, now i hope anyone could help me with this delima, i have worked on it for hours with no possible solution in the near future, i would really appreciate any help i can get.

Thanks
Please People! I need help!


I ADDED MORE STUFF IN, THIS IS THE WHOLE SCRIPT

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_2" , true);
}
AddUseItemCallback("""R01_Key1", "cabinet_metal_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cabinet_metal_1", false, true);
}

im making the cabnit closed and locked. im making it open with a key on a table(odley enough) and it doesnt seem to be working, this keeps stuffing up : AddUseItemCallback("""R01_Key1", "cabinet_metal_1", "KeyOnDoor", true); JUST AFTER THE ADDUSEITEMCALLBACK thing it says theres a expected identifier, but i don't know to put one in.
(This post was last modified: 04-22-2011, 12:17 PM by flamez3.)
04-22-2011, 10:28 AM
Find
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#2
RE: I need help with scripting!

Instead of wasting hours trying to figure it out you could've just checked the STICKIED topic at the TOP OF THE FORUMS, named SCRIPTS RECOLLECTION.

That way you would have EXACTLY what you are looking for.
04-22-2011, 11:05 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: I need help with scripting!

well, Mabey i dont know what monsterfunc1 is, string &in asChild, int alState,AddEntityCollideCallback. I have no idea, " im no awesome programmer"read please
right now i have this script


////////////////////////////
// Run first time starting map

AddEntityCollideCallback ("Player", "ScriptArea_1", "MonsterFunc1", true, 1);

void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
}

the bold part is comming up with a error, Expected identifier.
Anyway, any help?
(This post was last modified: 04-22-2011, 11:40 AM by flamez3.)
04-22-2011, 11:11 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#4
RE: I need help with scripting! SCRIPT INSIDE

http://www.frictionalgames.com/forum/thread-5117.html

The 2nd spoiler. No offence, but learn to read.
04-22-2011, 11:45 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: I need help with scripting! SCRIPT INSIDE

...i have done that, as stated in the reply above, i dont know what monsterfunc1 is, string &in asChild, int alState,AddEntityCollideCallback. so i have asked you people to help me with that.
04-22-2011, 11:48 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#6
RE: I need help with scripting! SCRIPT INSIDE

If you actually read that post, then you would have seen

AddEntityCollideCallback ("Player", "ScriptArea_1", "MonsterFunc1", true, 1);

is placed inside the Onstart() function.
And MonsterFunc1 is the name of a function. The name does not matter at all, as long as it's clear to the scripter.

Now, what happens is this: You add a colideCallback, which triggers when the player walks into a ScriptArea (ScriptArea_1 in the level editor). When that happens, the function is triggered. In this case, when you walk into an area, a Grunt goes active.
04-22-2011, 11:50 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#7
RE: I need help with scripting! SCRIPT INSIDE

I actually thank you for trying, but im going over other things, because i got so many problems, and its a night, (im scaring myself)
(04-22-2011, 11:50 AM)Tottel Wrote: If you actually read that post, then you would have seen

AddEntityCollideCallback ("Player", "ScriptArea_1", "MonsterFunc1", true, 1);

is placed inside the Onstart() function.
And MonsterFunc1 is the name of a function. The name does not matter at all, as long as it's clear to the scripter.

Now, what happens is this: You add a colideCallback, which triggers when the player walks into a ScriptArea (ScriptArea_1 in the level editor). When that happens, the function is triggered. In this case, when you walk into an area, a Grunt goes active.

actually i do need your help,
i keep getting this message and i don't know what?

AddUseItemCallback("""R01_Key1", "cabinet_metal_1", "KeyOnDoor", true);

Just after the ADDUSEITEMCALLBACK there is a expected identifier, i have deleted the brackets and added them, it doesn't say anywhere in the tut?
(This post was last modified: 04-22-2011, 12:14 PM by flamez3.)
04-22-2011, 12:12 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#8
RE: I need help with scripting! SCRIPT INSIDE

There's something wrong with "AddUseItemCallback". That should be like this:
AddUseItemCallback("", "R01_Key1", "cabinet_metal_1", "KeyOnDoor", true);

At least that is what I see wrong with AddUseItemCallback.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
04-22-2011, 01:46 PM
Website Find




Users browsing this thread: 4 Guest(s)