News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > UnrealEngine2 Runtime > Programming

Thread Tools Display Modes
Old 31st Oct 2005, 07:58 PM   #1
Registered User
Join Date: Oct. 31st, 2005
Posts: 2
How do i get a meshes details!!! HELP

I am quite new to this coding in Unreal Script but i am getting there.

I have implemented the trace tutorial from the UDN website that will return a message to the HUD and also call up a texture when the trace hits a mesh/actor.

class RTTestInteraction extends Interaction;

    function Initialized()
 log(self@"i'm alive");

 function PostRender( canvas Canvas )

 function simpleTracer(canvas Canvas)
  local actor Other;
  local vector HitLocation, HitNormal, StartTrace, EndTrace;
  local vector ScreenLocation;
  local PlayerController PlayerOwner;
  PlayerOwner = ViewportOwner.Actor;

  //Perform a trace to find any colliding actors
  StartTrace = PlayerOwner.Pawn.Location;
  StartTrace.Z += PlayerOwner.Pawn.BaseEyeHeight;
  EndTrace = StartTrace + vector(PlayerOwner.Pawn.Rotation) * 1000.0;
  Other = PlayerOwner.Pawn.Trace(HitLocation, HitNormal, EndTrace, StartTrace,True);

  if (Other != None)
   PlayerOwner.ClientMessage ("Hit:"@Other);
   //Convert 3d location to 2d for display on the Canvas
   ScreenLocation = WorldToScreen(Other.location);
   Canvas.SetPos(ScreenLocation.X, ScreenLocation.Y);
   Canvas.Style = 3;
   Canvas.DrawTile(texture 'S_Actor', 84,84,0,0,84,84);


Please Help.
I need it to return the mesh objects name eg; farmhouse, stairs, wall, etc,.


I need to be able to say "if mesh/actor/object is "farmhouse" then show this texture"

please help!!!
widroy is offline   Reply With Quote
Old 1st Dec 2005, 04:09 AM   #2
Registered User
Hazard.ep's Avatar
Join Date: Oct. 7th, 2003
Posts: 166
So your farmhouse/stairs ... is a static mesh actor? Then you have to use the returned TraceActor (or sth. like this) and check its StaticMesh variable. You could compare it to some other value. Other idea would be to make a class for farmhouse/stair... directly subclassing StaticMeshActor and checking for the class of the actor your trace hits. Thinking over it makes me draw the conclusion that this way is the better one. I've used it before...

Erik 'HaZarD' Poppe - Caster-Mod - Lead Coder, Project Coordinator
Hazard.ep is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 08:49 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2015, vBulletin Solutions, Inc.

Copyright ©1998 - 2015, BeyondUnreal
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer