| Home Page | Recent Changes | Preferences

Jarronis, The Vampiric Unicorn

About Me

Hobby UScript-Coder, Oldsk00l-UT-Combat-Monster & UT2003-N00b...

Yeah, I'm still alive

Yes this is correct. Yes I did not forget the chameleon code. Unfortunately (for UnrealWiki), there also several other projects, which require me..., including some personal 'coding tasks'.

Current Coding Projects (personal)

UC-ab278.01 "Snipercorn" :cool:

Some kind of energy Crossbow with multiple ammo support, target acquisition... and all that stuff.

This one is also my first modelling project.

UC-b384 "Dragons Fury"

Napalm/Plasma Thrower. Nothing special, but the Fire Effect looks nice.

Almost finished.

Current Coding Projects (wiki-related)

See Mod Ideas/Chameleon


I just figured out that it is much easier get texture names form the level than i thought. If you look in the definition of the trace function, you'll see one interresting thing:

native(277) final function Actor Trace
    out vector      HitLocation,
    out vector      HitNormal,
    vector          TraceEnd,
    optional vector TraceStart,
    optional bool   bTraceActors,
    optional vector Extent,
    optional out material Material

The very last parameter allows to store the material from the actor, hit by the trace. This is pretty cool for the Chameleon-Mod. I've experimented with it, and it works great.

This, of course, is not all, because this has to be a kind of client-side effect to determine what wall we should trace. I think i could hack this into an interaction.

So here is a Screenshot, showing an similiar effect like the one that is planned. In fact it is actually the chameleon effect, but still picking the texture from the ground.

He's to shy to show his face because this isn't camouflaged :P

Technically spoken: I still replaced only the first entry in the Skins-Array.

Here is the code of the Mini-Mutator (seen in Action in the screenshot).

// ChameleonFX <-J-VU
// This class changes skin of the assigned pawn, 
// according to the material of the ground

class ChameleonFX extends Actor;
var pawn AttachedTo;
var vector loc, norm, target;
var material Tmat;

event postbeginplay()

event timer()
    if (AttachedTo != None)
        if (TMat!=None) AttachedTo.Skins[0]=Tmat;
    else destroy();

This class dynamically changes the pawn's skin. As you see, the trace is still constant, and "scans" the ground for his material. I'm going to code this into an (hopefully) complete client side Interaction-Class, so every player determines the direction for the trace for himself.

// MutCham < J-VU
// This mutator is responsible for spawning a ChameleonFX-Actor
// for each pawn that logs in.

class MutCham extends Mutator;

function ModifyPlayer(Pawn Other)
    local ChameleonFX cfx;
    cfx = spawn(class'Chameleon.ChameleonFX',self);
    if ( NextMutator != None )

    FriendlyName="Chameleon Arena"

Well, that is the Mutator...

This one was pretty easy, as you see.

After a long time of inactivity, i continued coding on this issue.

So here's the Code of the Interaction-Class Version:

// ChamInter <- J-VU
// This (hopefully) client-sided class is responsible for 
// detecting the proper texture for the Chameleon effect
// from the view of the player.
// A lot stuff is taken from the UnrealWiki - Documentations
// so do not wonder if there're 'common' things

class ChamInter extends Interaction;

var GameReplicationInfo GRI;
var Font UsedFont;

event Initialized()
    log("Chameleon Interaction Initialized");
    foreach ViewportOwner.Actor.DynamicActors(class'GameReplicationInfo', GRI)
        If (GRI != None)

event tick(float DeltaTime)
    local Pawn ChP, Selfpawn;
    local vector loc, norm, target;
    local material Tmat;
    if (ViewportOwner.Actor.Pawn == None) return;
    Selfpawn = ViewportOwner.Actor.Pawn;
    foreach ViewportOwner.Actor.DynamicActors(class'Pawn', ChP)
        ViewportOwner.Actor.Trace(loc, norm, (normal(ChP.location-Selfpawn.location)*8192)+ChP.location,ChP.location,true,,tmat);
        if (TMat!=None) ChP.Skins[0]=Tmat;
        if (TMat!=None) ChP.Skins[1]=Tmat;

simulated function PostRender( canvas Canvas )
    If (UsedFont == None) UsedFont = Font(DynamicLoadObject("UT2003Fonts.FontEurostile12", class'Font'));
    Canvas.Font = UsedFont;
    Canvas.FontScaleX = 1;
    Canvas.FontScaleY = 1;
    Canvas.DrawText("Chameleon Activ");//debugging...


You'll still need a mutator to spawn these interactions. This of course is a very basic version, so it hasn't any gameplay tweaks.


CH3Z: Wow! I'm excited! This is for UT Classic then?

Jarronis, The Vampiric Unicorn I'm sorry, but this is still for UT2003. I haven't coded for UT Classic for awhile. But if picked up my UT Classic Installation form my HDD, i can go for it :)

Mosquito: I'm interested to know what you're going to do with the code once you finished. It adds a whole new type of gameplay. As I mentioned before, I wanted to do this in my HL mod and my UT2003 mod. I'm a beginning scripter.

CH3Z: I just took a look at UT code and the very param that you mentioned, "optional out material Material" turns out to be the only line that is different in UT>>Actor/native(277) final function Actor Trace. The diff is that it's just not there in the UT engine like it is in UT2003. =( oh well.

Mr.Mitchell: For the old UT you can use a Decal to get a texture. Just spawn one and use the AttachDecal function to attach it to a surface. The attachDecal function returns the texture of the surface it is attached to.

Jarronis, The Vampiric Unicorn Cool! Thanks for this advice.

Ch3z: Looks like your having all kinds of fun Jarronis. =) I wanted to let you know that I added a page to the Wiki that you might find usefull. The Testing Lab might have been nice when you wanted to have someone test the Chameleon Mutator online.

I would love to see new models you make or any work you do. But remember I'm still only running UT. And yes, I still still wear army jackets around town from the surplus stores heheh I'm not dated, I'm just seasoned =P Keep havin' fun with the engine.

Jarronis, The Vampiric Unicorn Oldsk00l-UT, hm? Well... i think there's a whole UT-Weapon-Arsenal haunting around on my HDD. If i dig it out, you probably have something to frag around with, but be prepared: As you might guess i have "slight" tendence to overkill weaponery (more BOOOOM for ya' money). There's even a complete War-Suite, including adaptiv Armor, Invisibility, LifeSens-Wallhack... ehm, okay... so much 'bout my Definition of "Overkill" :eek:

Category Personal Page

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands


Mapping Topics

Mapping Lessons

UnrealEd Interface


Scripting Topics

Scripting Lessons

Making Mods

Class Tree


Modeling Topics


Log In