Jump to content

How do I change or add unit's weapon?


  • Please log in to reply
15 replies to this topic

#1 ImperialGuard

ImperialGuard

    Initiate

  • Members
  • 2 posts
  • Gamertag:no

Posted 06 June 2009 - 12:41 PM

Hi, I'm trying to make Maverick Jet as a Military's main anti-air weaponry.

I tried to look at Maverick Jet's XMLs and compared it with that of Apaches and Dervish Jets but I don't know why Maverick Jet cannot fire it's weapon.

I also tried to change the weapon of Maverick to that of Rocket-launhcer squad or apache's, but actually I don't know how to do it.

In short, I'm trying to add some weapon (or change the original weapon) of Maverick jet.

Any help would be appreciated.

btw, sorry for my english. My first language isn't english and I'm learning it.

Edited by ImperialGuard, 06 June 2009 - 12:41 PM.


#2 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 06 June 2009 - 12:51 PM

All units have <BehaviorType Name="WeaponBehaviorType"> which is where all the data for weapons is defined.

However, you can't just simply add in a <BehaviorType Name="WeaponBehaviorType"> entry. All behaviours need to berecognised first in the unit/structure's landbehaviour. If you look at the maveric's landbehaviour, it reads:

<LandBehavior>
STUNNABLE,
GUI,
RADAR_MAP_VISIBLE,
VTOL_LOCOMOTOR,
FORMATION,
IDLE,
REVEAL,
HIDE_WHEN_FOGGED,
UNIT_AI,
DAMAGE_TRACKING,
TARGETING,
AIR_RAID,
ABILITY_COUNTDOWN,
EFFECT_REGISTRY,
ATTRIBUTE_DIRECTORY,
AI_RECRUITABLE,
AI_TARGET
</LandBehavior>


as you can see it doesn't have WEAPON inside. Add in WEAPON (remember a comma in between 2 elements). and you should be able to get the unit to recognise the code in the <BehaviorType Name="WeaponBehaviorType"> entry.

Posted Image


#3 Strategist

Strategist

    Defiler! Fetch!

  • Global Moderator
  • 3,405 posts
  • Gamertag:Strat N8
  • Fav. Game:
  • Gender:Male
  • Location:Habitat Walker #887

Posted 06 June 2009 - 12:56 PM

Alternatively, you can create a "Generic_Attack_Ability" entry like the Mass Driver hardpoint of the Assembly Walker, though this will only release one projectile per volley (good for secondary rockets).

I'll have a look in the file as well.

Edited by Stratigest, 06 June 2009 - 01:01 PM.

Posted Image

#4 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 06 June 2009 - 01:03 PM

Attack abilities are more specialised for certain situations, especially situations where unit animations come into play, or non-discrete projectiles like beam weapons are used.

Every beam weapon in UAW (except the beams of the science walker, Beam Cannon, Corruptor and Defiler) is an attack ability with the enemy simply taking damage while a beam appears between weapon and target. Melee attacks are also done via attack abilities.

Some secondary attacks also use attack abilities. Best example would be the Grunt, who in addition to main weapon, has knockback (for infantry) and plasma grenades (for vehicles and buildings). The latter 2 are not covered under weapon behaviour but rather, they are attack abilities.

Edited by Valdez, 06 June 2009 - 01:06 PM.

Posted Image


#5 Strategist

Strategist

    Defiler! Fetch!

  • Global Moderator
  • 3,405 posts
  • Gamertag:Strat N8
  • Fav. Game:
  • Gender:Male
  • Location:Habitat Walker #887

Posted 09 June 2009 - 06:46 PM

So, did you have any luck? :hope:
Posted Image

#6 ImperialGuard

ImperialGuard

    Initiate

  • Members
  • 2 posts
  • Gamertag:no

Posted 14 June 2009 - 04:27 AM

Sorry for not posting any results.

I was, and I am somewhat busy due to finals.

These are my results :

Attached File  K_35.png   276.56K   33 downloads
Attached File  K_40.png   216.32K   31 downloads

It was more facinating than I expected. I just gave them the rocket launcher projectile, fire about 8 missiles when they fire. They have no problem taking out enemy aircraft. Think little bit overpowered, but I can work on it later.

Thanks again for your help.

#7 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 14 June 2009 - 04:55 AM

The ability to down enemy aircraft easily is likely due to the amount of missiles as well as the damage per projectile. Besides it's quite unrealistic for an air superiority fighter to unload 8 missiles at one go anyway.

Posted Image


#8 Strategist

Strategist

    Defiler! Fetch!

  • Global Moderator
  • 3,405 posts
  • Gamertag:Strat N8
  • Fav. Game:
  • Gender:Male
  • Location:Habitat Walker #887

Posted 14 June 2009 - 11:01 AM

If you only want the aircraft to target only aerial units, you could change the unit's targeting priority to the same as the Arc Turret (meaning it will only be able to attack air units).

For the missiles, it's likely overpowered as most military armor versus damage types are set to 1.0 for all targets. (Most units only have a bonus against one target and a weakness against another, rather than being good against everything.)


To fix the missile problem, you could try using the Generic Attack ability for the missile attack (You'll need Mike.nl's model viewer to find a good bone to spawn the missile from. After you have it, just make sure it will only activate against "Flying") and use bullet projectiles for the main gun.

Edited by Stratigest, 14 June 2009 - 11:02 AM.

Posted Image

#9 CanadaMan7

CanadaMan7

    Acolyte

  • Members
  • Pip
  • 61 posts
  • Gamertag:Canadaman7
  • Gender:Male
  • Location:Charleston, South Carolina

Posted 07 February 2010 - 01:47 PM

Hey guys,

So I did this as well, successfully. However, it has some sort of looping helicopter firing sound that is really annoying. Does anyone know how to fix this?

#10 Purified

Purified

    Petrotopian

  • Members
  • PipPipPipPip
  • 585 posts
  • Gamertag:Purified100
  • Gender:Male

Posted 07 February 2010 - 08:45 PM

You'll have to look up the code-line that loops/plays the sound and disable it (or replace it with something else available)
GameFront page with various things I have released, where I have mods and map packs available! Click here!
Current uploads: Hierarchy's New Walkers mod, Hierarchy Mini Walkers mod, Modified Units mod, Map Pack 1 (4x maps), Map Pack 2 (3x maps), Map Pack 3 (5x maps), Bizarrio World, Map Pack 4 (4x maps), Global Territories Mod

#11 CanadaMan7

CanadaMan7

    Acolyte

  • Members
  • Pip
  • 61 posts
  • Gamertag:Canadaman7
  • Gender:Male
  • Location:Charleston, South Carolina

Posted 07 February 2010 - 10:03 PM

Well, I looked in the maverick jet.xml and didn't really see anything about it in there. Would it be somewhere else or am I missing something?

Edited by CanadaMan7, 07 February 2010 - 10:04 PM.


#12 Valdez

Valdez

    (・ ω ・)

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,633 posts
  • Gamertag:GFWL Valdez
  • Fav. Game:
  • Gender:Male
  • Location:Singapore

Posted 07 February 2010 - 11:04 PM

Look under the projectile entry of the weapon your unit is using. If the weapon belongs to some other unit, look inside that unit's xml

Posted Image


#13 CanadaMan7

CanadaMan7

    Acolyte

  • Members
  • Pip
  • 61 posts
  • Gamertag:Canadaman7
  • Gender:Male
  • Location:Charleston, South Carolina

Posted 08 February 2010 - 07:30 PM

View PostValdez, on 07 February 2010 - 11:04 PM, said:

Look under the projectile entry of the weapon your unit is using. If the weapon belongs to some other unit, look inside that unit's xml

Based on the sound its making (the Apache machine gun sound) I'd guess that it would be
<Projectile Name="Proj_Military_Railgun">. However, I'm not seeing the Weapon firing sound effect like  <SFXEvent_Weapon_Firing_Loop> SFX_Military_Dragonfly_Fire </SFXEvent_Weapon_Firing_Loop> that I found in the Apache.

The maverick is devoid of an audio section though, so would that have anything to do with it?

#14 SpardaSon21

SpardaSon21

    Follower

  • Members
  • PipPip
  • 129 posts
  • Gender:Male
  • Location:Orange County, Southern California

Posted 16 September 2010 - 06:19 PM

The attack run sound is around line 230 in its XML file, "<SFXEvent_Fire>", and it uses the Apache SFX for that.  Consider that fixed, if I can find a suitable replacement.

Edited by SpardaSon21, 16 September 2010 - 06:20 PM.


#15 Strategist

Strategist

    Defiler! Fetch!

  • Global Moderator
  • 3,405 posts
  • Gamertag:Strat N8
  • Fav. Game:
  • Gender:Male
  • Location:Habitat Walker #887

Posted 17 September 2010 - 12:01 AM

I believe there was a generic missile launched sound effect in Weapon_SFX.xml that could serve for now. You can also modify the pitch to help adjust some of the more alien sound effects to work for humans (check Alien_SFX.xml or Engine_SFX.xml for the exact code to modifiy pitch).


Posted Image

#16 SpardaSon21

SpardaSon21

    Follower

  • Members
  • PipPip
  • 129 posts
  • Gender:Male
  • Location:Orange County, Southern California

Posted 17 September 2010 - 02:12 PM

Thanks, I found it, and changed the Maverick.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users