Deactivating/activating billboards - 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: Deactivating/activating billboards (/thread-7013.html) Pages:
1
2
|
Deactivating/activating billboards - palistov - 03-23-2011 Hey all, I have a cool idea to make an scary event in which the player sees a shadow of something sinister fly past a window. The only problem is I need to deactivate the light billboards in sequence. My script for this is set up, but it uses SetEntityActive, and billboards are not considered entities. The script worked perfectly...but I used wine bottles :S Does anyone know a way to deactivate them and then reactivate them in-sequence? Thanks for any tips! Also, I'd like to post the actual script for this sequence. Can someone tell me how to put a box in the post that lets me put in the script? Thanks Then you can see if there's a cleaner and shorter way to have it do what I want. RE: Deactivating/activating billboards - Tanshaydar - 03-23-2011 Tie the billboards to a light source, than close the lights. RE: Deactivating/activating billboards - palistov - 03-23-2011 Sweet I'll give that a shot. Thanks. RE: Deactivating/activating billboards - palistov - 03-24-2011 Hi. That worked perfectly, but I need some help with the code. I'll try posting what I've put together, but it is VERY sloppy, and actually crashed the game. Code: //BACKUP SHADOWRUN I'm looking over the code I posted. It's bad. I'm gonna have to start from scratch with the help of you guys RE: Deactivating/activating billboards - Tanshaydar - 03-24-2011 Did you try to flicker it? RE: Deactivating/activating billboards - palistov - 03-24-2011 No haven't done that. It may cause me the same type of problems because I'll have to turn off the flicker, right? Either way that's a good idea I'll give that a shot. Thanks Tanshaydar RE: Deactivating/activating billboards - Pandemoneus - 03-24-2011 Well, first of all, you made an integer and a string using the same name ("sequence"), that won't work. Second thing: What is that "t" in your for-loop? The string? It doesn't work like that in Amnesia. First of all, you try to subtract a string from an integer, which would already throw an error. Second thing, "t" must be an integer instead of a string. Third thing is, you will need to use GetLocalVarInt to access it. And a summarized function instead of all your 14 would probably look like this: void deactivate(string &in asTimer) { SetLightVisible(asTimer, false); } and you call that function like that: for (int i = 1; i <= 14; i++) { AddTimer("PointLight_"+i, i, "deactivate"); //this would disable one light each second } RE: Deactivating/activating billboards - palistov - 03-24-2011 Hey Pandemoneus! Yeah I know the script is horrid and I still don't fully understand the language. I saw the for(int i = 1; i <10; i++) script in the beginner tutorial on the wiki, but I assumed that I could use any variable I chose in place of 'i'. Anyways, thanks for clearing so much of this up. Your suggested function looks great! I would just have the time in the AddTimer function related to its number, correct? Something like this: AddTimer("PointLight_"+s, 0.08 * s, "deactivate"); I don't know if thats the proper way to multiply things in this script. Thanks so much to both of you for your help!! RE: Deactivating/activating billboards - Pandemoneus - 03-24-2011 It doesn't have to be i, but in common for-loops i is always used for that (you could name it ohhithere aswell). And yes that's the correct way to multiply, it would be 0.08 first, then 0.16, and so on. Note that this time length is pretty short though. [edit] Also just noticed that I missed the time top. ^_^ RE: Deactivating/activating billboards - palistov - 03-24-2011 Yeah I want them to flicker in sequence with the whole shabang happening withing a second. Scary things move fast It works PERFECTLY, Pandemoneus. You sir, are a great person! |