My program doesn't have bugs. It just develops random features.

Unreal Wiki:Scratchpad

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 20:25, 14 April 2008 by Acidsphinx (Talk | contribs)

Jump to: navigation, search

This page is for pasting code you want to show someone as an example or to get assistance with. This allows you to easily collaborate with someone to solve a problem, and allows easy comparisons of the edits.

You are free to remove any existing code from below, and paste your code between the <uscript> </uscript> tags. If the page hasn't been edited in 24 hours, you can assume it isn't needed anymore and can be removed. A full edit history will be available, so don't worry about losing anything.


class MyTriggerMessage extends Trigger placeable;
const NoOfMessages=5;
function PostBeginPlay()
{
         Super.PostBeginPlay();
         Message=GetMessage();
}
function Bump(actor Other)
{
	Super.Bump(Other);
	Message=GetMessage();
}
function string GetMessage()
{
	local string OutText[NoOfMessages];
	OutText[0]="11";
	OutText[1]="22";
	OutText[2]="33";
	OutText[3]="44";
	OutText[4]="55";
	return OutText[Rand(NoOfMessages)];
}