SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding Tutorials => Topic started by: SleepKiller on June 16, 2012, 07:11:28 PM

Title: [TUTORIAL]Five Weapons In SWBF1
Post by: SleepKiller on June 16, 2012, 07:11:28 PM
Today marks the day we have cracked yet another limit in SWBF! We can now get five weapons instead of the old limit of four! I have tested and it seemed to crash with any more but I won't say you can't get six because after all, we now have five when the limit was thought for the past eight years to be four.

A little video showing it off before we begin the tutorial.

(https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fvideo.xfire.com%2F580d91-4.jpg&hash=781ec8db2c286a4dc7306d1998f440eaa48c3858) (http://www.xfire.com/video/580d91/)

Now the overall process is quite simple and it works much like SWBFIIs weapon system.


I will use the CIS Assault Trooper as an example and I will add a rifle to him.
First up find this section of code.

WeaponName1 = "cis_weap_inf_torpedo_launcher"
WeaponAmmo1 = 7
WeaponName2 = "cis_weap_inf_pistol"
WeaponAmmo2 = 0
WeaponName3 = "cis_weap_inf_thermaldetonator"
WeaponAmmo3 = 3
WeaponChannel3 = 1
WeaponName4 = "cis_weap_inf_mine_dispenser"
WeaponAmmo4 = 4
WeaponChannel4 = 1


No Remove the numbers from the end of each of the commands like this.

WeaponName = "cis_weap_inf_torpedo_launcher"
WeaponAmmo = 7
WeaponName = "cis_weap_inf_pistol"
WeaponAmmo = 0
WeaponName = "cis_weap_inf_thermaldetonator"
WeaponAmmo = 3
WeaponChannel = 1
WeaponName = "cis_weap_inf_mine_dispenser"
WeaponAmmo = 4
WeaponChannel = 1


Now label each of them with WEAPONSECTION         = * like this.

WEAPONSECTION = 1
WeaponName = "cis_weap_inf_torpedo_launcher"
WeaponAmmo = 7
WEAPONSECTION = 2
WeaponName = "cis_weap_inf_pistol"
WeaponAmmo = 0
WEAPONSECTION = 3
WeaponName = "cis_weap_inf_thermaldetonator"
WeaponAmmo = 3
WeaponChannel = 1
WEAPONSECTION = 4
WeaponName = "cis_weap_inf_mine_dispenser"
WeaponAmmo = 4
WeaponChannel = 1


Now I am going to insert a section for the rifle like so.
WEAPONSECTION = 1
WeaponName = "cis_weap_inf_torpedo_launcher"
WeaponAmmo = 7
WEAPONSECTION = 2
WeaponName = "cis_weap_inf_rifle"
WeaponAmmo = 5
WEAPONSECTION = 3
WeaponName = "cis_weap_inf_pistol"
WeaponAmmo = 0
WEAPONSECTION = 4
WeaponName = "cis_weap_inf_thermaldetonator"
WeaponAmmo = 3
WeaponChannel = 1
WEAPONSECTION = 5
WeaponName = "cis_weap_inf_mine_dispenser"
WeaponAmmo = 4
WeaponChannel = 1

The class now has five weapons! Now go I expect to see classes with five weapons in everyone's mods! (A little credit to me would be nice.)

Final note, this WeaponChannel   = 1 says that the weapon is a secondary one.

Enjoy and I hope this made sense to you.


Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Phobos on June 16, 2012, 07:27:44 PM
Very nice, I can think of many more weapon combinations for modded sides now. Is there a way to make the 5th weapon in the secondary weapon category instead of primary?
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: jdee-barc on June 16, 2012, 08:07:29 PM
http://www.youtube.com/watch?v=P3ALwKeSEYs

Celebration on hold for me until I can fix my crashing issue with it  :P
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: SleepKiller on June 16, 2012, 08:18:07 PM
Try copying my exact final code over to the CIS Assault droid and testing it then going form there. I swear it is working on my end just don't try and do more than 5.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: jdee-barc on June 16, 2012, 08:29:07 PM
and suddenly it...works.  :slap: I don't get how it suddenly works now.

EDIT:
Well, it seems that you can have 3 primary weapons and 2 secondary, but not the other way around. I tried giving the arc trooper 2 primary weapons (standard rockets and pistol) and 3 secondary weapons (concussions, thermals, and mines) and it crashed.

EDIT2: The ARC trooper just won't work it seems. I have no idea why.


EDIT3: I applied it to a trooper in my mod
(https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fi47.tinypic.com%2Fk0koc3.jpg&hash=0a42975761f009fbb88ea78671ca672e19f323cf)
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: SleepKiller on June 17, 2012, 04:28:33 PM
I have had 2 primary and 3 secondary. You just need to add this line to weapon section 3,

WeaponChannel   = 1
.

EDIT: Oh and keep in mind that they don't appear on the spawn screen. Unless apparently done to the first slot. So be sure to spawn as the class and test it out before deciding if it works or not.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Phobos on June 17, 2012, 06:20:41 PM
I might know a way to make the 5th weapon show up on spawn screen using font edits and/or hex editing I'll test some ideas later.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: jdee-barc on June 17, 2012, 07:06:07 PM
It worked with me, they showed on the other slot but then again, I'm using a modded font (thats also smaller)
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Phobos on June 17, 2012, 07:14:21 PM
Quote from: jdee-barc on June 17, 2012, 07:06:07 PM
It worked with me, they showed on the other slot but then again, I'm using a modded font (thats also smaller)
I saw that from your screenshots. I have made a custom font slightly larger, and it cuts off 4th weapon names. So I think perhaps just using a smaller font, or perhaps calling on gamefont_supertiny instead of gamefont_tiny would show the fifth weapon. Ifs_pc_spawnselect is the file that specifies the font for weapon names. Look for gamefont_tiny and change it to something else or modify the gamefont_tiny in core.lvl
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Sereja on June 18, 2012, 03:08:32 AM
Interesting invention! I test it, and found crash reason problem:
5th weapon must never have a Geometry. Probably, it may use for some throw/despenser weapon only.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: SleepKiller on June 18, 2012, 03:48:05 AM
Quote from: Sereja on June 18, 2012, 03:08:32 AM
Interesting invention! I test it, and found crash reason problem:
5th weapon must never have a Geometry. Probably, it may use for some throw/despenser weapon only.
I suggest you watch the video in it I have 5 weapons all with geometry.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Sereja on June 18, 2012, 04:10:34 AM
Not agree. It seems cis assault droid on your video, have mine dispenser, as 5th weapon, and as default, cis mine dispenser has no geometry (only ordance geometry). If you change it to, rebels mines, for example (it have geometry), the game is crash.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: SleepKiller on June 18, 2012, 04:31:03 AM
Okay, I tested it myself. I was wrong the 5th weapon can't have geometry. Thanks for pointing it out Sereja. So this means you can only use it for a grenade, mine, dispenser or something else of that nature. The other four could be normal primary weapons guns if desired still I think.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Dark_Phantom on June 25, 2012, 01:04:06 PM
Yes, the other 4 can be primary, I've been testing them. It's just that great 5th weapon can't have geometry (as already stated).
Why WEAPONSECTION though, I'm wondering?  I've tried using the WeaponName5 (etc) and it didn't do it.  Any explanation for it?
Is a 6th weapon like overload or something?  I tried with the same (imperial mines) as my 5th weapon, and crashed still.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Led on June 25, 2012, 03:23:27 PM
SK was saying something like it was like it was done for the recon droid, when can be classified (I think) as a vehicle.  So maybe 5 is the limit for vehicles.  Not sure though...just another SWBF mystery :)
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Sereja on June 25, 2012, 03:49:00 PM
Interesting, if that may work for vehicles?
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Kit Fisto on September 29, 2012, 07:58:10 AM
I think this crashes multiplayer. I mean that a mod or map that has a character with 5 weapons will crash multiplayer.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Phobos on September 29, 2012, 10:07:18 AM
Quote from: Kit Fisto on September 29, 2012, 07:58:10 AM
I think this crashes multiplayer. I mean that a mod or map that has a character with 5 weapons will crash multiplayer.
I dont think it will if everyone else has the mod but I have not yet confirmed this. Hopefully it doesnt because all the aliens for alien wars era are supposed to have five weapons
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Kit Fisto on September 29, 2012, 11:28:03 AM
I say this because all of Sereja's maps crash, and the mod he made for me a while back, the IMP's had 5 weapons and GCW crashed.
I don't know how to test except by making a side mod with everyone having 5 weapons and testing it with somebody.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Led on September 29, 2012, 12:19:15 PM
Sleepkiller tested this in MP and it works.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Kit Fisto on September 29, 2012, 12:20:37 PM
Ok. I just thought that maybe it didn't because certain mods with it don't work.  :slap:
Well now we know!  :cheers:
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: Led on September 29, 2012, 12:23:50 PM
5th weapon can not have collision geometry, as pointed out by Sereja.  Mines are in common.lvl, I believe.  So, if rebels mine have collision, then you need to change the common to a modded common as well as the sides.
Title: Re: [TUTORIAL]Five Weapons In SWBF1
Post by: jdee-barc on September 29, 2012, 01:11:16 PM
It's just that the fifth weapon cannot have a geometry in the weapon odf.

so for the recon droid, go to "*sidename*_weap_inf_remotedroid" and remove the "geometryname" and "highresgeometry lines. It works for me.
EhPortal 1.34 © 2024, WebDev