Main

Forums

Wiki

Downloads

Tutorials

Walkthrough

Unreal-netiquette

Links

Submit-News

Oldunreal's hosted:
UnrealReference

Usermaps

Real-CTF

Donate for Oldunreal:

Oldunreal Donation
Oldunreallogo
  Welcome, Guest. Please Login or Register
 
  HomeHelpSearchLoginRegister  
 
 
Pages: 1 2 
Changing mesh when fired (Read 1244 times)
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Changing mesh when fired
07/18/12 at 15:16:54
 
Hehe, time to start whining again.
So I'm new to modeling and I have an RPG that fires off its rocket. Now I made 2 models for that because if I save the no-rocket one as an animation of the rocket one, such as 'Select2', it get's all scrambled up.
anyway, the plan is to change the weapon's mesh when it fires from the one with the rocket to the one without. It does that just fine... in 226. 227 doesn't change the mesh :S
Code:
function PlayFiring()
{
	Owner.PlaySound(FireSound, SLOT_None,2.0*Pawn(Owner).SoundDampening);
	Mesh=Mesh'RisingModels.RPG3rd2';
	PlayerViewMesh=Mesh'RisingModels.RPG3rd2';
	ThirdPersonMesh=Mesh'RisingModels.RPG3rd2';
	PlayAnim('Fire',0.8);
} 


So any tips on this one? Tongue
Back to top
« Last Edit: 07/18/12 at 15:17:08 by Bleeder91[NL] »  
WWW WWW Bleeder91[NL]  
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
******
Offline


The Great Emerald

Posts: 5234
Vilnius, Lithuania
Gender: male
Re: Changing mesh when fired
Reply #1 - 07/18/12 at 17:13:46
 
The log should have something about it. From what I can see, it could be that it doesn't understand what kind of a mesh it is, or just setting a mesh like that may not be the intended way of doing it.
Back to top
 

... - Unreal II Combat Assault Rifle
My own website (GreatEmerald's Domain)!
...
WWW WWW  
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #2 - 07/18/12 at 17:24:18
 
Well that's the weird part. It doesn't say that it can't find anim 'Fire' (mesh 1 doesn't have Fire anim, mesh 2 does). So it does change the mesh, but visibly nothing changes.
Back to top
« Last Edit: 07/18/12 at 17:24:39 by Bleeder91[NL] »  
WWW WWW Bleeder91[NL]  
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
******
Offline


The Great Emerald

Posts: 5234
Vilnius, Lithuania
Gender: male
Re: Changing mesh when fired
Reply #3 - 07/18/12 at 21:36:43
 
Hmm... What about the texture? And perhaps you should test this with another mesh to make sure.
Back to top
 

... - Unreal II Combat Assault Rifle
My own website (GreatEmerald's Domain)!
...
WWW WWW  
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #4 - 07/18/12 at 22:35:07
 

First part 226f, second part 227h.
And switching to a masked texture is out of the question too for now, since I have no idea how to UV wrap crap.
Back to top
« Last Edit: 07/18/12 at 22:38:38 by Bleeder91[NL] »  
WWW WWW Bleeder91[NL]  
IP Logged
 
gopostal
Junior Member
**
Offline


Oldunreal member

Posts: 85
Gender: male
Re: Changing mesh when fired
Reply #5 - 07/19/12 at 02:45:33
 
I admittedly know very little about Unreal coding but I'm fairly OK in UT stuff. At first blush it looks like you need to declare the projectile as a var and then set the mesh on the var. Something like z.mesh=whatever. Projectile replication is a funny thing, it only sends the mesh once (at spawn) so updates to it may not correct themselves without adjusting it as a declared variable change/update (which then would replicate).
Back to top
 
 
IP Logged
 
[UDHQ] Pcube
Ex Member


Re: Changing mesh when fired
Reply #6 - 07/19/12 at 06:41:32
 
First intuition would be whether this has something to do with replication as gopostal stated. I know for a fact that mesh changes are replicated from server->client (i.e. mesh is not bNetInitial) because I've set the mesh of various actors in-game hundreds of times online (on all versions). Is this behavior happening both offline and online?

Since it works in 226f this hints towards a redefinition of  the replication statement. Here's what I dug up from 225f vs 227h...

225f:
Code:
	unreliable if( Role==ROLE_Authority && DrawType==DT_Mesh )
		Mesh, bMeshEnviroMap, bMeshCurvy, Skin, MultiSkins;
 



227h:
Code:
	unreliable if ( Role==ROLE_Authority && DrawType==DT_Mesh )
		Mesh, bMeshEnviroMap, bMeshCurvy, Skin, MultiSkins;
 



They match, so scratch that it's unlikely to be replication of mesh.

When you say that 227 doesn't correctly change the mesh, do you mean the server or client? Guessing you mean that it doesn't render the change in mesh on the 227 client, but works on the 226f client (regardless of whether the server is 226f or 227). This would hint to me that something in DrawActor has changed and I've heard rumors over the years about DrawActor being different in 226f than other versions...

edit: maybe DrawActor is rendering other.default.mesh instead of other.mesh? good way to check this is to client-side
bullshit
it and set the actor's default mesh = mesh every frame.

edit2: Heh, nice idea Pcube!


more edits: just saw the "f" on 226. fixing babble. also 226f is colloquially known as "226crappity smacked" because it has a lot of inconsistencies with the other versions... since 227 was based on gold's source, I wonder if this bug shows up on stock gold as well as 227?
Back to top
« Last Edit: 07/19/12 at 06:52:14 by N/A »  
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #7 - 07/19/12 at 10:49:13
 
Both in SinglePlayer. Dunno about DrawActor changes. Projectile is unrelated. OGL ain't it either.
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2910
Gender: male
Re: Changing mesh when fired
Reply #8 - 07/19/12 at 19:33:09
 
Oh crap, The forsaken version.. 226fucked?

Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Hmm...
Back to top
« Last Edit: 07/19/12 at 19:43:31 by GenericHero »  
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #9 - 07/19/12 at 19:47:56
 
Oh yeah? At least this (and some more things such as editor shortcuts) work in 226f...
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
.:..:
Developer Team
Offline



Posts: 1245
Finland
Gender: male
Re: Changing mesh when fired
Reply #10 - 07/19/12 at 20:08:45
 
Since that stuff was bound to fail in multiplayer anyway I didn't bother about making third person actor sync up mesh with the variable, but anyway to fix this:
Code:
function PlayFiring()
{
	Owner.PlaySound(FireSound, SLOT_None,2.0*Pawn(Owner).SoundDampening);
	Mesh=Mesh'RisingModels.RPG3rd2';
	PlayerViewMesh=Mesh'RisingModels.RPG3rd2';
	ThirdPersonMesh=Mesh'RisingModels.RPG3rd2';
	if( Attachment!=None )
		Attachment.Mesh = ThirdPersonMesh;
	PlayAnim('Fire',0.8);
} 


The way pre-227 draws third person actor is to temporarily swap mesh, change draw coords, draw mesh, reset to old state (this will horribly mess up some vertices caching on the mesh due drawing 2 different meshes in same time on one actor).
Back to top
« Last Edit: 07/19/12 at 20:10:54 by .:..: »  
.:..: 345236034 mhulden  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2910
Gender: male
Re: Changing mesh when fired
Reply #11 - 07/19/12 at 20:17:34
 
Bleeder91[NL] wrote on 07/19/12 at 19:47:56:
At least this (and some more things such as editor shortcuts) work in 226f...

It's not like UED2 was rebuilt from the ground up in C++ and therefore basically has nothing in common with UED1 since it's in VB.

The shortcuts do actually work but you have to select a viewport. Sweeney Logic.

UED2 doesn't crash when you blink, either
Back to top
 
 
IP Logged
 
.:..:
Developer Team
Offline



Posts: 1245
Finland
Gender: male
Re: Changing mesh when fired
Reply #12 - 07/19/12 at 20:22:42
 
Bleeder91[NL] wrote on 07/19/12 at 19:47:56:
Oh yeah? At least this (and some more things such as editor shortcuts) work in 226f...

At least 227 has working special effects for things like RingExplosions and uses up a lot less CPU cycles to run client and server.
At least it's possible to add custom tools for UnrealEd 2 aswell.
At least UnrealEd 2.1 has more path building options.
At least AI is better on navigating in 227.
Back to top
« Last Edit: 07/19/12 at 20:24:02 by .:..: »  
.:..: 345236034 mhulden  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2910
Gender: male
Re: Changing mesh when fired
Reply #13 - 07/19/12 at 20:36:45
 
The best way to do this is probably through an animation. You could just set the frame to a second frame that doesn't have the rocket in it anymore. This way a minimal amount of replication is done, and it will definitely get received by clients. For some reason or another, ThirdPersonMesh is unreliable.
Back to top
 
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #14 - 07/19/12 at 20:45:39
 
GenericHero wrote on 07/19/12 at 20:36:45:
The best way to do this is probably through an animation. You could just set the frame to a second frame that doesn't have the rocket in it anymore. This way a minimal amount of replication is done, and it will definitely get received by clients. For some reason or another, ThirdPersonMesh is unreliable.

Yeah, but that leads to problem nr. 1:
I made 2 meshes because if I save the no-rocket one as an animation of the rocket one, such as 'Select2', it get's all scrambled up. And by scrambled up I mean that it get's cut all over the place stretching across the whole screen.
Back to top
« Last Edit: 07/19/12 at 20:47:03 by Bleeder91[NL] »  
WWW WWW Bleeder91[NL]  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2910
Gender: male
Re: Changing mesh when fired
Reply #15 - 07/19/12 at 21:25:34
 
I'm not really much of an animator; but isn't it as easy as creating keyframe 2 where the rocket is inside the rocket launcher? I've animated one thing once with 2 still frames using MilkShape and skeletal meshes..

What animation program are you using? I could try testing it out and see if I can figure out the exact method
Back to top
 
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #16 - 07/19/12 at 22:50:09
 
3ds max and blender, the way i tried was removing the vertices alltogether cuz i couldnt find a way to scale them. I'm really new at this, I've just learned the basics of importing and exporting existing meshes and animating them at a rotate/move scale. Nothing complex yet Sad
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
GenericHero
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2910
Gender: male
Re: Changing mesh when fired
Reply #17 - 07/20/12 at 00:59:41
 
Deleting them is a bad idea. Unreal will not like that.

Try moving them >inside< the cylinder or shrinking it so tiny it's really hard to see. Look at the headshot animations for Skaarj and Brutes and you'll see their head just shrinks to a very small size.
Back to top
 
 
IP Logged
 
gopostal
Junior Member
**
Offline


Oldunreal member

Posts: 85
Gender: male
Re: Changing mesh when fired
Reply #18 - 07/20/12 at 01:06:38
 
Won't you run into collision issues? It won't spawn if it's touching. Maybe I'm not really seeing what you guys are trying to do here.
Back to top
 
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 784
Location, Location, Location.
Gender: male
Re: Changing mesh when fired
Reply #19 - 07/20/12 at 12:35:41
 
It's not a projectile issue, it's a mesh issue, probably should move this topic to unrealed now since it's no script problem anymore...
So I just scaled down the rocket and put it in the middle of the tube, but it still messes up the mesh, dunno what the hell I'm doing wrong. I think it might be 3ds max's ProOptimizer that I use, since the mesh has 4k vertices :S I scaled it down to 50% but because the mesh is different it might remove some vertices that are in the mesh with the big rocket. I dunno, I uploaded the meshes if you want to have a look:
http://www.2shared.com/file/M2pZ5mno/RPG.html
Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
Pages: 1 2 
(Moderators: Smirftsch, TCP_Wolf, Smartball, pÍtßűll, DieHard SCWS)