Script/area problem. - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Script/area problem. (/thread-19845.html) Pages:
1
2
|
RE: Script/area problem. - FlawlessHappiness - 01-07-2013 Its ok. I see now that the value for that monster function is actually 1... But it's still false RE: Script/area problem. - FlawlessHappiness - 01-07-2013 (01-07-2013, 07:32 PM)Robosprog Wrote: Monster doesn't spawn at all, and I don't do quick reloads because of that, I restart entire story/game. And it only activates once, with that script, and I have tested that on another map :p. That's weird. Because you put false in there, it should activate again when you collide with the area again RE: Script/area problem. - Your Computer - 01-07-2013 Is the area itself active? RE: Script/area problem. - TheGreatCthulhu - 01-07-2013 I've tested the script - as far as code goes, it's well formed (should work in theory). Is your monster by any chance completely inside (or at least intersects with) ScriptArea_1? Like, did you want it to be deactivated once it exits that area? That would explain it all. If it is, then almost as soon as you activate it in cake(), a collision is detected with the script area, so cake1() is called, where the monster is immediately disabled. It happens so fast you can't even see the enemy appearing in game. If that's it, you can simply fix the problem by editing the cake() function, replacing the last parameter to AddEntityCollideCallback() from 1 (collision detected on enter) to -1 (collision detected on exit): AddEntityCollideCallback("suitor", "ScriptArea_1", "cake1", false, -1); BTW, to avoid errors of this kind, which arise when code is based on "magic numbers", it's a good idea to use named constants - you don't have to worry about actual values all the time, and it improves code readability. Something like this: PHP Code: // First you consult the wiki once, to see what the values mean, P.S. In code editors you can usually make use of the auto-completion feature. In Notepad++, you can start to type the name of the constant, or function you've allready defined/used elsewhere (like: COLL), and then press Ctrl+Enter (on Windows) to get auto-completion suggestions (which will be, in this case, the three constants declared at the top). RE: Script/area problem. - TheGreatCthulhu - 01-07-2013 EDIT: Didn't see your last post, I'll get to it soon. @OP: If I'm right about what you're trying to do, then it doesn't really matter that the 4th parameter (abDeleteOnCollide) is false, since the monster just disappears one the false-alarm scare is over, but, if you're not going to re-activate the monster later, I'd listen to advice from beecake anyway - setting that parameter to true will enable the game to release any internal resources that are not needed (it probably won't terribly matter, but it's a good practice). And if the monster needs to be reactivated and deactivated again later on, once the player colides with "area", cake() will be called again, so a new "suitor"-"ScriptArea_1" collision callback will be added anyway. In fact, if this callback needs to stay in effect the entire gameplay time, you can leave the abDeleteOnCollide parameter false, and move the AddEntityCollideCallback() function call from cake() to OnStart(). It's enough for it to execute just once, from there. But, dint's you say that the monster won't even appear/load? Anyway, if it's not what I thought it was, I can only take wild guesses... Really weird. Oh, I don't know... Are you sure you used PathNodes (show up as little flags), and not PosNodes (show up like little circular gizmos)? EDIT: Scratch that, just seen your screenshot again - it's path nodes. Are all the names correct? RE: Script/area problem. - The chaser - 01-08-2013 I think that if the monster appears but doesn't walk it must be a NODES file problem. Could you please open with notepad++ the NODES file in the CS folder? They usually look like this: Code: <AINodes> <Node Name="PathNodeArea_1" ID="123"> <Edge Node="PathNodeArea_6" Distance="1.00000000000000000000" /> <Edge Node="PathNodeArea_7" Distance="2.50000000000000000000" /> <Edge Node="PathNodeArea_2" Distance="3.50891709327697750000" /> <Edge Node="PathNodeArea_5" Distance="4.25000000000000000000" /> </Node> <Node Name="PathNodeArea_2" ID="124"> <Edge Node="PathNodeArea_5" Distance="0.79056942462921143000" /> <Edge Node="PathNodeArea_6" Distance="2.51246881484985350000" /> <Edge Node="PathNodeArea_4" Distance="2.85043859481811520000" /> <Edge Node="PathNodeArea_3" Distance="3.25960111618041990000" /> <Edge Node="PathNodeArea_1" Distance="3.50891709327697750000" /> </Node> <Node Name="PathNodeArea_3" ID="125"> <Edge Node="PathNodeArea_5" Distance="3.16227769851684570000" /> <Edge Node="PathNodeArea_2" Distance="3.25960111618041990000" /> </Node> <Node Name="PathNodeArea_4" ID="126"> <Edge Node="PathNodeArea_2" Distance="2.85043859481811520000" /> <Edge Node="PathNodeArea_5" Distance="3.00000000000000000000" /> </Node> <Node Name="PathNodeArea_5" ID="127"> <Edge Node="PathNodeArea_2" Distance="0.79056942462921143000" /> <Edge Node="PathNodeArea_4" Distance="3.00000000000000000000" /> <Edge Node="PathNodeArea_3" Distance="3.16227769851684570000" /> <Edge Node="PathNodeArea_6" Distance="3.25000000000000000000" /> <Edge Node="PathNodeArea_1" Distance="4.25000000000000000000" /> </Node> <Node Name="PathNodeArea_6" ID="128"> <Edge Node="PathNodeArea_1" Distance="1.00000000000000000000" /> <Edge Node="PathNodeArea_2" Distance="2.51246881484985350000" /> <Edge Node="PathNodeArea_5" Distance="3.25000000000000000000" /> <Edge Node="PathNodeArea_7" Distance="3.50000000000000000000" /> </Node> <Node Name="PathNodeArea_7" ID="129"> <Edge Node="PathNodeArea_1" Distance="2.50000000000000000000" /> <Edge Node="PathNodeArea_6" Distance="3.50000000000000000000" /> </Node></AINodes> You may delete the nodes and replace them with new ones. RE: Script/area problem. - Your Computer - 01-09-2013 Send us a copy of the map and hps file. If you're still having this issue, at this point we'll only be able to figure it out on our side. RE: Script/area problem. - TheGreatCthulhu - 01-10-2013 Just a question: were you using an enemy entity which came with the game, or did you make your own? Maybe there was something wrong with the entity itself? RE: Script/area problem. - The chaser - 01-11-2013 (01-11-2013, 08:41 AM)Robosprog Wrote:(01-10-2013, 10:44 PM)TheGreatCthulhu Wrote: Just a question: were you using an enemy entity which came with the game, or did you make your own? Maybe there was something wrong with the entity itself? Perhaps he had some little changed parameters? RE: Script/area problem. - TheGreatCthulhu - 01-11-2013 Maybe it's just some weird bug, out of nowhere... Have you replaced it with a different monster, or have you just deleted and then recreated the entity of the same type? If former, does the bug reappear if you add the original monster back? |