[SCRIPT] Need help with hazards - 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] Need help with hazards (/thread-18450.html) |
Need help with hazards - ooadrianoo - 09-22-2012 This is my first contacts with hazards. There are 5 barrels. The barrels should be spawn randomly, and should removed randomly. Here is my script: PHP Code: void OnStart() Can anyone tell me, that I have done false? RE: Need help with hazards - Adny - 09-22-2012 Try RandInt instead of RandFloat; The game is generating a random decimal between 1 & 6, but I'm assuming the names of the barrels in the level editor (that you're trying to set active) are just integers (i.e. "barrel_1", not "barrel_1.241") Scripting isn't my cup of tea, but I hope that helped! RE: Need help with hazards - Your Computer - 09-22-2012 You declared iBarrel locally, but tried to access it as if it were declared in the global scope. RE: Need help with hazards - ooadrianoo - 09-22-2012 Please can you post a right script? I come from Germany so I can't understand everything you write. RE: Need help with hazards - Your Computer - 09-22-2012 You don't explain much in what exactly you're trying to achieve, nor does your code allow me to make safe assumptions. Nevertheless, i'd rewrite your code like so: PHP Code: void OnStart() RE: Need help with hazards - ooadrianoo - 09-22-2012 (09-22-2012, 02:16 AM)Your Computer Wrote: You don't explain much in what exactly you're trying to achieve, nor does your code allow me to make safe assumptions. Nevertheless, i'd rewrite your code like so: RE: Need help with hazards - WALP - 09-22-2012 barrels?, I sense a pewdiepie themed custom story here. just saying |