![]() |
Scripting 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: Scripting Help (/thread-16079.html) Pages:
1
2
|
Scripting Help - Clear - 06-12-2012 Hey guys, I'm really new at Scripting and i had this idea this other day of making a statue that moves everytime you reach a certain spot. (Script Area and such) I wanna make the statue to pretty much move multiple times at diffrent locations, The idea of the statue is going to cover the whole story so i think it's pretty advanced maybe, For example, let's say the name of the statue is: Statue1 And the area script is: SArea1 (Wich will continue to SArea2, SArea3, etc) So if any of you awesome people out there could tell me what's the code to make this work, I'd love you guys forever xD Thanks for reading and i'd appreciate any response! ![]() RE: Scripting Help - FlawlessHappiness - 06-12-2012 Does the player see it move, or does the player only notice that it HAS moved? RE: Scripting Help - Clear - 06-12-2012 (06-12-2012, 04:11 PM)beecake Wrote: Does the player see it move, or does the player only notice that it HAS moved?I was thinking the same thing, to make it like a Weeping angel or SCP-173 (You can google it) when you turn around it comes closer and closer and then Bam, you're dead. But after a while of seeing most of the scripting options i could see it's not possible, but if it is, feel free to share ![]() The idea is that the player goes to a certain area wich activates the statue to teleport closer and closer, sorta like a script area, that red one that activates stuffs when you go by pass it, it doesn't really matter if he see it or not =D Thanks for the reply RE: Scripting Help - Adny - 06-12-2012 (06-12-2012, 04:17 PM)Clear Wrote:You need to have a few of these statues set up, as well as multiple script areas. The easiest way to produce the effect you're looking for is to use the SetEntityActive function multiple times.(06-12-2012, 04:11 PM)beecake Wrote: Does the player see it move, or does the player only notice that it HAS moved?I was thinking the same thing, to make it like a Weeping angel or SCP-173 (You can google it) when you turn around it comes closer and closer and then Bam, you're dead. Imagine you have several statues lines up, the one in the back being active; when the player collides with a script area, set the one in the back inactive, and the set the one in front of it active, this will give the illusion that the statue's moving. Here's a script off the top of my head (so basically it might not be 100% accurate): void OnStart() { AddEntityCollideCallback("Player", "AreaMoveStatue_1", "CollideAreaMoveStatue_1", true, 1); AddEntityCollideCallback("Player", "AreaMoveStatue_2", "CollideAreaMoveStatue_2", true, 1); } void CollideAreaMoveStatue_1(string &in asParent, string &in asChild, int alState) { SetEntityActive("Statue_1", false); SetEntityActive("Statue_2", true); } void CollideAreaMoveStatue_2(string &in asParent, string &in asChild, int alState) { SetEntityActive("Statue_2", false); SetEntityActive("Statue_3", true); } ////end script To make this work, the Script (Red) areas will need to be called "AreaMoveStatue_1" and "AreaMoveStatue_2". The statues will need to be named "Statue_1" "Statue_2" & "Statue_3'. You can keep adding numbers and callbacks as long as you wish. Hope that helped! RE: Scripting Help - FlawlessHappiness - 06-12-2012 You could make an illusion so the player thinks that he is moving. Use a lot of statues that are inactive and 1 that is active. Then to make him move: First Statue (Active) => Inactive Statue that is closer to player (Inactive) => Active Then repeat repeat repeat RE: Scripting Help - Clear - 06-12-2012 (06-12-2012, 04:38 PM)beecake Wrote: You could make an illusion so the player thinks that he is moving. You're a GENIUS. Thank you so much man, I'd find the code somewhere =D Thankssss!!! <3 RE: Scripting Help - Adny - 06-12-2012 ಠ_ಠ Umm... RE: Scripting Help - Clear - 06-12-2012 (06-12-2012, 04:37 PM)andyrockin123 Wrote:That is an amazing idea!(06-12-2012, 04:17 PM)Clear Wrote:You need to have a few of these statues set up, as well as multiple script areas. The easiest way to produce the effect you're looking for is to use the SetEntityActive function multiple times.(06-12-2012, 04:11 PM)beecake Wrote: Does the player see it move, or does the player only notice that it HAS moved?I was thinking the same thing, to make it like a Weeping angel or SCP-173 (You can google it) when you turn around it comes closer and closer and then Bam, you're dead. Really creative idea and I'm sure it'll work fine! One last question if you can, What if i want to make a Moving Brick sound every time the statue "Moves" ? I Allready have the sound file, .ogg. Thanks again =D RE: Scripting Help - FlawlessHappiness - 06-12-2012 You can also use "scrape_rock.snt" But remember it needs an .snt file to be played So everytime the 'active' script happens use: PlaySoundAtEntity("RockScrape", "scrape_rock", "Player", 0.5f, false); Make a script area around every statue (Both inactive or active). Every inactive statue should have an inactive script around, and every active should be active. The area should actually fill the hole width of the room so when the player turns around this happens: void OnStart() { SetEntityPlayerLookAtCallback("ScriptArea_1", "StopScrapeSound", true); ///Do this with all the script areas } void StopScrapeSound(String &in asEntity, int alState) { if(alState == 1) { StopSound("RockScrape", 0.01); } }
I guess this should work.
Otherwise, try deleting the if-statement. Not sure if that will work
RE: Scripting Help - Datguy5 - 06-12-2012 (06-12-2012, 04:38 PM)beecake Wrote: You could make an illusion so the player thinks that he is moving.Andyrocking just explained that same >.< Also it doesnt have to be a snt sound file to be played.It can be ogg too. |