News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 1st Jan 2005, 01:25 PM   #1
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
Spawning Projectile Onto Weapon

Is there a way to spawn a projectile and hold it in/on the weapon before the FireClass is activated, and when the Fire is animated either have that projectile shoot or have it disappear? I'm making a crossbow with an open top and if there's no arrow there I think it'll be a little suspicious .
__________________
If everyone is taught to be an individual, aren't you just being normal?
Lulolwen is offline   Reply With Quote
Old 3rd Jan 2005, 06:43 AM   #2
porkmanii
Registered User
 
Join Date: Sep. 9th, 2004
Location: Australia, Qld
Posts: 129
Doesn't the ChaosUT2 Crossbow have an arrow on the model?

In Unreal (1), the muzzle flashes (for the Stinger, at least) were done by making them a part of the model (but out of sight inside the gun). Whenever the gun was fired, the muzzle flashes were moved into sight (and into position), as part of the firing animation.

The UT2003 Translocator's beacon wasn't part of the weapon model. Instead, it was a seperate Actor (that looked like a Translocator beacon), which was spawned and attached to the Translocator whenever the beacon was recalled, and destroyed whenever the beacon was placed/fired out of the gun.

There's definitely a way to make the arrow visible before it is fired, but it would probably be best if the arrow was represented by a seperate Actor (or part of the model), rather than a projectile (up until it is fired, at which time the arrow on the model is hidden and a projectile is spawned).

Last edited by porkmanii; 3rd Jan 2005 at 06:46 AM.
porkmanii is offline   Reply With Quote
Old 3rd Jan 2005, 06:42 PM   #3
Ghost3021
Registered Hobbit
 
Ghost3021's Avatar
 
Join Date: Nov. 21st, 2004
Location: Behind you.
Posts: 586
i agree with porkmanii in fact i had to attach a emmiter to my weapon model for looks and stuff...i attached it to a special bone i made in 3ds..
__________________

Add real-time lights to your maps.<RealTimeLights>
A checkpoint system for those larger maps.<CheckPoints>
An ASMD that can shock stuff underwater.<ASMD-Reduxed>
Ghost3021 is offline   Reply With Quote
Old 3rd Jan 2005, 07:54 PM   #4
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
pork - Looked at the CUT2 Crossbow, they cheaped out & hid the arrows in a crease of the bow (no disrespect meant to Chaotic Dreams.)

SoH_Ghost - What kind of emitter did you use, and if it was custom, could you please post the code?

Also, could use some help distinguishing the code in the Translocator that spawns the fake beacon from the rest.
__________________
If everyone is taught to be an individual, aren't you just being normal?

Last edited by Lulolwen; 3rd Jan 2005 at 07:59 PM.
Lulolwen is offline   Reply With Quote
Old 3rd Jan 2005, 08:20 PM   #5
Ghost3021
Registered Hobbit
 
Ghost3021's Avatar
 
Join Date: Nov. 21st, 2004
Location: Behind you.
Posts: 586
actualy, the code could be modified(with only slight tweaks) to work with Object...code...here it is!
Code:
var emitter effect;
var sparkgun p;
function prebeginplay()
{
If effect==none

effect = Spawn(class'customsparx', p,, P.Location, P.Rotation);
p.AttachToBone(effect, 'sparxbone');
}
i think thats it...might have some bugs. after finaly finding it, i memorized it but rathor poorly. there will be bugs....if not lemme know ued is down right now(what to feed it now...my little bro or cat?)
__________________

Add real-time lights to your maps.<RealTimeLights>
A checkpoint system for those larger maps.<CheckPoints>
An ASMD that can shock stuff underwater.<ASMD-Reduxed>

Last edited by SoH_Ghost3021; 3rd Jan 2005 at 08:24 PM.
Ghost3021 is offline   Reply With Quote
Old 3rd Jan 2005, 08:45 PM   #6
[SAS]Solid Snake
Registered User
 
[SAS]Solid Snake's Avatar
 
Join Date: Jun. 7th, 2002
Location: New Zealand
Posts: 2,633
That method is okay, but a much better method is to have the model meshes as a rigid skeletal mesh. When the weapon is fired, the bone is scaled down to 0.0, which also shrinks the polygons attached to that particular bone (much how xPawn dismembers). No need to spawn anything in with this method.
__________________
I make the impossible possible ... ... ... to some extent.

Digital Confectioners
[SAS]Solid Snake is offline   Reply With Quote
Old 3rd Jan 2005, 09:08 PM   #7
porkmanii
Registered User
 
Join Date: Sep. 9th, 2004
Location: Australia, Qld
Posts: 129
Quote:
Originally Posted by Lulolwen
Also, could use some help distinguishing the code in the Translocator that spawns the fake beacon from the rest.
I can't find it. I guess I must have been mistaken.

Whatever the case, I spawned and attached a fake beacon to the first-person model of my UT2003-style Translocator, just because I thought it'd look better . Whenever the beacon is fired the "dummy beacon" is hidden, and when the beacon is recalled the "dummy beacon" is shown again.

Solid Snake's method is probably better, but in my case it was not possible because I was not using a custom mesh.
porkmanii is offline   Reply With Quote
Old 4th Jan 2005, 04:33 PM   #8
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
Snake - Tried the scale technique, but it didn't work. Any other ideas?
__________________
If everyone is taught to be an individual, aren't you just being normal?
Lulolwen is offline   Reply With Quote
Old 4th Jan 2005, 11:00 PM   #9
Ghost3021
Registered Hobbit
 
Ghost3021's Avatar
 
Join Date: Nov. 21st, 2004
Location: Behind you.
Posts: 586
*ahem* try my idea? it might work?!no?
heck it worked for me just extend StaticMeshActor and change under display in default properties u default mesh ect just try my way plz
__________________

Add real-time lights to your maps.<RealTimeLights>
A checkpoint system for those larger maps.<CheckPoints>
An ASMD that can shock stuff underwater.<ASMD-Reduxed>
Ghost3021 is offline   Reply With Quote
Old 5th Jan 2005, 03:28 PM   #10
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
How would I attach the StaticMeshActor to a bone? Something like...
Code:
Spawn(class'WeaponSMActor');
AttachToBone(WeaponSMActor, 'bone');
Also, could I just set something in the spawning function like... to keep the rotation of the character/gun?
Code:
WeaponSMActor.Rotation=P.Rotation
__________________
If everyone is taught to be an individual, aren't you just being normal?

Last edited by Lulolwen; 5th Jan 2005 at 04:05 PM.
Lulolwen is offline   Reply With Quote
Old 5th Jan 2005, 06:27 PM   #11
Ghost3021
Registered Hobbit
 
Ghost3021's Avatar
 
Join Date: Nov. 21st, 2004
Location: Behind you.
Posts: 586
no, to keep teh rotation of attached actor. oh, just change some of the obove to match your actor's name. and yes, u got it right...i think. u need teh rotation code.
__________________

Add real-time lights to your maps.<RealTimeLights>
A checkpoint system for those larger maps.<CheckPoints>
An ASMD that can shock stuff underwater.<ASMD-Reduxed>
Ghost3021 is offline   Reply With Quote
Old 5th Jan 2005, 08:23 PM   #12
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
Having an issue with my spawn code...

Code:
simulated function EarlyProjSpawn(Pawn P)
{
    if ( MyWeaponFire.bIsFiring != False )
        Tick;
        // Included the tick because I want a delay until the reload part of the
        // firing anim kicks in, any other ways?
        Spawn(class'StaticMeshActor');
        StaticMeshActor.StaticMesh='MyWeaponSM.MyGroup.MyMesh';
        AttachToBone(StaticMeshActor, 'spawn');
        StaticMeshActor.Rotation=P.Rotation
}
Should this be a function or simulated function? I thought it should be simulated because it happens in realtime, but maybe I was mistaken. My compiler says there's a "Bad or missing expression in If" right at the top.
__________________
If everyone is taught to be an individual, aren't you just being normal?
Lulolwen is offline   Reply With Quote
Old 6th Jan 2005, 12:58 PM   #13
Ghost3021
Registered Hobbit
 
Ghost3021's Avatar
 
Join Date: Nov. 21st, 2004
Location: Behind you.
Posts: 586
im not sure realy what teh difference between a function and simutlated function is...i just do regular function and it works fine. leme think on this....
__________________

Add real-time lights to your maps.<RealTimeLights>
A checkpoint system for those larger maps.<CheckPoints>
An ASMD that can shock stuff underwater.<ASMD-Reduxed>
Ghost3021 is offline   Reply With Quote
Old 6th Jan 2005, 10:20 PM   #14
Fragorl
Registered User
 
Join Date: Dec. 24th, 2004
Location: New Zealand
Posts: 17
Quote:
Originally Posted by Lulolwen
Should this be a function or simulated function? I thought it should be simulated because it happens in realtime, but maybe I was mistaken. My compiler says there's a "Bad or missing expression in If" right at the top.
Try "if (MyWeaponFire.bIsFiring)" ?

Last edited by Fragorl; 6th Jan 2005 at 10:23 PM.
Fragorl is offline   Reply With Quote
Old 7th Jan 2005, 11:20 PM   #15
Lulolwen
The One And Only
 
Lulolwen's Avatar
 
Join Date: Sep. 11th, 2004
Posts: 10
Tried several different ways of phrasing. There is a bIsFiring, isn't there? I thought there was.

Also, what is the function to have an idle time? Tick isn't working, maybe PlayIdleAnim or something similar?
__________________
If everyone is taught to be an individual, aren't you just being normal?

Last edited by Lulolwen; 7th Jan 2005 at 11:22 PM.
Lulolwen is offline   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 -5. The time now is 06:55 PM.


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

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