Author |
Message |
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
|
Wait how can you turn an actor into a material
So as the thread title says i need this for my gold transmuter, might as well learn now :/ So if any1 can tell me if this is possible? As far as i know it involves collision with the particle then this = actor and turn into material which = gold? HELP!!! My Lua Scripting Level, only mounting turrets on Dropships.
|
Mon Oct 19, 2009 2:52 am |
|
|
zalo
Joined: Sat Feb 03, 2007 7:11 pm Posts: 1496
|
Re: Wait how can you turn an actor into a material
You can't, unless you want to move the actor underground, gib it, and release a puddle of gold where it was standing.
|
Mon Oct 19, 2009 2:55 am |
|
|
Rawtoast
Joined: Mon Apr 06, 2009 9:41 am Posts: 712 Location: New York
|
Re: Wait how can you turn an actor into a material
You don't need Lua for this. Just make copies of your torso, head, and arm sprites which appear gold in color. Make these your gibs. Put them right over the arms, legs, head, and torso of your alive actor in the gib editor. Then, in your gib ini, change the material of these gibs from flesh to gold. Bingo.
Edit: Oops, didn't realize you meant for an actor to turn into a material when you shoot it with something.
Last edited by Rawtoast on Mon Oct 19, 2009 4:16 am, edited 1 time in total.
|
Mon Oct 19, 2009 3:07 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Wait how can you turn an actor into a material
He wants to transmute actors into gold. What might be a better solution, Mr. dragon, would be to read the gold value of the actor in question and spawn a proportionate amount of gold bricks at the place the actor was.
|
Mon Oct 19, 2009 3:09 am |
|
|
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
|
Re: Wait how can you turn an actor into a material
so could you like have any lua script kill the actor then like place total proportionate amount of gold there?
|
Mon Oct 19, 2009 3:26 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Wait how can you turn an actor into a material
Pick a target with one of the proximity scripts, call actor:GibThis() (where actor is a reference to the closest actor), and do the following pseudocode. numOfBricks = actor.GoldCost / 10 (summon numOfBricks bricks) at actor.Location() * math.random() * 32.
|
Mon Oct 19, 2009 3:57 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Wait how can you turn an actor into a material
If you set any MOSR's material to gold once it settles you can collect it. The code for what you are talking about though would be: Code: function Update(self) for actor in MovableMan.Actors do local avgx = actor.Pos.X - self.Pos.X; local avgy = actor.Pos.Y - self.Pos.Y; local dist = math.sqrt(avgx ^ 2 + avgy ^ 2); if dist < 200 and actor.Team ~= self.Team then numbricks = math.floor(actor.GoldValue / 10); local particle = CreateMOSRotating("Gold Brick 10oz"); -- I think this is it's name. particle.Pos = actor.Pos; particle.Vel = actor.Vel; for i = 1,numbricks do MovableMan:AddParticle(particle); end actor:GibThis(); end end end
Last edited by CrazyMLC on Mon Oct 19, 2009 5:38 pm, edited 1 time in total.
|
Mon Oct 19, 2009 8:36 am |
|
|
findude
Joined: Tue Dec 12, 2006 3:10 pm Posts: 495 Location: Uncertain quantum state
|
Re: Wait how can you turn an actor into a material
Code: actor.Health = -1; actor.ToSettle = true; Dunno about the gold part, I think theres no way you can hack the material to different one.
|
Mon Oct 19, 2009 5:30 pm |
|
|
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
|
Re: Wait how can you turn an actor into a material
CrazyMLC wrote: If you set any MOSR's material to gold once it settles you can collect it. The code for what you are talking about though would be: Code: function Update(self) for actor in MovableMan.Actors do local avgx = actor.Pos.X - self.Pos.X; local avgy = actor.Pos.Y - self.Pos.Y; local dist = math.sqrt(avgx ^ 2 + avgy ^ 2); if dist < 200 and actor.Team ~= self.Team then numbricks = math.floor(actor.GoldValue / 10); local particle = CreateMOSRotating("Gold Brick 10oz"); -- I think this is it's name. particle.Pos = actor.Pos; particle.Vel = actor.Vel; for i = 1,numbricks do MovableMan:AddParticle(particle); end actor:GibThis(); end end end Ty ill try now, thnx for helping.
|
Tue Oct 20, 2009 12:56 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Wait how can you turn an actor into a material
Well, that isn't exactly working code. There are still optimizations and I'm not sure about what the presetname of the gold brick is.
|
Tue Oct 20, 2009 1:59 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Wait how can you turn an actor into a material
It's a MOSParticle. "10 oz Gold Brick"
|
Tue Oct 20, 2009 2:08 am |
|
|
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
|
Re: Wait how can you turn an actor into a material
well could you tell me what to add, ill fix the mosparticle 10 ox oz* (zomg my SPELLING) gold brick, more help pls.
|
Tue Oct 20, 2009 2:11 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Wait how can you turn an actor into a material
Code: function Update(self) for actor in MovableMan.Actors do local dist = SceneMan:ShortestDistance(actor.Pos,self.Pos,true).Magnitude; if dist < 20 and actor.Team ~= self.Team then if actor.GoldValue ~= 0 then numofbricks = math.floor(actor.GoldValue / 10); else numofbricks = 0; end local particle = CreateMOSParticle("10 oz Gold Brick"); particle.Pos = actor.Pos; particle.Vel = actor.Vel; for i = 1,numofbricks do MovableMan:AddParticle(particle); end actor:GibThis(); end end end This should work.
Last edited by CrazyMLC on Tue Oct 20, 2009 3:22 am, edited 4 times in total.
|
Tue Oct 20, 2009 2:35 am |
|
|
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
|
Re: Wait how can you turn an actor into a material
ok so i attach to gun after preset game using ScriptPath = right?
|
Tue Oct 20, 2009 2:50 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Wait how can you turn an actor into a material
Yes, but: Recopy the code, I had a typo. Apply it to the bullet the gun shoots, not the gun.
|
Tue Oct 20, 2009 3:23 am |
|
|
|