Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra: Ostfront 41-45 Forums > Red Orchestra Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2006, 11:46 PM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default Attaching mesh to vehicle

I have a class MozP4H_Skirt (subclass RODummyattachment) which I want to attach to my pawn (MozP4HTank)

For some reason this code isn't working. (wont compile at all)

Code:
var class<StaticMesh> SMeshvar, SpawnedSMesh;

function PostBeginPlay()
{
  MozP4H_Skirt = Spawn(SpawnedSmesh, self,, Location, Rotation);
  AttachToBone(MozP4H_Skirt, spine);
}
I have also discovered I hate coding
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]

Last edited by Moz; 08-10-2006 at 02:25 AM.
Reply With Quote
  #2  
Old 08-10-2006, 02:25 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

also, how would I go about scaling a bone on a pawn (turret) but on just one axis (to lengthen the barrel)

I was also worrying if I attach the SM it wont disappear then the vehicle is destroyed.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #3  
Old 08-10-2006, 03:22 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

from what class is that code above? is that from your subclassed Pz4?
Or from your skirts class? If the later it cant work.

But i think i got it right and thatsthe code form the Pz4.
Anyway, whats the error message?
Aint the bone a name and should be 'spine' (if there is a spine bone on a Pz4 Skel )

As for the destroyed model, no you wont see it there unless you modify it and spawn a different model when the tank is destroyed.
Reply With Quote
  #4  
Old 08-10-2006, 03:33 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Its from the Tank Class. I did have it set to body instead of spine but that one on the clipboard had the spine still.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #5  
Old 08-10-2006, 03:36 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

also in ' ' ? The error message would really help

btw. why

Code:
var class<StaticMesh> SMeshvar, SpawnedSMesh;
?
Reply With Quote
  #6  
Old 08-10-2006, 03:36 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Quote:
Originally Posted by worluk
also in ' ' ? The error message would really help
wotgreal takes forever to start :S

(photoshop, unrealed, winamp, thunderbird, MSPaint and now wotgreal all running and processing things at the same time :S)
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #7  
Old 08-10-2006, 03:43 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Error: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(16) : Error, 'MozP4H_Skirt': Bad command or expression
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #8  
Old 08-10-2006, 03:54 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

i take it MozP4H_Skirt is not defined anywhere? You need something like

Code:
local StaticMesh MozP4H_Skirt;
in your PostBeginPlay function.
Reply With Quote
  #9  
Old 08-10-2006, 04:10 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Code:
var class<StaticMesh> SMeshvar, MozP4H_Skirt;

function PostBeginPlay()
{
  MozP4H_Skirt = Spawn(MozP4H_Skirt, self,, Location, Rotation);
  AttachToBone(MozP4H_Skirt, spine);
}
where? :S (its late and I'm tired)
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #10  
Old 08-10-2006, 05:33 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

Code:
var class<StaticMesh> SMeshvar, MozP4H_Skirt;

function PostBeginPlay()
{
  local StaticMesh MozP4H_Skirt;   

  MozP4H_Skirt = Spawn(MozP4H_Skirt, self,, Location, Rotation);
  AttachToBone(MozP4H_Skirt, spine);
}
Reply With Quote
  #11  
Old 08-10-2006, 06:19 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Doesn't it need to be <actor> since MozP4H_Skirt is infact an actor?

edit:

Error: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(18) : Error, Call to 'Spawn': type mismatch in parameter 1
Warning: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(16) : Warning, 'MozP4H_Skirt' obscures 'MozP4H_Skirt' defined in base class 'MozP4HTank'.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #12  
Old 08-10-2006, 06:47 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

thats why i asked wether MozP4H_Skirt is declared anywhere. Obviously it is, then you dont need the local var. (overlooked it in your code :x)

i still dont know why you do

Code:
var class<StaticMesh> SMeshvar, MozP4H_Skirt;
Reply With Quote
  #13  
Old 08-10-2006, 08:52 AM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,475
Default

I'm wondering if you can create teh skirt as a skeletal mesh to attach it to the root tank-bottom bone.. basically exactly how the ammo pouches are done.

Just subclass the PanzerVIF2Tank and mimic how the player equipment gets attached...
Reply With Quote
  #14  
Old 08-10-2006, 02:02 PM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Quote:
Originally Posted by UncleDrax
I'm wondering if you can create teh skirt as a skeletal mesh to attach it to the root tank-bottom bone.. basically exactly how the ammo pouches are done.

Just subclass the PanzerVIF2Tank and mimic how the player equipment gets attached...
That is what I'm trying to do

I scanned through the ROPawn and I couldn't find anything attachtobone related and the way ammo is attached is weapon related.

I also can't make the skirts Skeletal meshes because I do no have a modeling program that can export sketetal meshes.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #15  
Old 08-10-2006, 02:38 PM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

I'm pulling my hair out trying to figure this out, I'm willing to email the both UC files to anyone that can figure this out. it seems so simple but I can't get it to work.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #16  
Old 08-11-2006, 04:31 AM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Here is the abridged version of my class.

What do I have to do to make this work.


Code:
//===================================================================
// PanzerIV Ausf H Tank
//===================================================================
class MozP4HTank extends ROTreadCraft;

#exec OBJ LOAD FILE=..\Animations\MozP4H_anm.ukx

// DOESN'T ****ING WORK
var     class<MozP4HSkirt>             BodySkirtClass;
var     array<MozP4HSkirt>               BodySkirt;

function PostBeginPlay()
{
  if (BodySkirt == None)
      {
      BodySkirt = Spawn(BodySkirtClass, self, Location, Rotation);
      Bodyskirt.SetBase(self)
      AttachToBone(actor'MozP4H.MozP4HSkirt', 'body' );
      }
}

defaultproperties
{

}
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #17  
Old 08-11-2006, 08:42 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,219
Default

this doesnt compile, right?

why do you try to use a dynamic array for the skirt?
Does it consist of more than one part?

Code:
 BodySkirt = Spawn(BodySkirtClass, self, Location, Rotation);
this call cant work imo with the declaration.
something like
Code:
 BodySkirt[0] = Spawn(BodySkirtClass, self, Location, Rotation);
might, but still it would be easier to change

Code:
 var     array<MozP4HSkirt>               BodySkirt;
to

Code:
 var     MozP4HSkirt             BodySkirt;
Reply With Quote
  #18  
Old 08-11-2006, 02:14 PM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Code:
var     class<MozP4HSkirt>             BodySkirtClass;
var     MozP4HSkirt             BodySkirt;

function PostBeginPlay()
{
  if (BodySkirt == None)
      {
      BodySkirt = Spawn(BodySkirtClass, self, Location, Rotation);
      Bodyskirt.SetBase(self)
      AttachToBone(actor'MozP4H.MozP4HSkirt', 'body' );
      }
}
Error: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(16) : Error, Call to 'Spawn': type mismatch in parameter 3

I have no idea what I am doing.
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
  #19  
Old 08-11-2006, 03:00 PM
Maj.Faux-Pas's Avatar
Maj.Faux-Pas Maj.Faux-Pas is offline
Senior Member
 
Join Date: Mar 2006
Location: Portland, OR
Posts: 363
Default

Quote:
Originally Posted by Moz View Post
Code:
var     class<MozP4HSkirt>             BodySkirtClass;
var     MozP4HSkirt             BodySkirt;
 
function PostBeginPlay()
{
  if (BodySkirt == None)
      {
      BodySkirt = Spawn(BodySkirtClass, self, Location, Rotation);
      Bodyskirt.SetBase(self)
      AttachToBone(actor'MozP4H.MozP4HSkirt', 'body' );
      }
}
Error: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(16) : Error, Call to 'Spawn': type mismatch in parameter 3

I have no idea what I am doing.
You've got to define your variables (self, location, rotation) by getting them from the tank they're going to be attached to.

/edit: I accidentally posted that. I had re-written most of the stuff.
__________________

Last edited by Maj.Faux-Pas; 08-11-2006 at 03:32 PM.
Reply With Quote
  #20  
Old 08-11-2006, 03:16 PM
Moz Moz is offline
Senior Member
 
Join Date: Nov 2005
Posts: 1,773
Default

Error: E:\Program Files\Valve\Steam\SteamApps\common\red orchestra\MozP4H\Classes\MozP4HTank.uc(9) : Error, Missing ';' before 'BodySkirtClass'

also, I've stated this before but I'll state it again.

I am not a coder, I have no idea what I am doing. I don't know the first thing about C++ and Java script, I just read what something does and (unsuccessfully) try and recreate it for my means. I'm a hack and I can't figure out how to hack this damn MozP4HSkirt to attach to the body bone of MozP4HTank!!
__________________

[FONT=Trebuchet MS][FONT=Lucida Sans Unicode]RO-BlackDayJuly - RO-AprilShowers[/FONT]
[/FONT]
Reply With Quote
Reply

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 -4. The time now is 07:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC