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
Error expected method or property
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#6
RE: Error expected method or property

Well, for one, you can't use C++ to write scripts for this game; Amnesia uses a scripting language called AngelScript.
Now, while AngelScript does support classes, there are some limitations, and the syntax is not the same as in C++. Finally, you have a bunch of syntax and logic errors. You can't just put an if-statement directly in a class - your class needs to have member functions, and you put executable code (like your if-statements) within these functions. Specifically, you probably intended to wrap these into the Update member function, since that's what you're calling on the object in the callback. But, there are other problems. You use symbols that are not defined for the game. Then, you have two blocks of code ("{ some_code }") that do not belong to anything, which may or may not be allowed in AngelScript (both under the if-statements with the single-line bodies):
PHP Code: (Select All)
if (event.KeyInput.Key==KEY_KEY_A)    // <---- the game doesn't know what any of these are
                    
left=false;    //  <---- the if-statement ends right here!
{
    
// any code here has nothing to do with the if-statement above


Also, BUTTONS_GO_TIMER_CALLBACK won't be called by anything, unless you somehow tell the game to do so (and when to do so).

Anyway, have you copied some of the code from a different game? Generally, code written for one game won't work at all with another - different games won't support the same things, and if they do, they will have different names and syntax for the same kins of functions, or they might use an altogether different. There's no cross-engine standardization of that sort.
(This post was last modified: 02-01-2015, 06:31 AM by TheGreatCthulhu.)
02-01-2015, 06:30 AM
Find


Messages In This Thread
Error expected method or property - by Icaab2608 - 01-31-2015, 08:34 PM
RE: Error expected method or property - by TheGreatCthulhu - 02-01-2015, 06:30 AM



Users browsing this thread: 1 Guest(s)