Please help a dumbassed mapper!!!!

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Grazor

New Member
Hi All,

Does anybody have or know of any code that would allow me to change the gravity in a zone mid game, from a trigger?

I am currently building an assault map where one objective is to blow up a gravity generator. This then triggers a change in gravity from normal to low.

I can only think of two ways to do this, both require scripting of a new zoneinfo actor.

1. add a bEnabled switch to the zoneinfo allowing it to be switched on and off

or

2. add an extra set of settings for the zoneinfo allowing you switch between.

However I know nothing about coding and may well be talking out of my ***insert body part of your own choice here***.

Can anyone help me?

Cheers
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
ZoneTrigger is only used for specific things like WarpZones AFAIK.
Zones have a regular trigger too.

I'd say subclass ZoneInfo, and add a Trigger() function that changes the grravity value.
 

Grazor

New Member
Thanks Tarquin,

I created a script for a GravZoneInfo actor as suggested, with a bit of help from Lode at http://www.planetunreal.com/lode/

//=============================================
// GravZoneInfo.
//=============================================
class GravZoneInfo expands ZoneInfo;

function trigger(actor Other, pawn EventInstigator)
{
ZoneGravity.X = 0;
ZoneGravity.Y = 0;
ZoneGravity.Z = -100;
}

Works a treat but I have to recompile everytime I want to change the ZoneGravity value.

Is there a way of changing it so that I can change the value from the properties box in the editor?
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
At the top of the class, after the class declaration add:

var() vector TriggeredGravity;

and then change the code in the function to:

ZoneGravity = TriggeredGravity ;

you can even get really fancy & make several versions of Trigger() for different states, for example if you want to be able to toggle the gravity, or have it trigger-controlled :D
 

Grazor

New Member
Thanks Tarquin,

I understand the first bit, however you lost me here:

you can even get really fancy & make several versions of Trigger() for different states, for example if you want to be able to toggle the gravity, or have it trigger-controlled

I thought it is trigger controlled already?. In my test map I used a trigger to set off the gravity change or am I missing the point?

Can you give me an example please?, I'm no coder :D
 

EasyRaider

Crazy coder
Sep 21, 2001
74
0
0
43
Norway
You could do something like this to be able to trigger it on and off (not tested):
Code:
auto state NormalGrav
{
   function Trigger (Actor Other, Pawn EventInstigator)
   {
      ZoneGravity = TriggeredGravity;
      GotoState('LowGrav');
   }
}

state LowGrav
{
   function Trigger (Actor Other, Pawn EventInstigator)
   {
      ZoneGravity = default.ZoneGravity;
      GotoState('NormalGrav');
   }
}
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
Grazor, check out Tim Sweeney's document on UnrealScript -- that has a very good explanation of what states are and what they are for.

How you use states depend on what you are doing... okay, glib way of putting it....
Actors, like bots for example, have states that describe their behaviour.
Things like movers and triggers have states that are usually fixed and set by the mapper. In a way, it means a class of actor can have several uses. The best example is SpecialEvent, which, depending on which state the mapper sets it, is basically a fundamentally different object.

I was thinking of several states that allow the mapper to change the way the zone reacts to triggers. You could have "state TriggerToggle" that toggles between gravities when triggered.

By "TriggerControl" I meant like doors that open when you step into their radius, stay open as long as you stay there, and close as soon as you step out. I think the ones in CTF-Cybrosis][ do that. Sorry about the confusion. :)