[TUTORIAL]Five Weapons In SWBF1

Started by SleepKiller, June 16, 2012, 07:11:28 PM

Previous topic - Next topic
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.



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.



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?

June 16, 2012, 08:07:29 PM #2 Last Edit: June 16, 2012, 08:14:01 PM by jdee-barc


Celebration on hold for me until I can fix my crashing issue with it  :P
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)

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.

June 16, 2012, 08:29:07 PM #4 Last Edit: June 17, 2012, 06:53:26 AM by jdee-barc
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
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)

June 17, 2012, 04:28:33 PM #5 Last Edit: June 17, 2012, 05:54:46 PM by SleepKiller
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.

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.

It worked with me, they showed on the other slot but then again, I'm using a modded font (thats also smaller)
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)

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

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.
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

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.

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.
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

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.

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.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

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 :)
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet