View unanswered posts | View active topics It is currently Thu Apr 25, 2024 4:16 pm



Reply to topic  [ 11 posts ] 
 Tiberium Extended help required 
Author Message
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Tiberium Extended help required
I need this changed to use the Tiberium actors that its attached to instead of pixels, the person who does it gets a nice place in the index file.
Only if it gets done before i find a fix.

Code:
function Update(self)
   if math.random() <= .02 then
      for actor in MovableMan.Actors do
      local part = CreateMOPixel("Spark Green");
      part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
      MovableMan:AddParticle(part);
         local curdist;
         curdist = math.sqrt(math.pow(self.Pos.X - actor.Pos.X,2) + math.pow(self.Pos.Y - actor.Pos.Y,2))
         if curdist <= self.killdist and actor:IsInGroup("Tiberium") == false  then
            if actor.ClassName ~= "ACraft" then
               actor.Health = actor.Health - 10
            else
               actor.Health = actor.Health - 1
            end
            local i = 0;
            while i <= 2 do
               local part = CreateMOPixel("Spark Green Glow");
               part.Pos = actor.Pos + Vector(math.random(-15,15), math.random(-15,15));
               MovableMan:AddParticle(part);
               i = i + 1
            end
         end
         if actor.Health <= 30 and curdist <= self.killdist then
            actor:GibThis();
            local part = CreateACrab("Visceroid");
            part.Pos = actor.Pos;
            part.Health = 200;
            MovableMan:AddParticle(part);
         end
      end
   end
   if math.random() <= .0001 then
      local part = CreateActor("Tiberium Wall Breacher");
      part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-5,15));
      MovableMan:AddParticle(part);
   end
   if math.random() <= .00001 then
      local part = CreateACrab("Floater");
      part.Pos = self.Pos + Vector(0, -15);
      MovableMan:AddParticle(part);
   end
---   if math.random() <= .001 then
---      if math.random() <= .05 then
---         local part = CreateActor("Tiberium Blue A");
---         part.Pos = self.Pos
---         MovableMan:AddParticle(part);
---         self.ToDelete = true;
---      end
---   end


Tue Jan 25, 2011 7:44 am
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post Re: Tiberium Extended help required
I have no ♥♥♥♥ idea of what you are trying to say..


Wed Jan 26, 2011 12:28 pm
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Tiberium Extended help required
Its a lua script, Its used to make the Tiberium expand and damage nearby actors. I want the script to target the Tiberium actors, instead of creating sparks that it uses as a targeting system.


For you who know what your doing, should i redo the script entirely with my limited knowledge?


Wed Jan 26, 2011 12:57 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post Re: Tiberium Extended help required
So you want the Tiberium actor to damage normal actors like the tiberium?

if so, why cant you simply attach the script to the tiberium actor minus?

-- local part = CreateMOPixel("Spark Green");
-- part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
-- MovableMan:AddParticle(part);


Wed Jan 26, 2011 3:04 pm
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Tiberium Extended help required
none wrote:
So you want the Tiberium actor to damage normal actors like the tiberium?

if so, why cant you simply attach the script to the tiberium actor minus?

-- local part = CreateMOPixel("Spark Green");
-- part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
-- MovableMan:AddParticle(part);


I did but that neuters the Tiberium, meaning that it wont expand.


Wed Jan 26, 2011 3:08 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post Re: Tiberium Extended help required
I had a look at the tiberium mod to understand.

Is it that you want the tiberium to infect normal actors so that, that actor harms other actors?

If so you would want something like this

function Create(self)
   self.infected = {};
end

function update(self)

for actor in MovableMan.Actors do
   for i = 1, #self.infected do
      if MovableMan:ValidMO(self.infected[i]) then
         local dist = math.sqrt(math.pow(self.infected[i].Pos.X - actor.Pos.X,2) + math.pow(self.infected[i].Pos.Y - actor.Pos.Y,2));
         if dist < self.killdist then
            actor.Health = actor.Health - 1; -- or whatever
         end
      else
         self.infected[i] = nil;
      end
   end
end
end


Wed Jan 26, 2011 3:56 pm
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Tiberium Extended help required
I believe I'm not being clear. :-( Although i probably will add that to the mod but its not what i meant.

The Tiberium related to this script are actors without arms,legs, or a head.
This lua script creates a particle named part near the Tiberium actor, then the script finds all of these "Tiberium Particles" shall we say then finds all nearby actors. If the nearby actors are not in the group "Tiberium" the lua script will go into action, it spawns Tiberium Particles at the actors coordinates thus the visual evidence that they are infected, but while that's happening its also decreasing the actors health.

I need the part that creates Particles at the Tiberium and "infected actors" removed, and the lua to use the Tiberium actors in place of the particles, without removing the parts that make the Tiberium expand.


Wed Jan 26, 2011 5:14 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post Re: Tiberium Extended help required
Quote:
I believe I'm not being clear.


lol its not you its me, believe me :grin:

I hope this is what you want??

Code:
function Update(self)
   if math.random() <= .02 then
      local rand = math.random();
      if rand >= .66 then
          local part = CreateActor("Tiberium A");
          part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
          MovableMan:AddParticle(part);
      elseif rand >= .33 then
          local part = CreateActor("Tiberium B");
          part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
          MovableMan:AddParticle(part);
      else
          local part = CreateActor("Tiberium C");
          part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-15,15));
          MovableMan:AddParticle(part);
      end
   end
   if math.random() <= .0001 then
       local part = CreateActor("Tiberium Wall Breacher");
       part.Pos = self.Pos + Vector(math.random(-10,10), math.random(-5,15));
       MovableMan:AddParticle(part);
   end
   if math.random() <= .00001 then
      local part = CreateACrab("Floater");
      part.Pos = self.Pos + Vector(0, -15);
      MovableMan:AddParticle(part);
   end
end


Wed Jan 26, 2011 5:51 pm
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Tiberium Extended help required
Actually that's a good fix but it doesn't help with the non-Tiberium own-age :-(
Thanks I think I might be able to fix it from now on. :D


Thu Jan 27, 2011 3:33 am
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Tiberium Extended help required
Actually i over estimated my own skills, i cant figure out whats wrong with it now. Something along the lines of self is nill or null in console, the one that doesn't exist. :???:


Mon Jan 31, 2011 3:51 am
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post Re: Tiberium Extended help required
PM me your mod and I'll fix it for ya.


Mon Jan 31, 2011 2:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.079s | 17 Queries | GZIP : Off ]