Make a counter reset after triggering

Talk about any Deus Ex game modification here, e.g. maps, package or a total conversion.

Moderator: Forum Guards

Make a counter reset after triggering

Postby Ayleth » Tue Jul 25, 06 6:11 am

I'm trying to get a counter to reset after it's been triggered 3 times, or how ever many times.... basically, so that it can re-trigger again...
OR... help me out....
Basic Idea:automatic vendor of any item.
Logistics: classbased trigger (FLCredits) trigers counter. When counter hits 3, it resets and triggers a door to open. Door closes after the player takes 1 item.
Current status: All work except for counter reset and auto door closing. I may set all items behind door to trigger the door to close on pickup.
I can send anyone who requests for it the current beta I have set up.
IM me to ask. JUnger@IDTMissions.org
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Re: Make a counter reset after triggering

Postby Allan » Wed Jul 26, 06 3:18 am

RivalMenace wrote:I'm trying to get a counter to reset after it's been triggered 3 times, or how ever many times.... basically, so that it can re-trigger again...
OR... help me out....
Basic Idea:automatic vendor of any item.
Logistics: classbased trigger (FLCredits) trigers counter. When counter hits 3, it resets and triggers a door to open. Door closes after the player takes 1 item.
Current status: All work except for counter reset and auto door closing. I may set all items behind door to trigger the door to close on pickup.
I can send anyone who requests for it the current beta I have set up.
IM me to ask. JUnger@IDTMissions.org


Custom trigger class to do the dirty work:

Code: Select all
//=============================================================================
// CounterFLCred.
//=============================================================================
class CounterFLCred expands Triggers;

Var int TimesTriggered;
Var(CreditCounter) int TriggersNeeded;
Var(CreditCounter) string SuccessMessage;
Var(CreditCounter) bool bUntrigger;
Var FLCredit Credit;

simulated function Touch( actor Other )
{
   local Actor A;

   if(!Other.IsA('FLCredit'))
   {
      return;
   }
   else if (Other.IsA('FLCredit'))
   {
      TimesTriggered++;
      if(TimesTriggered>=TriggersNeeded)
      {
         if( Event != '' )
         {
            foreach AllActors( class 'Actor', A, Event )
            {
               if(!bUntrigger)
               {
                  A.Trigger( Other, Other.Instigator );
               }
               else
               {
                  A.UnTrigger( Other, Other.Instigator );
               }
               TimesTriggered=0;
               Other.Instigator.ClientMessage(SuccessMessage);
               Other.Destroy();
            }
         }
         else
         {
            Other.Instigator.ClientMessage("|P2No event has been set =O");
            TimesTriggered=0;
            Other.Destroy();
         }
      }
      else
      {
         Other.Instigator.ClientMessage("|P3Only "$TriggersNeeded-TimesTriggered$" more credits to start the effect =)");
         Other.Destroy();
      }
      ForEach RadiusActors(class'FLCredit',Credit,CollisionRadius*1.05,Location)
      {
         if(Credit.Location.Z-Location.Z>=CollisionHeight)
         {
         }
         else if(Credit.Location.Z-Location.Z<=-CollisionHeight)
         {
         }
         else
         {
            Credit.Destroy();
         }
      }
   }
}

defaultproperties
{
     TriggersNeeded=5
     SuccessMessage="You've done it!"
     bUntrigger=False
     Texture=Texture'Engine.S_Counter'
}


You can set:

= What message you get for throwing enough credits at the trigger.
= How many credits it takes to trigger the trigger.
= Whether the trigger is a trigger or an un-trigger. (UnTrigger basically undoes the work of Trigger)

Should be useful to you =)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Ayleth » Wed Jul 26, 06 4:02 am

when i try to compile scripts, Error is genorated: unrecognised type 'FLCredit'
the compiler stops at Var FLCredit Credit
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Allan » Wed Jul 26, 06 9:30 am

Oops... Rename every instance of FLCredit in that script to what the Funline credit class name is. I'm not sure what it is, I've not got the Funline files here =(
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Gishank » Wed Jul 26, 06 11:00 am

It's flcredits i think.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Ayleth » Thu Jul 27, 06 3:12 am

question.... will this new class solve my need to reset a counter? I know it's a replacement counter, but will it reset after so many triggers?
I can't follow the code very well. And under what package does it go?
Thanks.
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Gishank » Thu Jul 27, 06 8:15 am

Look under triggers, and you will see it, if the specified mod is in editpackages or you have loaded it.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Allan » Thu Jul 27, 06 10:37 am

RivalMenace wrote:question.... will this new class solve my need to reset a counter? I know it's a replacement counter, but will it reset after so many triggers? Yes, it will =) You can even set how many in the Default Properties window for it.
I can't follow the code very well. And under what package does it go? It needs it's own package. I'll send it over with the file already in it =) (BTW, the funline Credit class is called FLCredits, right...?)
Thanks. Don't mention it =D
Attachments
FLCustom.u
Funline Counter, and I may add more stuff if you ask nicely XD
(3 KiB) Downloaded 557 times
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Ayleth » Fri Jul 28, 06 4:31 am

didn't work, man. also had to delete default properties as the compiler gave an error about that....
what's your MSN, I'll send you the map, so that you can mess with it. And yes, the scriptcall for the creds is FLCredits
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Gishank » Fri Jul 28, 06 9:00 am

It should of worked. ;) And why did you try to compile the .u file, what the fuck?
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Ayleth » Sat Jul 29, 06 12:01 am

lol, no I mean the F7... compile changed scripts! I didn't recompile the .u file!
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!


Return to Modifications

Who is online

Users browsing this forum: No registered users and 7 guests