Triggered Zone Info?

  • 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.

Ein

Not stein
Aug 22, 2005
9
0
0
43
where else
I have this one level I'm building, which would do really nicely with a DM-Pressure-like effect. Basically what i'm asking is, is there a way to toggle a ZoneInfo? I managed to make a triggered one, but in this case it just turns the ZoneInfo on and leaves it on, no matter if you try to use the trigger again. Is there a way to just toggle the ZoneInfo on and off?
 

Ironblayde

Director of Misanthropy
Feb 24, 2004
213
0
0
You'll need to derive a new class from ZoneInfo and replace the code that controls its behavior when triggered. A typical ZoneInfo has this:
Code:
function Trigger( actor Other, pawn EventInstigator )
{
	if (DamagePerSec != 0)
		bPainZone = true;
}
What this does is: if the zone has a DamagePerSec setting but is not initially set to deal damage, then it switches to a damage-dealing zone the first time it's triggered and remains that way. If you wanted to change it so that the damage-dealing status flipped on and off with each trigger, a simple change would suffice:
Code:
function Trigger( actor Other, pawn EventInstigator )
{
	if (DamagePerSec != 0)
		bPainZone = [b]!bPainZone[/b];
}
My change is in bold. Now bPainZone will change its value each time the zone is triggered. Note that you should never change the code for one of the retail classes like ZoneInfo; instead you should derive a new class from ZoneInfo and put your code there.

If you're after a more complicated effect, then it might require a bit more work. DM-Pressure uses a particular type of ZoneInfo called a PressureZone. If you want the same sort of effect then you can just use that actor and you're set. If you want it to behave different somehow, then you might need to come up with a custom actor. If you decide this is the way to go but don't have any experience with UnrealScript, please post a detailed explanation of exactly what you want and I'll see if I can help you get it working.
 

Ein

Not stein
Aug 22, 2005
9
0
0
43
where else
Alright, thanks for your help Blayde. Here's what I have in mind:
A big room in the middle has this reactor thing going on in it. What I want is a switch that will sort of set the reactor into "meltdown". It has a triggered light and sound for the alarm, and now all I need is to figure out how to make the toggled ZoneInfo. A custom kill message would be nice, too... All the last ones I've tried making failed to work. If anyone's still willing to help, it would be appreciated, but I think i could work with what Blayde gave me already.

EDIT: Since this is the first time I've done scripting, chances are I'm doing something horribly wrong. It says it can't find the file for package "MyPackage".
 
Last edited:

Ironblayde

Director of Misanthropy
Feb 24, 2004
213
0
0
Ein said:
EDIT: Since this is the first time I've done scripting, chances are I'm doing something horribly wrong. It says it can't find the file for package "MyPackage".
I'm heading out in a couple minutes so I'll try addressing the rest of your post later, but I can field this part quickly. When you create a new class derived from ZoneInfo, you should see the following dialog:

nc-newclass.png


"Package" is, not surprisingly, the name of the package in which your class will be stored. If you enter MyLevel here, then the actor will be stored inside your map, which is what I usually do for simple bits of UnrealScript. If you enter anything else, such as the default MyPackage, then your class will be stored in an external file called MyPackage.u and will be found in your System folder. If you do that, then you need to make sure that you save your changes, or your package won't be retained. There's an option for it in the Actor Browser, under the File menu.

So, chances are that you created a new class, placed an instance of it in your map, but neglected to save the package, which means the MyPackage.u file wasn't written, and that's what UnrealEd is looking for. If you can't open your map at all at this point, just create a MyPackage.u file and you should be OK. Once you get the map open you may want to delete the custom actor you placed and start over with a new package name just to make sure everything works all right. Make sure you save the package if you don't use MyLevel!
 

Ironblayde

Director of Misanthropy
Feb 24, 2004
213
0
0
OK, I read the rest, and it sounds to me like you can just use a PressureZone, without any custom scripting needed. On its default settings, the PressureZone provides an instantaneous kill whenever triggered. If you want the kill to take awhile and/or produce visual effects for the victim, the properties you want to look at are in the PressureZone category. KillTime determines how long it takes to complete the kill, and the rest of the properties in that group relate to visual effects.

To change the death message, set the DamageString property in the ZoneInfo group. The default for a PressureZone is "%o was depressurized by %k." As you can tell from that example, %o will be replaced by the victim's name, and %k will be replaced by the name of the player who triggered the PressureZone.
 

Ein

Not stein
Aug 22, 2005
9
0
0
43
where else
I have the MyPackage.u file in my System folder, it's an exact replica of the old zone i created. But what do you know?... General protection fault whenever I try to run my map. I guess I could just restart the whole project in this case.
 

Ironblayde

Director of Misanthropy
Feb 24, 2004
213
0
0
Wow, that's not good. Can you upload what you have so far? Maybe I can figure out how to salvage it.
 

Ein

Not stein
Aug 22, 2005
9
0
0
43
where else
I didn't bother hosting it on Nalicity yet, it would just spam up the space. Here is my map, and here is the .u package. Maybe it's the pack that's glitching?

But yeah, you've been amazing about all my "issues". Thanks for all your help, Ironblayde.
 
Last edited:

Ironblayde

Director of Misanthropy
Feb 24, 2004
213
0
0
Yeah, I don't know what was in that .u file you uploaded, but it was a lot bigger than I would have expected. Even just trying to open that file by itself from the Actor browser crashed UnrealEd for me.

Anyway, I threw the .u file away and made a MyPackage that just had a dummy class in it. Then I tried to open your map and it said it couldn't find the class ReactorZone -- this is in the UnrealEd console, by the way, which is where you should look to figure out where loading errors are coming from -- so I renamed my dummy class to ReactorZone and rebuilt the package, and then I was able to open your map. I deleted the ReactorZone actor so the map no longer relies on MyPackage, and have attached the fixed version to this post. I suggest you just go with a PressureZone instead of messing with UnrealScript. ;)
 

Attachments

  • DM-Reactor-fixed.zip
    184.1 KB · Views: 7

Ein

Not stein
Aug 22, 2005
9
0
0
43
where else
Thanks a bunch, blayde. Level works again. Now i'd better hit the tuts for unreal script...! By the way, if you're wondering about the level quality (using the word "quality" loosely here), this is my first map, too. So i guess i could be considered a complete newb :lol:
 

ReD_Fist

New Member
Sep 6, 2004
1,404
4
0
64
Michigan
The ONLY zone I found switchable is "preasurezone" with out making any new classes.And never got a zone trigger to work, every dang thing only gets a signal when entering or leaving a zone.But all the other zonetypes won't trigger so eventhough entering and exiting sends an event it's useless for this type of thing.
 

oosyxxx

teh3vilspa7ula
Jan 4, 2000
3,178
71
48
ReD_Fist said:
The ONLY zone I found switchable is "preasurezone" with out making any new classes.And never got a zone trigger to work, every dang thing only gets a signal when entering or leaving a zone.But all the other zonetypes won't trigger so eventhough entering and exiting sends an event it's useless for this type of thing.

For maximum power, change the trigger's settings to the following: b=HideMexicansOrInfuriateReD_Fist