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


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error message
Author Message
mr.bonent Offline
Junior Member

Posts: 47
Joined: May 2011
Reputation: 0
Post: #21
RE: error message

Ok now..

Thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("kasten", true);
}
void OnEnter()
{
}
void OnLeave()
{
}


But it doesn't work. when I enter the area, nothing happen.
Have I to write some function in the leveleditor in the specific area-menu or entity-menu?
05-30-2011 08:20 PM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #22
RE: error message

(05-30-2011 08:20 PM)mr.bonent Wrote:  Ok now..

Thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("kasten", true);
}
void OnEnter()
{
}
void OnLeave()
{
}


But it doesn't work. when I enter the area, nothing happen.
Have I to write some function in the leveleditor in the specific area-menu or entity-menu?

The script area needs to be called exactly "ScriptArea_1" and the entity needs to be called exactly "kasten". You shouldn't need to edit anything else.
05-30-2011 08:25 PM
Find all posts by this user Quote this message in a reply
mr.bonent Offline
Junior Member

Posts: 47
Joined: May 2011
Reputation: 0
Post: #23
RE: error message

very strange.. Everything fits how it should, but this cabinet ist still inactive.
Any other ideas?
05-30-2011 08:33 PM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #24
RE: error message

(05-30-2011 08:33 PM)mr.bonent Wrote:  very strange.. Everything fits how it should, but this cabinet ist still inactive.
Any other ideas?

Some objects can't be activated, switch the entity to a book or something and try it that works. Also, use SetDebugMessage("anything", false); in the same function as your SetEntityActive. If you have debug messages turned on (press f1 if you have a dev environment set up), you will see the message "anything" display. If it does, that means the function works just fine and the entity itself is the problem.
05-30-2011 08:38 PM
Find all posts by this user Quote this message in a reply
mr.bonent Offline
Junior Member

Posts: 47
Joined: May 2011
Reputation: 0
Post: #25
RE: error message

Ok, thanks for fast answer!

Now thats my script:

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("buch", true);
SetDebugMessage("buch", false);
}
void OnEnter()
{
}
void OnLeave()
{
}


No Debug message appears, and also the book. Whats my wrong turn?
05-30-2011 08:50 PM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #26
RE: error message

The script can't be the fault then. Are you completely sure that your script area is called "ScriptArea_1"? It is case sensitive.
05-30-2011 08:53 PM
Find all posts by this user Quote this message in a reply
mr.bonent Offline
Junior Member

Posts: 47
Joined: May 2011
Reputation: 0
Post: #27
RE: error message

case sensitive is ok.

Thats it hows it looks like.
It's right that the book is "inactive" in the Leveleditor yeah?


Attached File(s)
.jpg  pic.jpg (Size: 135.2 KB / Downloads: 9)
05-30-2011 08:58 PM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #28
RE: error message

Honestly, I have no idea what's wrong. Are you sure your script file is called testmap.hps? Is the script loading at all? (add a debug message at the onstart)

the book should be set to inactive if you then want to activate it, yeah, but that is unimportant. If the debug message doesn't show up, the function isn't working at all.
05-30-2011 09:02 PM
Find all posts by this user Quote this message in a reply
mr.bonent Offline
Junior Member

Posts: 47
Joined: May 2011
Reputation: 0
Post: #29
RE: error message

Want do you mean with
"Is the script loading at all? (add a debug message at the onstart)" ?

Should I send yo the files and want you to test it on your computer?
05-30-2011 09:07 PM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #30
RE: error message

In the void OnStart() function, add SetDebugMessage("scriptworking", false); to see if the script works at all. Sure, send me the file. I'll have a look at them first thing tomorrow unless you figured it out before then Smile
05-30-2011 09:18 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)