View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:54 am



Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
 Trying to make bombs rain from the sky 
Author Message
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: Trying to make bombs rain from the sky
Yeah I just noticed it doesnt work too. Seeing in other missions where bombs do rain, they also had names so I dont think you can get them to disapear.

What you could do is just give the bomb a really high or really low offset making the name not visible. I havent tested that though so unsatisfactory things might happen.


Fri Dec 24, 2010 8:04 pm
Profile
User avatar

Joined: Tue Dec 21, 2010 4:46 pm
Posts: 13
Reply with quote
Post Re: Trying to make bombs rain from the sky
Quote:
math.random(10000)

Are you sure that you have enough width of the map?

I would first placed a bomb on a map, and only then activate it.

Code:
function Create(self)
   self.bombVar = 1
   self.bombTime = Timer();
   self.bombingTime = Timer();
end
function Update(self)
   if self.bombVar == 1 then
      if self.bombingTime:IsPastSimMS(500) then -- set to lower number for more bombs
         self.bomb = CreateTDExplosive("Standard Bomb", "Coalition.rte");
         MovableMan:AddItem(self.bomb);
       self.bomb:IsActivated();
         self.bomb.Pos = Vector(math.random(200),-20);
         self.bombingTime:Reset();
      end
   end
   if self.bombTime:IsPastSimMS(10000) then -- set to higher number for longer bombing time
      self.bombVar = 0
      self.ToDelete = true
   end
end


Now it works.
But I do not know what function can give map width.
The program needs some work.


Fri Dec 24, 2010 8:18 pm
Profile ICQ
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: Trying to make bombs rain from the sky
First of all, Vectors work as

(X,Y)

and your giving it the scene's width as the Y value. Also as for our Inconvenience, SceneMan.SceneWidth or SceneHeight dont seem to wanna work, same thing with Scene.Width/Height.

Your better off with what Geti gave you.


Fri Dec 24, 2010 11:56 pm
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Trying to make bombs rain from the sky
Stop using self variables when there's no need to keep them stored over updates.


Fri Dec 24, 2010 11:59 pm
Profile
User avatar

Joined: Sun Feb 21, 2010 10:40 pm
Posts: 97
Reply with quote
Post Re: Trying to make bombs rain from the sky
Coops9753 wrote:
First of all, Vectors work as

(X,Y)

and your giving it the scene's width as the Y value. Also as for our Inconvenience, SceneMan.SceneWidth or SceneHeight dont seem to wanna work, same thing with Scene.Width/Height.

Your better off with what Geti gave you.


Actually, Nonsequitorian's way worked. I'm using it instead of the 10000 now.

I still don't know how to get rid of the names... Should I just make the preset name a bunch of spaces?

EDIT: Actually, then the arrows would still show up...


Sat Dec 25, 2010 12:09 am
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Trying to make bombs rain from the sky
Make them MOSRotatings or even TDExplosives that you activate when spawning them?


Sat Dec 25, 2010 12:15 am
Profile
User avatar

Joined: Sun Feb 21, 2010 10:40 pm
Posts: 97
Reply with quote
Post Re: Trying to make bombs rain from the sky
I've tried that already, it doesn't work.

I uploaded the weapon, if anyone can get the names to disappear that would be great.


Attachments:
OrbitalStrike.rte.rar [247.4 KiB]
Downloaded 161 times
Sat Dec 25, 2010 12:20 am
Profile
User avatar

Joined: Mon Apr 05, 2010 8:04 am
Posts: 149
Location: Under your bed
Reply with quote
Post Re: Trying to make bombs rain from the sky
Also, instead of it being a TDExplosive, you could make it a MOSRotating, and make it gib into all of your bomb stuff


Mon Dec 27, 2010 9:55 pm
Profile YIM
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Trying to make bombs rain from the sky
self:Activate();
will activate the TDExplosive and therefore make the name disappear.


Wed Jan 12, 2011 12:09 am
Profile
User avatar

Joined: Sun Feb 21, 2010 10:40 pm
Posts: 97
Reply with quote
Post Re: Trying to make bombs rain from the sky
Thanks, that worked.


Thu Jan 13, 2011 4:28 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page Previous  1, 2

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.039s | 17 Queries | GZIP : Off ]