Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 5 Vote(s) - 3.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting, need urgent help!
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Scripting, need urgent help!

Hello everyone!

I have a quick few questions to you scripting geniuses out there:

1. I got a key to unlock a door, and all that is good, but how do I make a key in another map, open a key in another map? For instance: You find a key in the cellar, then go through the level transfer door OUT OF THE cellar and into the Foyer. You use the key on the level transfer door in the foyer to the upstairs. Does that make since?

2. How do I work enemies?

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

07-20-2011, 03:20 AM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#2
RE: Scripting, need urgent help!

Question 1 @ You need to fix a globalvar I believe. Search on the wiki or google because I don't know how to fix the globalvars.

Question 2 @ what do you mean?. How to make a monster spawn?

[Image: 44917299.jpg]Dubstep <3
07-20-2011, 04:04 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#3
RE: Scripting, need urgent help!

1. Okay, I will look into that.

2. How do I make them spawn yes, and will they automatically search for the player, or will my map maker need to make a path and tell him what to do?

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

07-20-2011, 04:15 AM
Website Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#4
RE: Scripting, need urgent help!

you could add this function to your script to easily make the monster active/deactivated
SetEntityActive("MonsterName", true);
Change MonsterName to your monstername or any entity you want to become active/deactivated.
true = set the entity active
false = deactivate the entity


This code will make the monster auto spot the Player and run towards him
ShowEnemyPlayerPosition("MonsterName");

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 07-20-2011, 06:31 AM by xtron.)
07-20-2011, 06:31 AM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#5
RE: Scripting, need urgent help!

1. Like xtron said, you need global variables.
(you can use global variables for all maps of your custom story's maps. local variables are only used in the specific map, and can't be called by other maps)

2. At first you have to place your monster. If you want it only appear when a player does something, then you have to set it inactive.
Via Script, use the SetEntityActive("MonsterName", true); like xtron said.
then you have two options:
1. Create pathnodes. If you want that your monster follows a path, you have to place those (in the area tab). Then use the function AddEnemyPatrolNode("monstername", "pathnodename", how long he waits with a float, "animation (you can leave this empty)");
2. ShowEnemyPlayerPosition("MonsterName"); But be careful with this. Many people already said, that the Monster AI is like sh*t, and if there's a wall between you and the monster, he will get stuck/run against the wall.
07-20-2011, 09:58 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#6
RE: Scripting, need urgent help!

1. Awesome! Thanks guys! I got the monster working pretty well now, one last question with him. How can I made him inactive, until the player picks up the key, then he beats down a door?

2. Can someone elaborate a little bit on these "global variables?"

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 07-20-2011, 03:00 PM by JetlinerX.)
07-20-2011, 02:58 PM
Website Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#7
RE: Scripting, need urgent help!

1. You can do that in the editor. just click at him, and there should be a small box under his name 'Active'. Uncheck it, now he's inactive. Smile

2. here a simple example: You make a global string type variable. Let's call it x.
Now you can set x = "test" in level 1. When you are in level 2 now, it has the saved value. In this case, test.
If you want to know how it works, look at the amnesia wiki at script tutorials.
07-20-2011, 03:11 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#8
RE: Scripting, need urgent help!

1. So he will beat down the door when the player picks up the key if I just make him active? (Sorry, first time scripting)

2. Ehhhhhmmm.... I dont get it... lol, sorry. Like I said, first time scripting, so the Amnesia Wiki is still pretty confusing its self too Sad

3. Sorry if I am annoying you guys asking all these questions that are on the Wiki, it just helps me when I hear other explanations from people who were in my shoes at one point.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

07-20-2011, 03:22 PM
Website Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#9
RE: Scripting, need urgent help!

Got the monster working! But still dont know how to make him beat down a door when the key is picked up. Sad

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

07-21-2011, 12:08 AM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#10
RE: Scripting, need urgent help!

At first I had no idea how to make a monster beat down the door when a key was picked up either, but for the sake of Frictional Games, I decided to test and came up with a solution that works! Big Grin I might just post a tutorial thread. o.o

Ba-da bing, ba-da boom.
07-21-2011, 05:10 AM
Find




Users browsing this thread: 6 Guest(s)