[Done] ThrustThing improvement

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [Done] ThrustThing improvement

by Graf Zahl » Fri Jan 28, 2005 5:14 am

In the Doom64 TC it's the yellow key in the southern part of MAP25. If you approach it it jumps up the ledge.

by Cutmanmike » Fri Jan 28, 2005 4:41 am

I can't say i've seen that. Doom64 had some of the most annoying, confusing maps in the history of doom. But at least it had a new last boss.

by Graf Zahl » Thu Jan 27, 2005 3:14 pm

Yes, a key that jumps away when the player approaches it. It's a really cool effect.

by Cutmanmike » Thu Jan 27, 2005 1:42 pm

jumping key?

by Graf Zahl » Thu Jan 27, 2005 9:32 am

... and now it would be possible to do the jumping key trick in one of the Doom64 maps!

by Cutmanmike » Thu Jan 27, 2005 8:31 am

Yes, now this could add some fun to my next platform map :twisted:

by Graf Zahl » Wed Jan 26, 2005 8:14 pm

randy wrote:
Graf Zahl wrote:So what about ThrustThingZ that violates this convention?
That wasn't me! Carnevil did it, so blame him! O-)

I'd rather blame Raven for not doing it right in the first place! :P

by randi » Wed Jan 26, 2005 7:46 pm

Graf Zahl wrote:So what about ThrustThingZ that violates this convention?
That wasn't me! Carnevil did it, so blame him! O-)

To keep it congruent with ThrustThingZ, I'll add the TID parameter to the end of ThrustThing.

by HotWax » Mon Jan 17, 2005 7:28 pm

I'm pretty sure it's short for momentum y. :roll:

by MasterOFDeath » Sun Jan 16, 2005 7:09 pm

Code: Select all

it->momy += arg2 * finesine[angle];
Heh, mommy.(Sorry, just had too. :P)

by Graf Zahl » Sun Jan 16, 2005 3:43 am

Is this better?

Code: Select all

FUNC(LS_Thing_Thrust)
// Thing_Thrust (tid, angle, force)
{
   if (arg0!=0)
   {
      AActor * victim;

      angle_t angle = BYTEANGLE(arg1) >> ANGLETOFINESHIFT;

      FActorIterator iterator (arg0);

      while ( (victim = iterator.Next ()) )
      {
         victim->momx += arg2 * finecosine[angle];
         victim->momy += arg2 * finesine[angle];
      }
      return true;
   }
   else if (it)
   {
      angle_t angle = BYTEANGLE(arg1) >> ANGLETOFINESHIFT;

      it->momx += arg2 * finecosine[angle];
      it->momy += arg2 * finesine[angle];
      return true;
   }
   return false;
} 
At least it has the advantage of not having to support that nolimit compatibility parameter! ;)

by Graf Zahl » Sun Jan 16, 2005 3:37 am

So what about ThrustThingZ that violates this convention?

Re: ThrustThing improvement

by randi » Sat Jan 15, 2005 9:31 pm

Graf Zahl wrote:Yes, the parameter ordering is less than optimal but this really doesn't necessitate a new line special, does it? ;)
I think it should, just to keep in line with the naming convention. Specials that start with Thing_ take a TID as a parameter. Specials that end with Thing instead are applied to the activator.

by Cutmanmike » Sat Jan 15, 2005 8:49 am

*hug*

ThrustThing improvement

by Graf Zahl » Sat Jan 15, 2005 8:30 am

http://forum.zdoom.org/viewtopic.php?t=4885


Anti-credits for Randy? No, that must not be so here's a remedy:

Code: Select all

FUNC(LS_ThrustThing)
// ThrustThing (angle, force, nolimit, tid)
{
	if (arg3!=0)
	{
		AActor * victim;

		angle_t angle = BYTEANGLE(arg0) >> ANGLETOFINESHIFT;

		FActorIterator iterator (arg3);

		while ( (victim = iterator.Next ()) )
		{
			victim->momx += arg1 * finecosine[angle];
			victim->momy += arg1 * finesine[angle];
			if (!arg2)
			{
				victim->momx = clamp<fixed_t> (victim->momx, -MAXMOVE, MAXMOVE);
				victim->momy = clamp<fixed_t> (victim->momy, -MAXMOVE, MAXMOVE);
			}
		}
		return true;
	}
	else if (it)
	{
		angle_t angle = BYTEANGLE(arg0) >> ANGLETOFINESHIFT;

		it->momx += arg1 * finecosine[angle];
		it->momy += arg1 * finesine[angle];
		if (!arg2)
		{
			it->momx = clamp<fixed_t> (it->momx, -MAXMOVE, MAXMOVE);
			it->momy = clamp<fixed_t> (it->momy, -MAXMOVE, MAXMOVE);
		}
		return true;
	}
	return false;
}
Yes, the parameter ordering is less than optimal but this really doesn't necessitate a new line special, does it? ;)

Top