UnrealSP.org, now with 100% more Web 2.0!

Gametype triggers?

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Gametype triggers?

Post Posted: 02 Sep 2012, 20:13

Does anyone know of a kind of trigger that could change the gametype ingame?

e.g Default to endgame for a cutscene.

It would be good if there is one.
Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 00:03

Pretty sure that's not possible.

If what you want is to remove the HUD for a specific event, THAT can be done.
Image

bob
Skaarj Lord Skaarj Lord
Posts: 205
Joined: 23 Apr 2011, 02:24
Location: USA
Contact:

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 02:26

i think he is trying to use a introgame gamtype to make a cutscene then jump back and forth to gameplay.

you cant change level.gametype

You may however be able to force switch to a different game type and the same ma , but at a differnt spawn point , but the map must change/reset. somthing like consolecommand(
"servertravel game=someothergametype?yoursmap.unr:secondhalfpeer");
althought im not sure thats acully doable...
also that would mess up a server etc , if it was played in any custom gametyp and forced into a new one.

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 07:58

If that's not possible, would it be possible to change the HUD and remove the weapon at the same time?

I see now that it was kind of thick trying to change the Gametype :shake:
Image

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 14:45

Captain Clark wrote:would it be possible to change the HUD and remove the weapon at the same time?


Yep.

Code: Select all

//=============================================================================
// HUDRemover.
//=============================================================================
class HUDRemover expands Triggers;

var playerpawn P;
var HUD pHUD;
var weapon PWeapon;
var() class<hud> NewHUD;
var bool bChanged;

function Trigger( actor Other, pawn EventInstigator )
{
   if(EventInstigator.isa('playerpawn'))   
   {
      if(!bChanged)
      {
         p = playerpawn(Other);
         if(P.HUDType != none)
         {
            pHUD = P.myHUD;
            P.MyHUD = spawn(NewHUD, p);
         }
         else
            P.MyHUD = none;
         PWeapon = p.weapon;
         P.Weapon = none;
         bChanged = true;
      
      }
      else
      {
         if(P.MyHUD != none)
            P.MyHUD.Destroy();
         p.myHUD = pHUD;   
         p.weapon = PWeapon;
         bChanged = false;
      }
   }
}

I posted this code three times... Each a bit different, this should be final XD

Just call an event with a trigger. Should work.
Last edited by Z-enzyme on 03 Sep 2012, 19:06, edited 1 time in total.

User avatar []KAOS[]Casey
Skaarj Berserker Skaarj Berserker
Posts: 426
Joined: 25 Sep 2008, 07:25

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 18:24

"bChagned"

Qtit why you do this? SPELLING!

Also, p.weapon = PWeapon; probably could use a != None check. Who knows, maybe there isn't a weapon already! I guess a couple other spots could use them but it's a major whatever since in testing it will break and will be extremely obvious.

[spoiler]haha made you change it again! ...maybe? I like turtles.[/spoiler]

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 18:36

Thanks Qtit. I think that's everything I need now for cutscenes...
Image

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: Gametype triggers?

Post Posted: 03 Sep 2012, 19:09

[]KAOS[]Casey wrote:"bChagned"
Qtit why you do this? SPELLING!

Because I'm retarded. And UED doesn't underline mistakes or type-oes.
Well, it's a fast type script, so, yea, it can have some bugs there. Just I don't have much time on my hands right now.

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 09 Sep 2012, 20:48

I actually just found a Gametype Trigger in the Triggers folder which I didn't notice all this time :rolleyes::
Image

I'm an idiot.
Last edited by SteadZ on 28 Mar 2018, 12:33, edited 1 time in total.
Image

User avatar Rarsonic
Skaarj Berserker Skaarj Berserker
Posts: 358
Joined: 11 Nov 2007, 21:45
Location: Location: Location: Location:
Contact:

Subject: Re: Gametype triggers?

Post Posted: 09 Sep 2012, 22:04

Yeah, but does it really work? And how?
Image

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 09 Sep 2012, 22:46

I think it must work, because I have a feeling that it was used for the cutscene inside the UMS Prometheus, because you view the player without an HUD or Weapon, but you can still control the player from third person. I might try it out.
Image

User avatar SteadZ
Skaarj Warlord Skaarj Warlord
Posts: 883
Joined: 04 Mar 2012, 10:52
Location: An error occurred. Please try again later.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 10 Sep 2012, 18:20

OK, they actually use the Upak Cam which can remove the crosshair and HUD (Weapon as well I suppose), but I might still try out this mysterious GameType Trigger.
Image

User avatar gubar
Skaarj Scout Skaarj Scout
Posts: 27
Joined: 11 Jun 2013, 01:24
Location: Popping up randomly in the world.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 04 Jan 2015, 15:33

This code doesn't seem to work with Dispatchers, only regular Triggers. Did anybody else try?

Z-enzyme wrote:
Captain Clark wrote:would it be possible to change the HUD and remove the weapon at the same time?


Yep.

Code: Select all

//=============================================================================
// HUDRemover.
//=============================================================================
class HUDRemover expands Triggers;

var playerpawn P;
var HUD pHUD;
var weapon PWeapon;
var() class<hud> NewHUD;
var bool bChanged;

function Trigger( actor Other, pawn EventInstigator )
{
   if(EventInstigator.isa('playerpawn'))   
   {
      if(!bChanged)
      {
         p = playerpawn(Other);
         if(P.HUDType != none)
         {
            pHUD = P.myHUD;
            P.MyHUD = spawn(NewHUD, p);
         }
         else
            P.MyHUD = none;
         PWeapon = p.weapon;
         P.Weapon = none;
         bChanged = true;
      
      }
      else
      {
         if(P.MyHUD != none)
            P.MyHUD.Destroy();
         p.myHUD = pHUD;   
         p.weapon = PWeapon;
         bChanged = false;
      }
   }
}

I posted this code three times... Each a bit different, this should be final XD

Just call an event with a trigger. Should work.

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: Gametype triggers?

Post Posted: 04 Jan 2015, 20:47

The code relies on EventInstigator, and by default stock dispatchers don't transmit the instigator to the triggered actor.

I made a better-er version of Dispatcher for EXU, creatively named EXUDispatcher. Feel free to utilize this - just rename the class to prevent potential conflicts. The key part is in Idle.Trigger() below:

Code: Select all

class EXUDispatcher extends EXUTriggers;

/*
[15:20:54] <Cukel> http://i.imgur.com/02blJzB.gif
[15:20:55] <Cukel> have some birds
[15:21:05] <Cukel> a christmastime peep
[15:21:06] <Waffnuffly> that goose thing looks fake
[15:21:07] <Specineff> awwwww
[15:21:14] <Cukel> yeah
[15:21:22] <Specineff> it might be a goose puppet
[15:22:33] <Cukel> 21:21:23 < Specineff> it might be a goose puppet
[15:23:17] <Specineff> like for baby geese with no parents
[15:23:27] <Specineff> and you have to teach them how to fly etc
[15:23:34] <Cukel> yeah
[15:24:28] <Cukel> INT. The Ghostbusters are checking out an abandoned warehouse. Their INSTRUMENTS show strange readings.
[15:24:35] <Cukel> DR. VENKMAN: It might be a goose puppet.
*/

var() bool bTransmitInstigator;   // If this dispatcher results in damage somewhere down the line, should the triggerer be credited?
var() name OutEvents[32];      // Don't leave blanks between slots if you want later slots to count. Use 'SKIPSLOT' or something
var() float OutDelays[32];
var() int NumDispatches;      // Run through cycle, loop NumCycles, then destroy. <=0 = infinite (will reset and await retriggering)
var() int NumCyclesPerDispatch;   // How many times to loop dispatch cycle. <=0 = infinite (will never stop running)

var int i, CycleCount, DispatchCount, EventTracker;


//===============================================================================
function PostBeginPlay()
{
   Super.PostBeginPlay();

   while( EventTracker < arraycount(OutEvents) && OutEvents[EventTracker]!='' )
      EventTracker++;
}



//=========================================================================================================
//=========================================================================================================
state Dispatch
{
   ignores Trigger;

Begin:
   DispatchCount++;

   for( i=0; i < EventTracker; i++ )
   {
      Sleep( OutDelays[i] );
      foreach AllActors( class 'Actor', Target, OutEvents[i] )
         Target.Trigger( Self, Instigator );
   }

   CycleCount++;

   if( NumCyclesPerDispatch<=0 || CycleCount < NumCyclesPerDispatch )
      GoTo('Begin');

   if( NumDispatches<=0 || DispatchCount < NumDispatches )
   {
      CycleCount = 0;      // Reset
      GoToState('Idle');
   }
   else
      Destroy();
}



//=========================================================================================================
//=========================================================================================================
auto state Idle
{
   //------------------------------------------------------
   function Trigger( actor Other, pawn EventInstigator )
   {
      if( bTransmitInstigator )
         Instigator = EventInstigator;
      GoToState('Dispatch');
   }
}



defaultproperties
{
   bCollideActors=False
   Texture=Texture'EXU.Icons.S_EXUDispatcher'
   bTransmitInstigator=True
   NumDispatches=1
   NumCyclesPerDispatch=1
}
Image

User avatar gubar
Skaarj Scout Skaarj Scout
Posts: 27
Joined: 11 Jun 2013, 01:24
Location: Popping up randomly in the world.
Contact:

Subject: Re: Gametype triggers?

Post Posted: 05 Jan 2015, 21:14

Thanks a lot for this Buff, it worked like a charm. With it I managed to put together my title sequence without compromises. Title sequence with no HUD, after which the player is immediately dropped in his/her spaceship, with the HUD. http://goo.gl/VH92Mk

Next

Who is online

Users browsing this forum: No registered users and 39 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited