PDA

View Full Version : A cheeky request.....


Euphoric Beaver
30th Oct 2001, 08:30 AM
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?

FireSlash
30th Oct 2001, 09:46 AM
i dont know anything about triggers, but i know its possible.

look through the fatboy mutator code, and the pressure spot in DM-Pressure.

Eater1
30th Oct 2001, 03:57 PM
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[i] != none) {
fattyAsses[i].fatness += 16; // change this to how much you want the fatness to increase
if (fattyAsses[i].fatness > 254)
fattyAsses[i].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[i] == PlayerPawn(Other)) {
fattyAsses[i] = none;
fattyAssCount--;
stl = true;
}
if (stl) {
fattyAsses[i-1] = fattyAsses[i];
}
i++;
}
}

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

Eater.

Eater1
30th Oct 2001, 04:10 PM
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[i] == PlayerPawn(Other)) {
fattyAsses[i].fatness = 128;
fattyAsses[i] = none;
fattyAssCount--;
stl = true;
}
if (stl) {
fattyAsses[i-1] = fattyAsses[i];
}
i++;
}
}

HOB
30th Oct 2001, 10:24 PM
shouldn't it be

function Touch(Actor Other) {
local int i;

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

but I'm not sure

tarquin
31st Oct 2001, 05:39 AM
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.

Eater1
31st Oct 2001, 03:31 PM
Tarquin: yeah, that would be better, but I was too lazy to look up the retriggering thing.
HOB: nope, that stuff is not needed. The fattyasscount automatically keeps track of the last open space. Or at least it should.

Eater.

HOB
31st Oct 2001, 04:34 PM
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
1st Nov 2001, 08:51 AM
*CCTC ALERT*

Would something like this work?


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
1st Nov 2001, 10:22 AM
Originally posted by Ciced
[B]
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:
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
1st Nov 2001, 02:05 PM
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');

Eater1
1st Nov 2001, 04:11 PM
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.

HOB
1st Nov 2001, 06:53 PM
What you talkn' 'bout Eater?

so this makes it move everyone in the array back one space?

"if (stl) {
fattyAsses[i-1] = fattyAsses[i];
}"

Eater1
2nd Nov 2001, 03:34 PM
Yup. Either that or I'm missing something.

Eater.