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
W.I.P Amnesia: M.I.A
Scout5 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Sep 2013
Reputation: 0
#1
W.I.P Amnesia: M.I.A

"You are Miles Freeby, part of the 87th division of the United States Army. The Year is 1855, and you and a squad of men are on a mission to infiltrate the Upshur Manor. The Uphsur Manor has had history of disruptions in the night, and people have been claiming there have been some experiments of the supernatural. Many have been signing a Petition to have the Leader of the Manor, William Upshur, to come out in explain these disruptions. However, no one has seen William for over a Year. So now you, and your squad have infiltrated the Upshur Manor to figure what is going on. As you enter, you suddenly feel tired, and Queasy. You Soon then Black Out. You Wake up in a Strange Dark Room. You are Alone. Now, you have to find you men, investigate, and get the Hell out of there."


This is my first Amnesia Custom Story.

I have Uploaded my Test/Demo For M.I.A on Moddb, but you can't access the page because the mod is being Authorized at the Moment. When It has been Authorized, I will Give you a Download Link To the page, where you can download the Demo/Test. But Don't think the Demo is big or anything, It's just A Hall and A room. It's Supposed to show you guys how my Mapping skill is at the Moment.

I don't know how long the story will be at the Moment, but I hope i can make it long, but not too long. Big Grin

Sorry, I think I'll be Canceling this Story. I'm not good with Scripting skills, and i'm going to be very busy. I won't have time to make it. *Welp* i thought I could do it, but when I saw the Tutorials....Sweet Jesus....I new NOTHING about Scripting. I'm good at Map making, but that's it.

Now, If anyone wants to take my story and title, they can. I would be happy to give it to you. If you want to, PM me.
(This post was last modified: 09-16-2013, 04:24 AM by Scout5.)
09-16-2013, 12:28 AM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#2
RE: W.I.P Amnesia: M.I.A

Hey! What the heck is this!? Something's hard so you're giving up? Don't you dare give up! Giving up is definitely not allowed.

There are millions of tutorials on scripting and at least a dozen forum-goers willing to help you out if scripting is not your forte! Allow me to be the first to explain some scripting stuff to you. I'm absolute crap at scripting - well, I'm getting better - so I should be able to communicate my knowledge on a level that you will understand.

Throughout this little blurb, I'll probably mention a few engine scripts. A complete list of all available engine scripts and what they do can be found here.
(Spoilers for size)
Spoiler below!

First off, you need a good scripting program to do this stuff in! (Excuse my excessive use of exclamation points) Personally, I use Notepad++ but other people use Geany. Both are wonderful programs.

The thing about scripting is that it's very fussy because you're telling a computer what to do, not a human. If you told a computer to go get you a cup of coffee, you would have to tell it to walk 5 steps to the door, turn the handle, open the door, go through the door, walk 10 steps forward, turn right, grab a cup, turn left, walk 2 steps to the coffee machine, turn right to face it, place the cup in the machine, turn the coffee machine on, add the coffee beans, add the water, press the start button, and so on and so forth. If you're talking to a human, you could just say "go get me some coffee, peasant!" and they would (hopefully) obey your orders and not spit in your beverage.

In C++, your script is CaSE sEnSiTiVe if you typed "Void onLeave" instead of "void OnLeave", your computer will have a tantrum because it doesn't understand you. Make sure you spell everything correctly and don't forget to capitalize your letters where needed.

On this topic, your engine scripts are like orders. You finish orders with periods (or exclamation points if you're really excited)! In C++, a period is a semi-colon (;) If you forget the period, the computer thinks you haven't finished talking to it, so it keeps looking for that semi-colon all the way through the file. It might find other semi-colons, but it ends up one short, so it'll put the error at the end of the file (ERROR: Unexpected end of file).

Scripting Language
-------------------------------------
In Notepad++ (and in Geany), there is a Language drop-down menu at the top. Since Amnesia uses AngelScript (a derivative of C++), you'll want to set the language to C++. This way, your functions will be colour-coded. It's a million times easier to find errors when something's not the right colour.

If you clicked the link for the Engine Scripts, you'll notice there are a few terms repeated throughout the page: string, int, float, and bool.

A string is a piece of text, like the name of an object. Strings are enclosed in quotations and will show up grey.
"This is a string"

Both integers and floats show up orange in Notepad++; integers and floats are numbers. The main difference between a float and an integer is that integers do not have decimal points (1, 2, 100, -53, 1024 are integers). Floats have decimal places (3.14159265, 1.628, 0.0001, 1.1, and 10000.1 are floats).
1.0f
1
The first is a float and the second is an integer.

Bools are true and false values. These are mainly used to set certain entities active or inactive (such as monsters). Bools show up in blue text.
SetEntityActive("monster_1", true);
The above code would be used to make the in-map monster active (active just means that it magically pops into existence).

There's another, slightly important feature which is not in the engine scripts: text comments. By putting two forward slashes in front of a piece of text, you're telling the computer to skip what's written there. These comments show up in green.
//This is a comment, which will not be read by the computer

Alright, now that I've kind-of explained what each thing is, let's get on to something more interesting.

Script Files
------------------------------------------
Every single one of your maps should be paired with a .hps file which has the exact same name. For example, if your map is named "reallyawesomemap.map", then your script file should be "reallyawesomemap.hps". To get the .hps extension in notepad++, just type the extension after the name when saving your file.

There are a few things which you should always always always include in your script file: OnStart, Intro, OnEnter, and OnLeave. They will look like this:
(php code colouring is slighlty different from notepad, but this is just to show you what the colour-coding potentially looks like).
PHP Code: (Select All)
void OnStart()
{

}

void Intro()
{

}

void OnEnter()
{

}

void OnLeave()
{


And now that I think I have explained everything in a haphazard manner, let's put it all together and write a script. In this script, we're just going to set a monster active and change the colour of a light to red when the player walks through a script area. To do this, we're going to use these three functions:
PHP Code: (Select All)
void AddEntityCollideCallback(stringasParentNamestringasChildNamestringasFunctionbool abDeleteOnCollideint alStates); //for triggering the event when the player walks through an area
void SetEntityActive(stringasNamebool abActive); //for setting the monster active
void FadeLightTo(stringasLightNamefloat afRfloat afGfloat afBfloat afAfloat afRadiusfloat afTime); //for changing the colour of the light 

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""Area_ScaryEvent""Script_ScaryEvent"true0); //the PLAYER collides with SCARY EVENT AREA to trigger the SCARY EVENT SCRIPT, which cannot be triggered twice (DeleteOnCollide = true) and can be triggered when entering, exiting, or standing in the script area (the 0 int at the end).
}

void Script_ScaryEvent(string &in asParentstring &in asChildint alState//make sure the name of your script is the same here as it was when you labelled it earlier
{
SetEntityActive("monster_1"true); //Sets the monster which, in the level editor, is named "monster_1" active
FadeLightTo("Pointlight_1"1.0f0.0f0.0f1.0f5.0f1.5f); //Makes Pointlight_1 red (afRed = 1.0, everything else is 0.0, but could potentially be numbers in-between if you wanted), with a radius of 5.0, over a period of 1.5 seconds.


That's it! That's scripting :D It's not as scary as it sounds! Now go out there and make some majestic scripts!

Oh, and if you have any more questions on how to do specific things, you can PM me, ask in the Development Support section, or take a looksie at other people's scripts (the ones in ATDD have comments explaining what most of the parts do, which is really helpful).

Now seriously, go make some beautiful scripts!


Oh, and if anyone else reads this, feel free to add. I'm sure I forgot something.

I forgot something :p
I have a tutorial of the Level Editor's interface here. It explains what each thing is, but it doesn't go into detail on how to use them because I got really busy and I haven't finished the tutorial c:

Of course, if you have questions, I would gladly answer them.

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 09-17-2013, 09:32 PM by CarnivorousJelly.)
09-16-2013, 06:09 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: W.I.P Amnesia: M.I.A

http://wiki.frictionalgames.com/hpl2/amn..._functions

This is your best friend.
Seriously...!

The link contains almost any script line that you might need, so if your missing something: Press Ctrl+F or Cmd+F to open the search bar, and search for any key-word the desired script line might contain.

Key-words:
To touch something = Interact
To appear and disappear = Activate or Active
To delete something = Stop/Remove
Many screen effects contain = Fade

Trying is the first step to success.
09-16-2013, 07:10 AM
Find




Users browsing this thread: 2 Guest(s)