Needing a scripter. (Little script change?)

Discussions about Coding and Scripting
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Needing a scripter. (Little script change?)

Post by Isotoxin »

I do not know anything about scripting so, I don't even know if it's possible, but if someone could make it work for me... thats would be greatly appreciated. Also credits will be given, so well whats needed to be done : I got a togglewaterzone script, but the problem is, I wan't a toggleSlime zone instead. Here is the script of the togglewaterzone :

Code: Select all

//=============================================================================
// TriggerWaterZone.
// This class allows you to change a zone from a Regular Zone to a Water Zone
// using the normal trigger method.
// Created by Scott 'Slasher IV' Kircher
//=============================================================================
class TriggerWaterZone expands WaterZone;

function PostBeginPlay()
{
	Super.PostBeginPlay();

	if(!bWaterZone)
	{
		ViewFlash=vect(0,0,0);
		ViewFog=vect(0,0,0);
	}
}
	

function Trigger( actor Other, pawn EventInstigator )
{
	local Actor A;
	local Pawn P;
	local Decoration D;
	local TriggerWaterZone oldself;
	oldself=self;

	if(bWaterZone)
	{
		bWaterZone=false;
		ViewFlash=vect(0,0,0);
		ViewFog=vect(0,0,0);
		ForEach AllActors(class 'Actor', A)
			if(A.Region.Zone==oldself)
			{
				ActorEntered(A);
				A.ZoneChange(self);
				if(A.Buoyancy>0.0)
				{
					A.SetPhysics(PHYS_Falling);
				}
			}
		ForEach AllActors(class 'Pawn', P)
		{
			if(P.HeadRegion.Zone==oldself)
			{
				P.HeadZoneChange(self);
				P.PainTime=-1.0;
			}
			if(P.FootRegion.Zone==oldself)
			{
				P.FootZoneChange(self);
			}
		}
	}
	else
	{	
		bWaterZone=true;
		ViewFlash=Default.ViewFlash;
		ViewFog=Default.ViewFog;
		ForEach AllActors(class 'Actor', A)
			if(A.Region.Zone==oldself)
			{
				ActorEntered(A);
				A.ZoneChange(self);
				if(A.Buoyancy>0.0)
				{
					A.Velocity.Z+=1;
					A.SetPhysics(PHYS_Falling);
				}
			}
		ForEach AllActors(class 'Decoration', D)
			if(D.Region.Zone==oldself)
			{
				D.bBobbing=False;
				D.Bump(self);
			}
		ForEach AllActors(class 'Pawn', P)
		{
			if(P.HeadRegion.Zone==oldself)
			{
				P.HeadZoneChange(self);
				P.PainTime=P.UnderWaterTime;
				P.SetPhysics(PHYS_Swimming);
			}
			if(P.FootRegion.Zone==oldself)
			{
				P.FootZoneChange(self);
			}			
		}
	}		
}
Thanks in advance!

Iso

EDIT------------------------------------ by papercoffee

Posted ths in the wrong section, feel free to move it.

And you made a double post... :wink: Bad Iso ...now you lost your right to post here for the next 100 seconds.
starting....... now!
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Needing a scripter. (Little script change?)

Post by Feralidragon »

Here you go (create a new SlimeZone subclass called TriggerSlimeZone):

Code: Select all

//=============================================================================
// TriggerSlimeZone.
// This class allows you to change a zone from a Regular Zone to a Slime Zone
// using the normal trigger method.
// Created by Scott 'Slasher IV' Kircher
//=============================================================================
class TriggerSlimeZone expands SlimeZone;

var int dmgPerSec;

function PostBeginPlay()
{
   Super.PostBeginPlay();

   if(!bWaterZone)
   {
	  ViewFlash=vect(0,0,0);
	  ViewFog=vect(0,0,0);
	  bPainZone=False;
      bDestructive=False;
	  dmgPerSec = DamagePerSec;
   }
}
   

function Trigger( actor Other, pawn EventInstigator )
{
   local Actor A;
   local Pawn P;
   local Decoration D;
   local TriggerWaterZone oldself;
   oldself=self;

   if(bWaterZone)
   {
	  bWaterZone=false;
	  ViewFlash=vect(0,0,0);
	  ViewFog=vect(0,0,0);
	  bPainZone=False;
      bDestructive=False;
	  DamagePerSec=0;
	  ForEach AllActors(class 'Actor', A)
		 if(A.Region.Zone==oldself)
		 {
			ActorEntered(A);
			A.ZoneChange(self);
			if(A.Buoyancy>0.0)
			{
			   A.SetPhysics(PHYS_Falling);
			}
		 }
	  ForEach AllActors(class 'Pawn', P)
	  {
		 if(P.HeadRegion.Zone==oldself)
		 {
			P.HeadZoneChange(self);
			P.PainTime=-1.0;
		 }
		 if(P.FootRegion.Zone==oldself)
		 {
			P.FootZoneChange(self);
		 }
	  }
   }
   else
   {   
	  bWaterZone=true;
	  ViewFlash=Default.ViewFlash;
	  ViewFog=Default.ViewFog;
	  bPainZone=True;
      bDestructive=True;
	  DamagePerSec=dmgPerSec;
	  ForEach AllActors(class 'Actor', A)
		 if(A.Region.Zone==oldself)
		 {
			ActorEntered(A);
			A.ZoneChange(self);
			if(A.Buoyancy>0.0)
			{
			   A.Velocity.Z+=1;
			   A.SetPhysics(PHYS_Falling);
			}
		 }
	  ForEach AllActors(class 'Decoration', D)
		 if(D.Region.Zone==oldself)
		 {
			D.bBobbing=False;
			D.Bump(self);
		 }
	  ForEach AllActors(class 'Pawn', P)
	  {
		 if(P.HeadRegion.Zone==oldself)
		 {
			P.HeadZoneChange(self);
			P.PainTime=P.UnderWaterTime;
			P.SetPhysics(PHYS_Swimming);
		 }
		 if(P.FootRegion.Zone==oldself)
		 {
			P.FootZoneChange(self);
		 }         
	  }
   }      
}
You don't need to give me credits for this one btw, I just modified and added a few bits in the original code, nothing worth to be really credited for. :thuup:
I didn't test it btw, so if there's any problem, feel free to report back so I can fix it.
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Needing a scripter. (Little script change?)

Post by Isotoxin »

Feralidragon wrote:Here you go (create a new SlimeZone subclass called TriggerSlimeZone):

Code: Select all

//=============================================================================
// TriggerSlimeZone.
// This class allows you to change a zone from a Regular Zone to a Slime Zone
// using the normal trigger method.
// Created by Scott 'Slasher IV' Kircher
//=============================================================================
class TriggerSlimeZone expands SlimeZone;

var int dmgPerSec;

function PostBeginPlay()
{
   Super.PostBeginPlay();

   if(!bWaterZone)
   {
	  ViewFlash=vect(0,0,0);
	  ViewFog=vect(0,0,0);
	  bPainZone=False;
      bDestructive=False;
	  dmgPerSec = DamagePerSec;
   }
}
   

function Trigger( actor Other, pawn EventInstigator )
{
   local Actor A;
   local Pawn P;
   local Decoration D;
   local TriggerWaterZone oldself;
   oldself=self;

   if(bWaterZone)
   {
	  bWaterZone=false;
	  ViewFlash=vect(0,0,0);
	  ViewFog=vect(0,0,0);
	  bPainZone=False;
      bDestructive=False;
	  DamagePerSec=0;
	  ForEach AllActors(class 'Actor', A)
		 if(A.Region.Zone==oldself)
		 {
			ActorEntered(A);
			A.ZoneChange(self);
			if(A.Buoyancy>0.0)
			{
			   A.SetPhysics(PHYS_Falling);
			}
		 }
	  ForEach AllActors(class 'Pawn', P)
	  {
		 if(P.HeadRegion.Zone==oldself)
		 {
			P.HeadZoneChange(self);
			P.PainTime=-1.0;
		 }
		 if(P.FootRegion.Zone==oldself)
		 {
			P.FootZoneChange(self);
		 }
	  }
   }
   else
   {   
	  bWaterZone=true;
	  ViewFlash=Default.ViewFlash;
	  ViewFog=Default.ViewFog;
	  bPainZone=True;
      bDestructive=True;
	  DamagePerSec=dmgPerSec;
	  ForEach AllActors(class 'Actor', A)
		 if(A.Region.Zone==oldself)
		 {
			ActorEntered(A);
			A.ZoneChange(self);
			if(A.Buoyancy>0.0)
			{
			   A.Velocity.Z+=1;
			   A.SetPhysics(PHYS_Falling);
			}
		 }
	  ForEach AllActors(class 'Decoration', D)
		 if(D.Region.Zone==oldself)
		 {
			D.bBobbing=False;
			D.Bump(self);
		 }
	  ForEach AllActors(class 'Pawn', P)
	  {
		 if(P.HeadRegion.Zone==oldself)
		 {
			P.HeadZoneChange(self);
			P.PainTime=P.UnderWaterTime;
			P.SetPhysics(PHYS_Swimming);
		 }
		 if(P.FootRegion.Zone==oldself)
		 {
			P.FootZoneChange(self);
		 }         
	  }
   }      
}
You don't need to give me credits for this one btw, I just modified and added a few bits in the original code, nothing worth to be really credited for. :thuup:
I didn't test it btw, so if there's any problem, feel free to report back so I can fix it.

Thanks you so much man <3
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Same problem still appearing!

Post by Isotoxin »

So, I recently requested someone to change the triggeredwaterzone to a triggered slimezone. But this still didn't solve my problem.. The thing is, I need a slimezone which I can turn off and on. But even when the slime is not triggered, you still lose hp in the zone, is there a way to slove this problem? Thanks in advance, both of the scripts can be found below.

Code: Select all

    //=============================================================================
    // TriggerWaterZone.
    // This class allows you to change a zone from a Regular Zone to a Water Zone
    // using the normal trigger method.
    // Created by Scott 'Slasher IV' Kircher
    //=============================================================================
    class TriggerWaterZone expands WaterZone;

    function PostBeginPlay()
    {
       Super.PostBeginPlay();

       if(!bWaterZone)
       {
          ViewFlash=vect(0,0,0);
          ViewFog=vect(0,0,0);
       }
    }
       

    function Trigger( actor Other, pawn EventInstigator )
    {
       local Actor A;
       local Pawn P;
       local Decoration D;
       local TriggerWaterZone oldself;
       oldself=self;

       if(bWaterZone)
       {
          bWaterZone=false;
          ViewFlash=vect(0,0,0);
          ViewFog=vect(0,0,0);
          ForEach AllActors(class 'Actor', A)
             if(A.Region.Zone==oldself)
             {
                ActorEntered(A);
                A.ZoneChange(self);
                if(A.Buoyancy>0.0)
                {
                   A.SetPhysics(PHYS_Falling);
                }
             }
          ForEach AllActors(class 'Pawn', P)
          {
             if(P.HeadRegion.Zone==oldself)
             {
                P.HeadZoneChange(self);
                P.PainTime=-1.0;
             }
             if(P.FootRegion.Zone==oldself)
             {
                P.FootZoneChange(self);
             }
          }
       }
       else
       {   
          bWaterZone=true;
          ViewFlash=Default.ViewFlash;
          ViewFog=Default.ViewFog;
          ForEach AllActors(class 'Actor', A)
             if(A.Region.Zone==oldself)
             {
                ActorEntered(A);
                A.ZoneChange(self);
                if(A.Buoyancy>0.0)
                {
                   A.Velocity.Z+=1;
                   A.SetPhysics(PHYS_Falling);
                }
             }
          ForEach AllActors(class 'Decoration', D)
             if(D.Region.Zone==oldself)
             {
                D.bBobbing=False;
                D.Bump(self);
             }
          ForEach AllActors(class 'Pawn', P)
          {
             if(P.HeadRegion.Zone==oldself)
             {
                P.HeadZoneChange(self);
                P.PainTime=P.UnderWaterTime;
                P.SetPhysics(PHYS_Swimming);
             }
             if(P.FootRegion.Zone==oldself)
             {
                P.FootZoneChange(self);
             }         
          }
       }      
    }

Code: Select all

    //=============================================================================
    // TriggerSlimeZone.
    // This class allows you to change a zone from a Regular Zone to a Slime Zone
    // using the normal trigger method.
    // Created by Scott 'Slasher IV' Kircher
    //=============================================================================
    class TriggerSlimeZone expands SlimeZone;

    var int dmgPerSec;

    function PostBeginPlay()
    {
       Super.PostBeginPlay();

       if(!bWaterZone)
       {
         ViewFlash=vect(0,0,0);
         ViewFog=vect(0,0,0);
         bPainZone=False;
          bDestructive=False;
         dmgPerSec = DamagePerSec;
       }
    }
       

    function Trigger( actor Other, pawn EventInstigator )
    {
       local Actor A;
       local Pawn P;
       local Decoration D;
       local TriggerWaterZone oldself;
       oldself=self;

       if(bWaterZone)
       {
         bWaterZone=false;
         ViewFlash=vect(0,0,0);
         ViewFog=vect(0,0,0);
         bPainZone=False;
          bDestructive=False;
         DamagePerSec=0;
         ForEach AllActors(class 'Actor', A)
           if(A.Region.Zone==oldself)
           {
             ActorEntered(A);
             A.ZoneChange(self);
             if(A.Buoyancy>0.0)
             {
                A.SetPhysics(PHYS_Falling);
             }
           }
         ForEach AllActors(class 'Pawn', P)
         {
           if(P.HeadRegion.Zone==oldself)
           {
             P.HeadZoneChange(self);
             P.PainTime=-1.0;
           }
           if(P.FootRegion.Zone==oldself)
           {
             P.FootZoneChange(self);
           }
         }
       }
       else
       {   
         bWaterZone=true;
         ViewFlash=Default.ViewFlash;
         ViewFog=Default.ViewFog;
         bPainZone=True;
          bDestructive=True;
         DamagePerSec=dmgPerSec;
         ForEach AllActors(class 'Actor', A)
           if(A.Region.Zone==oldself)
           {
             ActorEntered(A);
             A.ZoneChange(self);
             if(A.Buoyancy>0.0)
             {
                A.Velocity.Z+=1;
                A.SetPhysics(PHYS_Falling);
             }
           }
         ForEach AllActors(class 'Decoration', D)
           if(D.Region.Zone==oldself)
           {
             D.bBobbing=False;
             D.Bump(self);
           }
         ForEach AllActors(class 'Pawn', P)
         {
           if(P.HeadRegion.Zone==oldself)
           {
             P.HeadZoneChange(self);
             P.PainTime=P.UnderWaterTime;
             P.SetPhysics(PHYS_Swimming);
           }
           if(P.FootRegion.Zone==oldself)
           {
             P.FootZoneChange(self);
           }         
         }
       }     
    }
A big thanks in advance!



*EDIT*

I know I can put triggers attached to the watersheet, but, I really need the slime to damage the player.
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Same problem still appearing!

Post by Rakiayn »

this trigger turns a normal zone in a slimezone, so if you have a normal zone, how can it hurt you if you have not triggered it yet?
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Same problem still appearing!

Post by Feralidragon »

Sorry, my mistake (forgot to initialize the zone damage to 0):

Code: Select all

        //=============================================================================
        // TriggerSlimeZone.
        // This class allows you to change a zone from a Regular Zone to a Slime Zone
        // using the normal trigger method.
        // Created by Scott 'Slasher IV' Kircher
        //=============================================================================
        class TriggerSlimeZone expands SlimeZone;

        var int dmgPerSec;

        function PostBeginPlay()
        {
           Super.PostBeginPlay();

           if(!bWaterZone)
           {
             ViewFlash=vect(0,0,0);
             ViewFog=vect(0,0,0);
             bPainZone=False;
              bDestructive=False;
             dmgPerSec = DamagePerSec;
             DamagePerSec = 0;
           }
        }
           

        function Trigger( actor Other, pawn EventInstigator )
        {
           local Actor A;
           local Pawn P;
           local Decoration D;
           local TriggerWaterZone oldself;
           oldself=self;

           if(bWaterZone)
           {
             bWaterZone=false;
             ViewFlash=vect(0,0,0);
             ViewFog=vect(0,0,0);
             bPainZone=False;
              bDestructive=False;
             DamagePerSec=0;
             ForEach AllActors(class 'Actor', A)
               if(A.Region.Zone==oldself)
               {
                 ActorEntered(A);
                 A.ZoneChange(self);
                 if(A.Buoyancy>0.0)
                 {
                    A.SetPhysics(PHYS_Falling);
                 }
               }
             ForEach AllActors(class 'Pawn', P)
             {
               if(P.HeadRegion.Zone==oldself)
               {
                 P.HeadZoneChange(self);
                 P.PainTime=-1.0;
               }
               if(P.FootRegion.Zone==oldself)
               {
                 P.FootZoneChange(self);
               }
             }
           }
           else
           {   
             bWaterZone=true;
             ViewFlash=Default.ViewFlash;
             ViewFog=Default.ViewFog;
             bPainZone=True;
              bDestructive=True;
             DamagePerSec=dmgPerSec;
             ForEach AllActors(class 'Actor', A)
               if(A.Region.Zone==oldself)
               {
                 ActorEntered(A);
                 A.ZoneChange(self);
                 if(A.Buoyancy>0.0)
                 {
                    A.Velocity.Z+=1;
                    A.SetPhysics(PHYS_Falling);
                 }
               }
             ForEach AllActors(class 'Decoration', D)
               if(D.Region.Zone==oldself)
               {
                 D.bBobbing=False;
                 D.Bump(self);
               }
             ForEach AllActors(class 'Pawn', P)
             {
               if(P.HeadRegion.Zone==oldself)
               {
                 P.HeadZoneChange(self);
                 P.PainTime=P.UnderWaterTime;
                 P.SetPhysics(PHYS_Swimming);
               }
               if(P.FootRegion.Zone==oldself)
               {
                 P.FootZoneChange(self);
               }         
             }
           }     
        }
You could have posted the issue in the original topic btw. I am going to merge the topics later.
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Same problem still appearing!

Post by Isotoxin »

Feralidragon wrote:Sorry, my mistake (forgot to initialize the zone damage to 0):

Code: Select all

        //=============================================================================
        // TriggerSlimeZone.
        // This class allows you to change a zone from a Regular Zone to a Slime Zone
        // using the normal trigger method.
        // Created by Scott 'Slasher IV' Kircher
        //=============================================================================
        class TriggerSlimeZone expands SlimeZone;

        var int dmgPerSec;

        function PostBeginPlay()
        {
           Super.PostBeginPlay();

           if(!bWaterZone)
           {
             ViewFlash=vect(0,0,0);
             ViewFog=vect(0,0,0);
             bPainZone=False;
              bDestructive=False;
             dmgPerSec = DamagePerSec;
             DamagePerSec = 0;
           }
        }
           

        function Trigger( actor Other, pawn EventInstigator )
        {
           local Actor A;
           local Pawn P;
           local Decoration D;
           local TriggerWaterZone oldself;
           oldself=self;

           if(bWaterZone)
           {
             bWaterZone=false;
             ViewFlash=vect(0,0,0);
             ViewFog=vect(0,0,0);
             bPainZone=False;
              bDestructive=False;
             DamagePerSec=0;
             ForEach AllActors(class 'Actor', A)
               if(A.Region.Zone==oldself)
               {
                 ActorEntered(A);
                 A.ZoneChange(self);
                 if(A.Buoyancy>0.0)
                 {
                    A.SetPhysics(PHYS_Falling);
                 }
               }
             ForEach AllActors(class 'Pawn', P)
             {
               if(P.HeadRegion.Zone==oldself)
               {
                 P.HeadZoneChange(self);
                 P.PainTime=-1.0;
               }
               if(P.FootRegion.Zone==oldself)
               {
                 P.FootZoneChange(self);
               }
             }
           }
           else
           {   
             bWaterZone=true;
             ViewFlash=Default.ViewFlash;
             ViewFog=Default.ViewFog;
             bPainZone=True;
              bDestructive=True;
             DamagePerSec=dmgPerSec;
             ForEach AllActors(class 'Actor', A)
               if(A.Region.Zone==oldself)
               {
                 ActorEntered(A);
                 A.ZoneChange(self);
                 if(A.Buoyancy>0.0)
                 {
                    A.Velocity.Z+=1;
                    A.SetPhysics(PHYS_Falling);
                 }
               }
             ForEach AllActors(class 'Decoration', D)
               if(D.Region.Zone==oldself)
               {
                 D.bBobbing=False;
                 D.Bump(self);
               }
             ForEach AllActors(class 'Pawn', P)
             {
               if(P.HeadRegion.Zone==oldself)
               {
                 P.HeadZoneChange(self);
                 P.PainTime=P.UnderWaterTime;
                 P.SetPhysics(PHYS_Swimming);
               }
               if(P.FootRegion.Zone==oldself)
               {
                 P.FootZoneChange(self);
               }         
             }
           }     
        }
You could have posted the issue in the original topic btw. I am going to merge the topics later.

One last thing, how to I get it in mylevel?
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Same problem still appearing!

Post by Rakiayn »

why not make a new package for it? i think its easyer.
I can do it for you if you like
User avatar
Creavion
Godlike
Posts: 4497
Joined: Sun Feb 17, 2008 7:23 pm
Personal rank: About to be non-act.
Location: Germany, Lower Saxony

Re: Same problem still appearing!

Post by Creavion »

obj load file=mypackagename.extension package=myLevel
About to be non-active
My very last UT map project: CTF-FacePalm (tropical CTF-Face remake)
Why do I leave? click here
What I want to do next: Joining an UDK team (uncertain however) and improve 3D modelling and texture editing skills
Thanks to those who visibly supported me until/at the end!
My reactivated account on indiedb.com.
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Same problem still appearing!

Post by Isotoxin »

Rakiayn wrote:why not make a new package for it? i think its easyer.
I can do it for you if you like
Well, that would be handy.

*EDIT*

It seems to be bugged, The slime was on, and damaging the player, but when I did put it of, and it reactivated again, it wasn't taking any damage anymore, however the zone was filled with slime again..
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Needing a scripter. (Little script change?)

Post by Rakiayn »

I attached the file.
found a 'triggerwaterzone' text in the script wich I changed to triggerslimezone.
Attachments
triggerslimezone.u
(4.63 KiB) Downloaded 154 times
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Same problem still appearing!

Post by Feralidragon »

Sorry, this is what happens when I provide stuff without testing. Anyway, it was missing some more things (in the case of damage, it wasn't rebooting the damage timer of the pawn, hence not giving damage to pawns already there).
Here it is (this time I tested it to ensure it was all working as supposed to, also took the opportunity to optimize it a bit):

Code: Select all

//=============================================================================
// TriggerSlimeZone.
// This class allows you to change a zone from a Regular Zone to a Slime Zone
// using the normal trigger method.
// Created by Scott 'Slasher IV' Kircher
//=============================================================================
class TriggerSlimeZone expands SlimeZone;

var int dmgPerSec;

function PostBeginPlay()
{
Super.PostBeginPlay();

	dmgPerSec = DamagePerSec;
	if(!bWaterZone)
	{
		ViewFlash = vect(0,0,0);
		ViewFog = vect(0,0,0);
		bPainZone = False;
		bDestructive = False;
		DamagePerSec = 0;
	}
}
   

function Trigger( actor Other, pawn EventInstigator )
{
local Actor A;
local Pawn P;

	if (bWaterZone)
	{
		bWaterZone = False;
		ViewFlash = vect(0,0,0);
		ViewFog = vect(0,0,0);
		bPainZone = False;
		bDestructive = False;
		DamagePerSec = 0;
		
		ForEach ZoneActors(Class'Actor', A)
		{
			ActorEntered(A);
			A.ZoneChange(Self);
			if(A.Buoyancy > 0.0)
				A.SetPhysics(PHYS_Falling);
		}
			
		ForEach AllActors(Class'Pawn', P)
		{
			if(P.HeadRegion.Zone == Self)
			{
				P.HeadZoneChange(Self);
				P.PainTime =- 1.0;
			}
			
			if(P.FootRegion.Zone == Self)
			{
				P.FootZoneChange(Self);
				P.PainTime = 0.01;
			}
		}
	}
	else
	{   
		bWaterZone = True;
		ViewFlash = default.ViewFlash;
		ViewFog = default.ViewFog;
		bPainZone = True;
		bDestructive = True;
		DamagePerSec = dmgPerSec;
		
		ForEach ZoneActors(Class'Actor', A)
		{
			ActorEntered(A);
			A.ZoneChange(Self);
			if(A.Buoyancy > 0.0)
			{
				A.Velocity.Z += 1;
				A.SetPhysics(PHYS_Falling);
			}
			
			if (Decoration(A) != None)
			{
				Decoration(A).bBobbing = False;
				A.Bump(Self);
			}
		}
			
		ForEach AllActors(Class'Pawn', P)
		{
			if(P.HeadRegion.Zone == Self)
			{
				P.HeadZoneChange(Self);
				P.PainTime = P.UnderWaterTime;
				P.SetPhysics(PHYS_Swimming);
			}
			
			if(P.FootRegion.Zone == Self)
			{
				P.FootZoneChange(Self);
				P.PainTime = 0.01;
			}
		}
	}
}
EDIT: Btw, merged both topics.
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Needing a scripter. (Little script change?)

Post by Isotoxin »

A big thanks, how can I turn this into an .u file to put it into mylevel?:$
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Needing a scripter. (Little script change?)

Post by Feralidragon »

Here's the .u file:
triggerslimezone.u
(4.14 KiB) Downloaded 145 times
As for putting it in MyLevel: http://www.ut99.org/posting.php?mode=re ... 44#pr41481
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Needing a scripter. (Little script change?)

Post by Isotoxin »

Thank you so much, Feli.
Post Reply