![]() |
I need some help. - 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: I need some help. (/thread-15346.html) Pages:
1
2
|
I need some help. - Sanshi - 05-09-2012 Hello! New guy here, I have just set up my Room, and I want to make it so when I touch an object, it disappears, you get a little sanity damage and it's all good. I think I've done the first part right... no idea how to put in the other stuff. Spoiler below!
Any other things I need to add... the script function list is so long, not easy to find the things I need. And yes I watch PewDiePie, therefore: Stephano. RE: I need some help. - Cranky Old Man - 05-09-2012 Since you are not alone in doing this, what's your reasoning behind putting each individual line within brackets? Quote:Any other things I need to add... the script function list is so long, not easy to find the things I need. Your browser should contain a page search function. RE: I need some help. - Prelauncher - 05-09-2012 void OnStart() { AddEntityCollideCallback("Player" , "Stephano1" , "StephanoGone" , true , 1); } void StephanoGone(string &in asParent, string &in asChild, int alState) { GiveSanityDamage(AmountOfDamage, UseEffect?IfYesUse: true IfNot: false); SetEntityActive("Stephano1", false); } void OnEnter() { } void OnStart() { } RE: I need some help. - Sanshi - 05-09-2012 (05-09-2012, 06:46 PM)Prelauncher Wrote: void OnStart()Didn't work for me somehow... Maybe I've placed the script file Incorrectly... I've placed it where my map is, which I think it should be. RE: I need some help. - Adrianis - 05-09-2012 (05-09-2012, 06:36 PM)Sanshi Wrote: Hello! New guy here, I have just set up my Room, and I want to make it so when I touch an object, it disappears, you get a little sanity damage and it's all good.So, that 'SetEntityActive' needs to be executed as part of the callback. You've set the callback, so when the player collides with the object it calls the function 'StephanoGone'. You want to add some sanity damage too... The callback function should be this, void StephanoGone(string &in asParent, string &in asChild, int alState) { SetEntityActive("Stephano1", false); GiveSanityDamage(float afAmount, bool abUseEffect); (replace float afAmount with amount of damage to deal, and bool abUseEffect as whether to use the sanity damage effect) } Bear in mind, I've never used the sanity damage function but I would imagine that works... It's all taken from the engine scripts page on the wiki mate, you just have to look for what you want on there Also, this should be posted in the Dev support forum ![]() RE: I need some help. - Sanshi - 05-09-2012 (05-09-2012, 06:58 PM)Adrianis Wrote:I just found out something, the Script works, but not when I pick him up... only when I "touch" him... like pick him up and drop him on my face... then he disappears. How can I do it so it happens when I pick him up?(05-09-2012, 06:36 PM)Sanshi Wrote: Hello! New guy here, I have just set up my Room, and I want to make it so when I touch an object, it disappears, you get a little sanity damage and it's all good.So, that 'SetEntityActive' needs to be executed as part of the callback. You've set the callback, so when the player collides with the object it calls the function 'StephanoGone'. You want to add some sanity damage too... The callback function should be this, RE: I need some help. - Adrianis - 05-09-2012 SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction); Use that to set the callback instead of the collide one RE: I need some help. - Cranky Old Man - 05-09-2012 (05-09-2012, 06:54 PM)Sanshi Wrote: Didn't work for me somehow... Maybe I've placed the script file Incorrectly... I've placed it where my map is, which I think it should be.Did you actually read and understand the script, or did you just copy and paste it, thinking we'll script everything for you? RE: I need some help. - Adrianis - 05-09-2012 No need to get Cranky, Old Man. I'd script it for him ![]() RE: I need some help. - Cranky Old Man - 05-09-2012 (05-09-2012, 07:07 PM)Adrianis Wrote: No need to get Cranky, Old Man. I'd script it for himYes, you'd script it for him now, and then he'll come back tomorrow, wanting the next thing done in another post. If you want to script for him, consider teaming up with him, as a scripter for his mod. |