Making a working Tornado

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.

Making a working Tornado

Postby AtomicLugia » Sat Jan 14, 2017 9:48 am

Hello there. I'm a big fan of storm chasing and I wanted to create a tornado.

Sucking every player and monster in does already work but how do I launch them upwards ala Arch-Vile if they're close enough?

I have added the tornado as the attachment. Load this wad and a map with lots of free space and type "summon tornado".
You do not have the required permissions to view the files attached to this post.
User avatar
AtomicLugia
A cyan Yoshi with a M249
 
Joined: 06 Oct 2016
Location: Germany

Re: Making a working Tornado

Postby Greyfalll » Sat Jan 14, 2017 11:02 am

https://dl.dropbox.com/s/q19j7da4qmvrzr ... o.wad?dl=0
Here's a working version of it that uses A_RadiusThrust with RTF_THRUSTZ added and A_Explode to damage things that are in the tornado. Have fun :P
(I don't know if this will work on zandronum though, not sure if they have RTF_THRUSTZ for A_RadiusThrust)

EDIT: link has an updated wad that works in zandronum 3.0
Last edited by Greyfalll on Sat Jan 14, 2017 12:51 pm, edited 1 time in total.
User avatar
Greyfalll
It's almost harvesting season.
 
Joined: 31 Aug 2014
Location: Pokke Village

Re: Making a working Tornado

Postby Major Cooke » Sat Jan 14, 2017 11:40 am

Could use something like this. Granted I didn't make it affect items and this code is rather outdated but it will still give you a good hint on how to thrust others up.

Oh and it's in zscript.

Change the X048 sprites to ZOMB to see it. Summon TwilightTornadoGrounder to get it going.

Code: Select allExpand view
Class TwilightTornadoGrounder : Actor
{
   int user_time;
   Default
   {
      Projectile;
      +STEPMISSILE
      +THRUACTORS
      +SEEKERMISSILE
      +BOUNCEONWALLS
      +BOUNCEONFLOORS
      +BOUNCEONCEILINGS
      +SKYEXPLODE
      +NOEXPLODEFLOOR
      +NODAMAGE
      
      MaxStepHeight 64;
      Height 2;
      Radius 2;
      Speed 5;
   }
   States
   {
   Spawn:
      TNT1 A 0 NoDelay A_Warp(AAPTR_TRACER,0,0,8,0,WARPF_NOCHECKPOSITION|WARPF_TOFLOOR);
   Effects:
      TNT1 A 0
      {
         for (int a = 0; a < 360; a += 20)
         {
            A_SpawnItemEx("TwilightTornadoSpinnerFX",10,0,0,0,0,0,a,SXF_NOCHECKPOSITION|SXF_SETMASTER|SXF_ORIGINATOR);
         }
      }
   Spawning:
      TNT1 A 0
      {
         int a = 0;
         for (a = 16; a < 16*8; a += 16)
         {
            A_SpawnItemEx("TwilightTornadoColumn",0,0,a,0,0,0,0,SXF_NOCHECKPOSITION|SXF_SETMASTER|SXF_ORIGINATOR|SXF_TRANSFERPOINTERS,0,a);
         }
         A_SpawnItemEx("TwilightTornadoSucker",0,0,16*8,0,0,0,0,SXF_NOCHECKPOSITION|SXF_SETMASTER|SXF_ORIGINATOR|SXF_TRANSFERPOINTERS);
      }
   Moving:
      TNT1 A 2
      {
         A_FaceTracer(8);
         A_ChangeVelocity(5,0,0,CVF_RELATIVE|CVF_REPLACE);
         user_time += 2;
      }
      TNT1 A 0 A_JumpIf(user_time <= 35*8,"Moving");
   Death:
      TNT1 A 135
      {
         A_KillChildren("Normal",KILS_KILLMISSILES,"TwilightTornadoSpinnerFX");
         A_RemoveChildren(1,RMVF_EVERYTHING,"TwilightTornadoSucker");
      }
      Stop;
   }
}

Class TwilightTornadoSucker : Actor
{
   int user_t;
   Default
   {
      Projectile;
      +INVULNERABLE
      +NOINTERACTION
      RenderStyle "None";
   }
   States
   {
   Spawn:
      TNT1 A 1 NoDelay
      {
         if (!master || user_t >= 350) { Destroy(); return; }
         A_Warp(AAPTR_MASTER,-64,0,128,0,WARPF_NOCHECKPOSITION);
         A_RadiusGive("TwilightTornadoThrower",64,RGF_PLAYERS|RGF_MONSTERS|RGF_NOTARGET);
         A_RadiusGive("TwilightTornadoTurner3",128,RGF_PLAYERS|RGF_MONSTERS|RGF_NOTARGET);
         A_RadiusGive("TwilightTornadoTurner2",192,RGF_PLAYERS|RGF_MONSTERS|RGF_NOTARGET);
         A_RadiusGive("TwilightTornadoTurner1",256,RGF_PLAYERS|RGF_MONSTERS|RGF_NOTARGET);
         user_t++;
         return;
      }
      Wait;
   }
}
      



Class TwilightTornadoColumn : Actor
{
   int user_a;
   int user_time;
   int user_t;
   Default
   {
      Projectile;
      +STEPMISSILE
      +THRUACTORS
      +SEEKERMISSILE
      +BOUNCEONWALLS
      +BOUNCEONFLOORS
      +BOUNCEONCEILINGS
      +SKYEXPLODE
      +NOEXPLODEFLOOR
      +NODAMAGE
      +NODAMAGETHRUST
      +EXTREMEDEATH
      Obituary "%o shreds metal like Twilight Sparkle's tornado shreds %g.";
      MaxStepHeight 64;
      Height 2;
      Radius 2;
      Speed 5;
   }
   States
   {
   Spawn:
      TNT1 A 1 NoDelay
      {
         user_t = tid;
         Thing_ChangeTID(0,0);
         A_SetTics(user_t/4);
      }
   Effects:
      TNT1 A 0
      {
         for (int user_a = 0; user_a < 360; user_a += 20)
         {
            A_SpawnItemEx("TwilightTornadoSpinnerFX",10,0,0,0,0,0,user_a,SXF_NOCHECKPOSITION|SXF_SETMASTER|SXF_ORIGINATOR,0,user_t);
         }
      }
   Moving:
      TNT1 A 1
      {
         A_FaceMaster(4);
         A_ChangeVelocity(5,0,0,CVF_RELATIVE|CVF_REPLACE);
         A_RadiusThrust(-200,256,0,192);
         A_RadiusThrust(-400,128,0,64);
         A_Explode(1,128,0,0,128);
         user_time++;
         if (user_time > 35*8) { return ResolveState("Death"); }
         return ResolveState(null);
      }
      Wait;
   Death:
      TNT1 A 135 A_KillChildren("Normal",KILS_KILLMISSILES,"TwilightTornadoSpinnerFX");
      Stop;
   }
}

Class TwilightTornadoTurner1 : CustomInventory
{
   States
   {
   Pickup:
      TNT1 A 0
      {
         if (bDONTTHRUST || mass > 10000)
         {   return false;   }
         A_SetAngle(angle+frandom(-1.0,1.0));
         A_SetPitch(pitch+frandom(-0.5,0.5));
         return true;
      }
      Stop;
   }
}

Class TwilightTornadoTurner2 : CustomInventory
{
   States
   {
   Pickup:
      TNT1 A 0
      {
         if (bDONTTHRUST || mass < 1 ||  mass > 10000)
         {   return false;   }
         
         A_SetAngle(angle+(frandom(6.0,12.0)) / (mass*0.01));
         A_ChangeVelocity(0,0,(frandom(0.1,1.0)) / (mass*0.01));
         return true;
      }
      Stop;
   }
}

Class TwilightTornadoTurner3 : CustomInventory
{
   States
   {
   Pickup:
      TNT1 A 0
      {
         if (bDONTTHRUST || mass < 1 || mass > 10000)
         {   return false;   }
         
         A_SetAngle(angle+frandom(30.0,45.0) / (mass*0.01));
         A_ChangeVelocity(0,0,frandom(0.5,3.0) / (mass*0.01));
         return true;
      }
      Stop;
   }
}

Class TwilightTornadoThrower : CustomInventory
{
   States
   {
   Pickup:
      TNT1 A 0
      {
         if (CheckClass("TwilightSparkle") ||
            CheckClass("TwilightSparkleGiant") ||
            CheckClass("TwilightSparklePlayer") ||
            CheckClass("TwilightSparkleGiantPlayer") ||
            bNOINTERACTION ||
            bNONSHOOTABLE ||
            bTHRUACTORS ||
            bDONTTHRUST ||
            bNOCLIP)
         {   return false;   }
         
         if (mass <= 0)   {   A_ChangeVelocity(0,0,frandom(3.0,6.0));   }
         else         {   A_ChangeVelocity(0,0,frandom(3.0,6.0)/(mass*0.01));   }
         return true;
      }
      Stop;
   }
}

Class TwilightTornadoSpinnerFX : Actor
{
   int user_t;
   int user_angle;
   int user_distance;
   int user_add;
   Default
   {
      Projectile;
      +NOINTERACTION
      RenderStyle "Add";
      Scale 0.15;
      Alpha 0.11;
   }
   States
   {
   Spawn:
      TNT1 A 0 NoDelay
      {
         user_t = tid;
         Thing_ChangeTID(0,0);
         A_SetScale(Scale.X+(user_t/400.0),0.35);
         user_angle = angle;
         user_add = 12; //Angle changes per rotation
         user_distance = 40; //How far away from the center
         A_SetScale(Scale.X*randompick(-1,1),Scale.Y*randompick(-1,1));
      }
   Moving:
      X048 A 1 Bright
      {
         A_SetAngle(angle+user_add);
         A_Warp(MasterPtr,(user_distance+(user_t*0.5)),0,0,0,WARPF_NOCHECKPOSITION|WARPF_USECALLERANGLE,1);
         if (alpha < 1.0)   {   A_FadeIn(0.05,FTF_CLAMP);   }
         if (IsPointerEqual(MasterPtr,NullPtr)) { return ResolveState("Death"); }
         return ResolveState(null);
      }
      Loop;
   Death:
      X048 A 1 Bright
      {
         A_SetAngle(angle+user_add);
         A_Warp(AAPTR_MASTER,(user_distance+(user_t*0.5)),0,0,0,WARPF_NOCHECKPOSITION|WARPF_USECALLERANGLE);
         A_FadeOut(0.05,FTF_CLAMP|FTF_REMOVE);
      }
      Loop;
   }
}
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Making a working Tornado

Postby AtomicLugia » Sat Jan 14, 2017 12:01 pm

I'm using Zandronum 3.0 Alpha and it's based on ZDoom 2.8-pre I think. It doesn't work, unfortunately. Is there some kind of workaround? Like ThrustThingZ on every actor that's too close on the tornado?
User avatar
AtomicLugia
A cyan Yoshi with a M249
 
Joined: 06 Oct 2016
Location: Germany

Re: Making a working Tornado

Postby kodi » Sat Jan 14, 2017 12:02 pm

A_Blast can thrust things upwards in a radius!
User avatar
kodi
Proscrastinator
 
 
 
Joined: 06 May 2013

Re: Making a working Tornado

Postby Greyfalll » Sat Jan 14, 2017 12:29 pm

kodi wrote:A_Blast can thrust things upwards in a radius!

Problem with using A_Blast is that the radius of it ignores the z axis, it's height is basically infinite so you'll just keep being shot upwards.

Currently trying to find out a workaround though, I'll post again when I find one.

EDIT: https://dl.dropbox.com/s/q19j7da4qmvrzr ... o.wad?dl=0 this works pretty well in zandronum 3.0, you might need to edit the radius values of everything to get it how you like.
User avatar
Greyfalll
It's almost harvesting season.
 
Joined: 31 Aug 2014
Location: Pokke Village

Re: Making a working Tornado

Postby AtomicLugia » Tue Jan 17, 2017 1:21 pm

Greyfalll wrote:
kodi wrote:A_Blast can thrust things upwards in a radius!

Problem with using A_Blast is that the radius of it ignores the z axis, it's height is basically infinite so you'll just keep being shot upwards.

Currently trying to find out a workaround though, I'll post again when I find one.

EDIT: https://dl.dropbox.com/s/q19j7da4qmvrzr ... o.wad?dl=0 this works pretty well in zandronum 3.0, you might need to edit the radius values of everything to get it how you like.


Thanks, the A_RadiusGive method helped me alot. Now I can make working tornadoes! Very thanks! :mrgreen:
User avatar
AtomicLugia
A cyan Yoshi with a M249
 
Joined: 06 Oct 2016
Location: Germany


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 3 guests