func_destuctable drops debris from map origin

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

func_destuctable drops debris from map origin

Postby tundramagi » Tue Apr 28, 2009 1:00 pm

func_destuctable drops debris from map origin rather than entity/brush center if no origin brush is there. Can this be changed to dropping from entity/brush center if no origin brush please?
tundramagi
Forum addon
 
Posts: 974
Joined: Sun Jan 04, 2009 4:53 pm

Postby divVerent » Tue Apr 28, 2009 1:12 pm

No, as the game code does not know if the origin is intentionally set to the map origin by an origin brush, or whether it is just missing.

Just place origin brushes.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby tundramagi » Tue Apr 28, 2009 1:29 pm

Can this be changed to launch from entity center if no origin is found other than the map origin?


Code: Select all
void LaunchDebris (string debrisname) =
{
   local   entity dbr;

   dbr = spawn();
   dbr.origin = self.origin + self.absmin
              + '1 0 0' * random() * (self.absmax_x - self.absmin_x)
              + '0 1 0' * random() * (self.absmax_y - self.absmin_y)
              + '0 0 1' * random() * (self.absmax_z - self.absmin_z);
   setmodel (dbr, debrisname );
   dbr.movetype = MOVETYPE_BOUNCE;
   dbr.solid = SOLID_NOT;
   // TODO parametrize this
   dbr.velocity_x = 70 * crandom();
   dbr.velocity_y = 70 * crandom();
   dbr.velocity_z = 140 + 70 * random();
   dbr.avelocity_x = random()*600;
   dbr.avelocity_y = random()*600;
   dbr.avelocity_z = random()*600;
   SUB_SetFade(dbr, time + 1 + random() * 5, 1);
};
tundramagi
Forum addon
 
Posts: 974
Joined: Sun Jan 04, 2009 4:53 pm

Postby divVerent » Tue Apr 28, 2009 2:01 pm

The map origin might be the intentionally set correct one. So, no.

If you insist, make it a spawnflag, like DEBRIS_FROM_CENTER.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby tundramagi » Tue Apr 28, 2009 6:09 pm

divVerent wrote:The map origin might be the intentionally set correct one. So, no.

If you insist, make it a spawnflag, like DEBRIS_FROM_CENTER.


I've been trying to do it, I can't make it not drop from map origin no matter what, there is no way to pass it the center of the brush as the origin. Could you do this? I suck at coding and have failed yet again.

Third time in a week.
tundramagi
Forum addon
 
Posts: 974
Joined: Sun Jan 04, 2009 4:53 pm


Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron