A cheeky request.....

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

Euphoric Beaver

impeccably groomed
Apr 19, 2001
3,158
0
0
Great Britain
www.euphoric-beaver.me.uk
Could someone be ever so kind as to code me a trigger, expanding from Triggers not trigger.
That when a player pawn enters within a default value radius it gradually gets fatter untill a certain point then explodes.
Please. :D

And would it be possible to wright it so if the player pawn leaves it's radius it goes back to it's normal fatness?
 
Ugh... Here, let me try (you're gonna have to compile it yourself though):

Class FatArseTrigger extends Trigger;

var PlayerPawn fattyAsses[32];
var int fattyAssCount;

function Touch(Actor Other) {
if (PlayerPawn(Other) != none) {
fattyAsses[fattyAssCount] = PlayerPawn(Other);
fattyAssCount++;
}
}

function PostBeginPlay() {
Super.PostBeginPlay();
SetTimer(5.0,true); // change the 5.0 to how often you want the fatness to increase.
}

function Timer() {
local int i;

while (i < 32) {
if (fattyAsses != none) {
fattyAsses.fatness += 16; // change this to how much you want the fatness to increase
if (fattyAsses.fatness > 254)
fattyAsses.TakeDamage(10000); // not sure about the take damage function...
//can't remember it off hand. if this gives you an error,
//just copy it from, say, the sniper rifle and replace the
//damage by 10000
}
i++;
}
}

function UnTouch(Actor Other) {
local int i;
local bool stl;

if (playerPawn(Other) == none) return;

while (i < 32) {
if (fattyAsses == PlayerPawn(Other)) {
fattyAsses = none;
fattyAssCount--;
stl = true;
}
if (stl) {
fattyAsses[i-1] = fattyAsses;
}
i++;
}
}

Took me 5 minutes to write that... hope it works.

Eater.
 
Oh yea... forgot about the returning to normal part...
replace untouch(...) with this:
function UnTouch(Actor Other) {
local int i;
local bool stl;

if (playerPawn(Other) == none) return;

while (i < 32) {
if (fattyAsses == PlayerPawn(Other)) {
fattyAsses.fatness = 128;
fattyAsses = none;
fattyAssCount--;
stl = true;
}
if (stl) {
fattyAsses[i-1] = fattyAsses;
}
i++;
}
}
 

HOB

King of the Jungle
Mar 14, 2000
22
0
0
42
CT
www.planetunreal.com
shouldn't it be

function Touch(Actor Other) {
local int i;

if (PlayerPawn(Other) != none) {
while (i < 32) {
if (fattyasses == none) {
fattyAsses = PlayerPawn(Other);
fattyAssCount++;
i+=32;
}
else
i++;
}
}
}

but I'm not sure
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
I don't think you need to keep references to the players:
use the way Triggers are reTriggered after a certain time -- admitedly I don't know how that works...
that way a player in the radius will re-trigger every x seconds -- then you can interrogate that player's fatness, and increase it or explode it.

You might want to try & work in some sort of viewport effect for the player -- some sort of indicating that something is happening to them.
 

HOB

King of the Jungle
Mar 14, 2000
22
0
0
42
CT
www.planetunreal.com
but what if all 32 spaces in the array are being used and the 5th guy leaves, wouldnt it say that there's no open spaces left because it only checks the array number of the fattyasscount?
 

Euphoric Beaver

impeccably groomed
Apr 19, 2001
3,158
0
0
Great Britain
www.euphoric-beaver.me.uk
*CCTC ALERT*

Would something like this work?

Code:
Function Touch(Actor Other)
{
    If PlayerPawn.Fatness < 200;
        PlayerPawn.Fatness + 10;
    Else
        PlayerPawn TakeDamage 1000;
}

4 questions though. :)

1) What's the code to make a pawn take damage?

2) What's wrong with the code above? (Apart from the else bit)
Ie, is it all spelt right? I noticed that all of you were putting PlayerPawn(Other). What does the (Other) mean?

3) Would that code only happen when the Player hits it? Ie, it would stop being activated when the player is already inside the collision radius.

4) If so how would I incorporate a timer function into it?
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
Originally posted by Ciced
Code:
Function Touch(Actor Other)
{
    If PlayerPawn.Fatness < 200;
        PlayerPawn.Fatness + 10;
    Else
        PlayerPawn TakeDamage 1000;
}


1) I'll leave for someone else to tackle :)
2) the syntax for an if statement is:
Code:
if( condition )
statement ;
else
statement;
you're missing brackets around PlayerPawn.Fatness < 200 and the ; at the end of the first line must go. Other than that, fine. :)


3) that issue lies with the Trigger actor -- you can set a trigger actor to be reTriggered by somethi gin its radius every X seconds.
This would be the easier thing to do IMO -- have a Trigger actor repeatedly trigger this new class.
 

EasyRaider

Crazy coder
Sep 21, 2001
74
0
0
43
Norway
1) Try this (replace P with Other or whatever the name of the victim reference variable is):

P.TakeDamage (10000, P, P.Location, Vect(0,0,0), 'SpecialDamage');
 
HOB: Nope, because when the 5th person leaves, the 6th, 7th, 8th, etc. person becomes the 5th, 6th, 7th etc. person
About that code... Sorry, this isn't BASIC. You're going to have to learn the more popular type of language (C/Java/etc... original it came from some European language) that uses (), {}, and ;

Eater.