Setting an area active [SOLVED] - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Setting an area active [SOLVED] (/thread-7915.html) |
Setting an area active [SOLVED] - Greven - 05-09-2011 Ok so i wanna set an area active with another area which activates a grunt. Meaning you walk in to one area and that activates a grunt and another area which you will walk into which will set of another grunt, but i dont know what kind of coding i should do to make the area active. Help plz :3 RE: Setting an area active - Khyrpa - 05-09-2011 Areas can be done active just like entities: SetEntityActive(string& asName, bool abActive); string &in asName = "nameofyourareahere" and bool is true = active false = unactive So you can put the collide callback in the OnStart part OR you could just keep the areas active and when u want the collide to happen.. just add the collide callback in the function that would activate the areas or smthing RE: Setting an area active - Roenlond - 05-09-2011 Code: void OnStart() That SHOULD work, although I haven't tested it in-game so I might have made mistakes. Alternatively, you could probably do something like this: Code: void OnStart() RE: Setting an area active - Khyrpa - 05-09-2011 whoa you did the whole scripts RE: Setting an area active - Roenlond - 05-09-2011 I consider it easier to learn with examples No meaning telling someone what to do, if you don't show them how to do it. RE: Setting an area active - Greven - 05-09-2011 God dammit, you did such nice explanations and I still got it wrong... Ok so my area's are called Death_1 And Death_2. Now this is the scripting: void OnStart() { AddEntityCollideCallback("Player", "Death_1", "CollideActiveGrunt", true,1); AddEntityCollideCallback("Player", "Death_2", "CollideActiveBrute", true,1); } void CollideActiveGrunt(string &in asEntity) { SetEntityActive("servant_grunt_2", true); SetEntityActive("Death_2", true); } void CollideActiveBrute(string &in asEntity) { SetEntityActive ("servant_brute_1", true); } But it doesnt work spot the problem? RE: Setting an area active - Khyrpa - 05-09-2011 change (string &in asEntity) BOTH OF THEM TO: (string &in asParent, string &in asChild, int alState) RE: Setting an area active - Kyle - 05-09-2011 @Greven, What is the error report? If there is none and it is just straight-up broken, then i don't know, maybe the space inbetween "SetEntityActive" and "("servant_brute_1", true);" on the second to last line? I don't think it should be there... :/ RE: Setting an area active - Greven - 05-09-2011 (05-09-2011, 08:46 PM)Khyrpa Wrote: change (string &in asEntity) BOTH OF THEM Cheers to you sir! @kyle, problem solved :3 Mister Khyrpa was too fast RE: Setting an area active [SOLVED] - Kyle - 05-09-2011 Hot damn! XD |