Data Realms Fan Forums http://45.55.195.193/ |
|
AB = CreateHDFirearm? http://45.55.195.193/viewtopic.php?f=73&t=13885 |
Page 1 of 1 |
Author: | meloen [ Sun Mar 08, 2009 9:30 am ] |
Post subject: | AB = CreateHDFirearm? |
Code: AB1 = CreateHDFirearm("AmmoBox","Somthing.rte") AB1.Pos = Vector(1940,681); SceneMan:AddSceneObject(AB1) is there a better code for what im trying to do here?... this one crashes after 3 times CTRL + R, when quiting the game and when destroying the box and then CTRL + R. or is there a way to link normall scene objects to Lua scripting and link them to AB1? (so i can make triggers with them) |
Author: | Lord Tim [ Mon Mar 09, 2009 4:32 am ] |
Post subject: | Re: AB = CreateHDFirearm? |
HDFirearms don't make very good Scene Objects. I would recommend that you use MovableMan:AddItem(AB1) instead. |
Author: | meloen [ Mon Mar 09, 2009 2:46 pm ] |
Post subject: | Re: AB = CreateHDFirearm? |
the problem is, i want a good and clear sign that sais: ammo box. so people will notice that they can get ammo. I’ve made the code on a way that the box explodes when going near it, a message shows up and ammo is added to your inventory. it works really well, apart from the fact that the game crashes after 1 time CTRL + R (its 1 time now...) I’m going to try to find a way around this (if it is possible to link normal code objects to Lua code). im all open for any other suggestions, if somebody has some. ---edit found it! there is actualy a code in zombiecave.lua that sais: Code: self.Generator1 = CreateAEmitter("Zombie Generator"); self.Generator1.Pos = Vector(339, 219); self.Generator1.Team = self.CPUTeam; self.Generator1:EnableEmission(false); MovableMan:AddParticle(self.Generator1); in wich i use the Team and AddParticle, wich works perfectly |
Author: | Lord Tim [ Tue Mar 10, 2009 6:26 am ] |
Post subject: | Re: AB = CreateHDFirearm? |
Well if it is just a sign that isn't going to be picked up or anything, then yes, AddParticle will be the best way to go. And I would also suggest that you create it as a MOSRotating if it will be collided with, and if it won't be, then use MOSParticle. |
Author: | meloen [ Tue Mar 10, 2009 9:21 am ] |
Post subject: | Re: AB = CreateHDFirearm? |
theres no code part where you can check if the particle is still there, so it will crash when you shoot it to pieces and then the code wants to gib it. so i made it untuchable to everything... |
Author: | TheLastBanana [ Tue Mar 10, 2009 7:34 pm ] |
Post subject: | Re: AB = CreateHDFirearm? |
Actually, MovableMan:IsParticle(<insert name here>) returns false if it's gone. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |