View unanswered posts | View active topics It is currently Wed Dec 11, 2024 11:06 am



Reply to topic  [ 6 posts ] 
 AB = CreateHDFirearm? 
Author Message
User avatar

Joined: Tue Jun 19, 2007 2:51 pm
Posts: 85
Location: in photoshop, in a corner; ordening pixels
Reply with quote
Post 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)


Sun Mar 08, 2009 9:30 am
Profile
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post Re: AB = CreateHDFirearm?
HDFirearms don't make very good Scene Objects. I would recommend that you use MovableMan:AddItem(AB1) instead.


Mon Mar 09, 2009 4:32 am
Profile
User avatar

Joined: Tue Jun 19, 2007 2:51 pm
Posts: 85
Location: in photoshop, in a corner; ordening pixels
Reply with quote
Post 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


Mon Mar 09, 2009 2:46 pm
Profile
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post 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.


Tue Mar 10, 2009 6:26 am
Profile
User avatar

Joined: Tue Jun 19, 2007 2:51 pm
Posts: 85
Location: in photoshop, in a corner; ordening pixels
Reply with quote
Post 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...


Tue Mar 10, 2009 9:21 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: AB = CreateHDFirearm?
Actually, MovableMan:IsParticle(<insert name here>) returns false if it's gone.


Tue Mar 10, 2009 7:34 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.037s | 15 Queries | GZIP : Off ]