* Login   * Register * FAQ    * Search
It is currently Wed May 23, 2012 1:40 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Script-RandTrigger.zip
PostPosted: Fri Oct 23, 2009 4:52 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 21, 2009 3:59 am
Posts: 1916
Does anyone have this file?

_________________
www.ut-files.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 24, 2009 6:41 am 
Offline

Joined: Mon Apr 21, 2008 2:20 pm
Posts: 82
I don`t have it but found it somewhere else.

http://maps.kicks-ass.net/downloads.php?do=file&id=3517

However without account no download. But it this really worth the trouble? I have something VERY similar. (was scripted for me years ago after a request)

Code:
//=============================================================================
// RandomTriggerEX.
// Coder: Doc
// Project: USU - Unreal Skaarj Unleashed
// Date: today ;) (19.09.2004)
// New Version: 07.11.2007, Version 1.3
//=============================================================================
class RandomTriggerEX expands Trigger;

//#exec texture Import File=Textures\RandomTrigger.bmp Name=RandomTrigger Mips=Off Flags=2

var() float ReTriggerDelay[20]; // Array to hold up max. different retriggerdelay times
var() name EventList[20];       // Array to hold up max. 10 different Events
var() bool bUseEventList;      // set to true, if you want to use the Random Event Function, default is false (= use standard event)
var() bool bPlayerTrigger;      // set to true, if you want that players can trigger it, default is false (use dispatcher, aso)
var float fReTriggerDelayAct;   // internal actual retriggerdelay time



//
// See whether the other actor is relevant to this trigger.
//
function bool IsRelevant( actor Other )
{
   if( !bInitiallyActive )
      return false;
   switch( TriggerType )
   {
      case TT_PlayerProximity:
         return Pawn(Other)!=None && Pawn(Other).bIsPlayer && bPlayerTrigger;
      case TT_PawnProximity:
         return Pawn(Other)!=None && ( Pawn(Other).Intelligence > BRAINS_None );
      case TT_ClassProximity:
         return ClassIsChildOf(Other.Class, ClassProximityType);
      case TT_AnyProximity:
         return true;
      case TT_Shoot:
         return ( (Projectile(Other) != None) && (Projectile(Other).Damage >= DamageThreshold) );
   }
}

// 
// Called when something touches the trigger.
// 
function Touch( actor Other ) 

     local actor A; 
     local int iIndex, cnt; 
 
     if( IsRelevant( Other ) ) 
     { 
          if ( fReTriggerDelayAct> 0 ) 
          { 
               if ( Level.TimeSeconds - TriggerTime < fReTriggerDelayAct) 
                    return; 
               TriggerTime = Level.TimeSeconds; 
          } 
          // letz get dirrrty - part I
 
 
        if (bUseEventList) 
        { 
            iIndex = rand(20); 
            cnt =0; 
            while (EventList[iIndex]=='') // why cnt? because of dumb noobs,
                                                       // so this trigger won't cause an
                                                       // endless loop ;-)
            { 
                 // log("While-Durchgang Nr. "@cnt);
                iIndex = rand(20); 
                if (cnt == 200) 
                { 
                     log("ERROR: Dumb Noob has forgotten to specify events in the event-list... Loop terminated for stability reasons. Check the Properties of"@self); 
                     return; 
                } 
                cnt++; 
            } 
            if (EventList[iIndex]!='') 
            { 
                // BroadCastMessage("Actual Event:"@EventList[iIndex]); //used
                    // for debugging
                foreach AllActors( class 'Actor', A, EventList[iIndex]) 
                { 
                     // log("RandomTriggerEXForEach");
                    A.Trigger( Other, Other.Instigator ); 
                } 
            } 
 
        } else if( Event != '' ) // if we're not using the Eventlist, do standard
                                   // routine
        { 
             // log("RandomTriggerEXElseIf");
             //      Broadcast Event.
             foreach AllActors( class 'Actor', A, Event) 
                  A.Trigger( Other, Other.Instigator ); 
        } 
        if ( Other.IsA('Pawn') && (Pawn(Other).SpecialGoal == self) ) 
             Pawn(Other).SpecialGoal = None; 
 
        if( Message != "" ) 
             //      Send a string message to the toucher.
             Other.Instigator.ClientMessage( Message ); 
 
        if( bTriggerOnceOnly ) 
             //      Ignore future touches.
             SetCollision(False); 
        else // letz get dirrrty - part II
        { 
             iIndex = rand(20); 
             cnt=0; 
             while (ReTriggerDelay[iIndex]==0.0 && cnt <= 200) // why cnt? because of dumb
                                                                 // noobs, so this trigger
                                                                 // won't cause an endless
                                                                 // loop ;-)
             { 
                  // log("While2-Durchgang Nr. "@cnt);
                  iIndex = rand(20); 
                  cnt++; 
             } 
             if (cnt < 200)     
             {
                  fReTriggerDelayAct = ReTriggerDelay[iIndex]; 
                  // BroadCastMessage("Actual ReTriggerDelay:"@fReTriggerDelayAct); //used for
                  // debugging
                  //SetTimer(fReTriggerDelayAct , false); 
             }
        } 
     }       
}






function Timer()
{
     local bool bKeepTiming;
     local int i;

     bKeepTiming = false;

     for (i=0;i<4;i++)
          if ( (Touching[i] != None) && IsRelevant(Touching[i]) )
          {
               bKeepTiming = true;
               Touch(Touching[i]);
          }
}


defaultproperties{

//Texture=Texture'GenEarthJungle.RandomTrigger'

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO