Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
|
02-02-2015, 12:53 AM |
|
Icaab2608
Member
Posts: 85
Threads: 37
Joined: Jul 2013
Reputation:
0
|
RE: Error expected method or property
(02-02-2015, 12:53 AM)Mudbill Wrote: I suggest you try to imagine writing a script with no C++ references.
Here are your Amnesia references: http://wiki.frictionalgames.com/hpl2/amn..._functions I know, but I need to function on C++, because it ,,Engine Sripts``,does`t help me(.
|
|
02-02-2015, 12:23 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Error expected method or property
Is there something you don't understand about the Engine Scripts page?
Discord: Romulator#0001
|
|
02-02-2015, 01:39 PM |
|
TheGreatCthulhu
Member
Posts: 213
Threads: 10
Joined: Oct 2010
Reputation:
32
|
RE: Error expected method or property
(02-02-2015, 12:23 PM)Icaab2608 Wrote: (02-02-2015, 12:53 AM)Mudbill Wrote: I suggest you try to imagine writing a script with no C++ references.
Here are your Amnesia references: http://wiki.frictionalgames.com/hpl2/amn..._functions I know, but I need to function on C++, because it ,,Engine Sripts``,does`t help me(.
If you want to make level scripts for this game, C++ will not work. Never ever.
You can't use C++ at all.
Some of the code may look like C++, but it's not C++.
It's a completely different language called AngelScript, together with a set of functions documented on the Engine Scripts page.
That's all you can use. No C++.
|
|
02-02-2015, 08:50 PM |
|
Icaab2608
Member
Posts: 85
Threads: 37
Joined: Jul 2013
Reputation:
0
|
RE: Error expected method or property
(02-02-2015, 08:50 PM)TheGreatCthulhu Wrote: (02-02-2015, 12:23 PM)Icaab2608 Wrote: (02-02-2015, 12:53 AM)Mudbill Wrote: I suggest you try to imagine writing a script with no C++ references.
Here are your Amnesia references: http://wiki.frictionalgames.com/hpl2/amn..._functions I know, but I need to function on C++, because it ,,Engine Sripts``,does`t help me(.
If you want to make level scripts for this game, C++ will not work. Never ever.
You can't use C++ at all.
Some of the code may look like C++, but it's not C++.
It's a completely different language called AngelScript, together with a set of functions documented on the Engine Scripts page.
That's all you can use. No C++. But I've read,that can write your function on C++.
|
|
02-03-2015, 08:34 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Error expected method or property
Where? Because it's wrong.
|
|
02-03-2015, 08:42 AM |
|
Icaab2608
Member
Posts: 85
Threads: 37
Joined: Jul 2013
Reputation:
0
|
RE: Error expected method or property
(02-03-2015, 08:42 AM)Mudbill Wrote: Where? Because it's wrong. Possibly all, that is possible to submit.
(02-02-2015, 01:39 PM)Romulator Wrote: Is there something you don't understand about the Engine Scripts page? Yes!
(This post was last modified: 02-03-2015, 02:28 PM by Icaab2608.)
|
|
02-03-2015, 02:27 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Error expected method or property
I don't think you understand what we meant.
Where did you hear that you can write C++ for Amnesia? I was saying that the source is probably incorrect.
Romulator asked (I assume) what part of the Engine Scripts you don't understand, so that we can try explaining it to you.
|
|
02-03-2015, 03:23 PM |
|
Icaab2608
Member
Posts: 85
Threads: 37
Joined: Jul 2013
Reputation:
0
|
RE: Error expected method or property
(02-03-2015, 03:23 PM)Mudbill Wrote: I don't think you understand what we meant.
Where did you hear that you can write C++ for Amnesia? I was saying that the source is probably incorrect.
Romulator asked (I assume) what part of the Engine Scripts you don't understand, so that we can try explaining it to you. Okay,below I will write functions that can't understand:
float RandFloat(float afMin, float afMax); Generates a random float.
alMin - minimum value alMax - maximum value
bool StringContains(string& asString, string& asSubString); Checks whether a string contains the specified string. Example: searching for “hello” in “hello world” would return true.
asString - the string to check asSubString - the string to search for string& StringSub(string& asString, int alStart, int alCount); Returns the substring in a string. Example: in the string “frictional games rocks”, using 4 as alStart and 6 as alCount would return “tional”.
asString - the string alStart - start position in the string alCount - amount of characters
int StringToInt(string&in asString); :!: Requires 1.3
If possible, returns a string converted to an integer value, else returns 0.
asString - String to convert.
float StringToFloat(string&in asString); :!: Requires 1.3
If possible, returns a string converted to a float value, else returns 0.
asString - String to convert.
bool StringToBool(string&in asString); :!: Requires 1.3
If possible, returns a string converted to a boolean value, else returns false.
asString - String to convert.
Mathematical Operations
float MathSin(float afX); :!: Requires 1.3
Returns the sine of the specified value.
afX - Value to operate.
float MathCos(float afX); :!: Requires 1.3
Returns the cosine of the specified value.
afX - Value to operate.
float MathTan(float afX); :!: Requires 1.3
Returns the tangent of the specified value.
afX - Value to operate.
float MathAsin(float afX); :!: Requires 1.3
Returns the arc sine of the specified value.
afX - Value to operate.
float MathAcos(float afX); :!: Requires 1.3
Returns the arc cosine of the specified value.
afX - Value to operate.
float MathAtan(float afX); :!: Requires 1.3
Returns the arc tangent of the specified value.
afX - Value to operate.
float MathAtan2(float afX, float afY); :!: Requires 1.3
Calculates and returns the arc tangent of the specified values.
afX - First value to operate. afY - Second value to operate.
float MathSqrt(float afX); :!: Requires 1.3
Returns the square root of the specified value.
afX - Value to operate.
float MathPow(float afBase, float afExp); :!: Requires 1.3
Returns the value of afBase raised to the power of afExp.
afBase - The base value. afExp - Value to calculate the base with.
float MathMin(float afA, float afB); :!: Requires 1.3
Returns the lowest value.
afA - First value. afB - Second value.
float MathMax(float afA, float afB); :!: Requires 1.3
Returns the highest value.
afA - First value. afB - Second value.
float MathClamp(float afX, float afMin, float afMax); :!: Requires 1.3
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.
afX - The value to clamp. afMin - The minimum value to clamp afX with. afMax - The maximum value to clamp afX with.
float MathAbs(float afX); :!: Requires 1.3
Returns the absolute value.
afX - Value to operate.
Debugging
void Print (string& asString); Prints a string to the log.
void AddDebugMessage(string& asString, bool abCheckForDuplicates); Prints a string to the debug console.
asString - the string to print abCheckForDuplicates - if true, the string won't be printed more than once on screen until it disappears
void ProgLog(string& asLevel, string& asMessage); ?
asLevel - can be “Low”, “Medium” or “High” asMessage - ?
bool ScriptDebugOn(); Checks whether the debug mode is enabled. See Setting up Development Environment to setup debug mode on your own computer.
Variables
Local
Local variables can be used throughout the same script file.
void SetLocalVarInt(string& asName, int alVal); void AddLocalVarInt(string& asName, int alVal); int GetLocalVarInt(string& asName); void SetLocalVarFloat(string& asName, float afVal); void AddLocalVarFloat(string& asName, float afVal); float GetLocalVarFloat(string& asName); void SetLocalVarString(string& asName, const string& asVal); void AddLocalVarString(string& asName, string& asVal); string& GetLocalVarString(string& asName);
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave); :!: Requires 1.3
Removes an entity and places a new one in its place.
asName - Name of the entity to replace. asBodyName - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway). asNewEntityName - Name of the new entity. asNewEntityFile - Name of the new entity file. Extension .ent. abFullGameSave - Whether ALL properties of this entity should be saved throughout levels.
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation); :!: Requires 1.3
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.
asName - Name of the entity to place. asTargetEntity - Name of the other entity to place the first entity at. asTargetBodyName - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway). abUseRotation - Whether the entity should be rotated like the target entity.
void SetEntityPos(string &in asName, float afX, float afY, float afZ); :!: Requires 1.3
Moves an entity to a position in the level.
asName - Name of the entity to move. afX - X co-ordinate position. afY - Y co-ordinate position. afZ - Z co-ordinate position.
float GetEntityPosX(string &in asName); float GetEntityPosY(string &in asName); float GetEntityPosZ(string &in asName;
(This post was last modified: 02-04-2015, 01:26 PM by Icaab2608.)
|
|
02-04-2015, 01:25 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Error expected method or property
The explanation below each of them should tell you roughly what it does. For example the first one:
float RandFloat(float afMin, float afMax);
This function will return a random value between the specified minimum and maximum values. The data type will be a float. If you know C++, you know what a float is.
Let's say you have this:
float f1 = 1.0f;
float f2 = RandFloat(0.0f, 4.0f);
if(f2 < f1) { //execute script. }
This example effectively returns a 20% chance of the if-statement being accepted. f1 is valued at 1, and f2 has a completely random value between 0 and 4 (inclusive). If f2 turns out to become 0, then the if-statement passes because f2 is less than f1. If f2 turns out to randomly become either 1, 2, 3 or 4, then it does not pass.
That's just one example of course. I can't explain all those in detail, but they are used in combination with other scripts on the page.
You should focus on the more action-like ones to get used to how they work. The ones like PlaySoundAtEntity or AddEntityCollideCallback or SetEntityActive should be interesting to check out.
If there's something you don't know what does, you can either try it or just not use it. There's nothing forcing you into using every script listed.
(This post was last modified: 02-04-2015, 05:04 PM by Mudbill.)
|
|
02-04-2015, 05:02 PM |
|
|