• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Silly newbie modding question(s)

ToiletDuckie

Grizzled Veteran
Aug 22, 2006
59
0
I've got some free time on my hands, and a mild interest in tinkering with RO, so I decided to try a simple modification or two. More specifically, I wanted to see if I could make a 'new' weapon. Now, what I really mean is that I modified an MP40 to behave... differently.. but instead of overwriting all of the MP40~.uc files I made my own.

So now, I supposedly have a gun that looks like a MP40, sounds like a MP40, etc. but is mildly different... at least in the .uc files. It uses all pre-existing animations/models/etc. All that has been changed are a few variables (example: I changed the rate of fire from .12 or so to .3, somewhere in the ~200 rounds per minute zone).

However, I've hit my first major "Why are you trying to do something you have no idea about?" problem: How do I make the transition from altered gun code to a usable weapon? Or rather, how do I add this new "improved" Mp40 into a map/game/whatever? Note: I don't want it to replace the normal MP40 game files wise, but instead be considered a new gun.

My current train of thought, however flawed it may be, after looking at a tutorial or two is that I somehow need to recompile RoInventory (or, perhaps, make my own version of it and compile that one). Then, I need to load up some preexisting map (to save myself time, of course) and somehow edit it so that, say, the Assault class for the germans uses my modified mp40 and not the normal one. Of course, I have no idea how to do any of this.

Furthermore, I'm not sure what to call any of this. Could this special MP40 be added to a map that could be downloaded by anyone? Or would adding a new weapon like this require a "modlike" copying of files into different locations?

I'm a bit lost, so any help at all would be appreciated.
 
Last edited:
Well, yea, I had a close call at first though. I copied the original mp40 files so I could tinker with the copy, then accidentally edited the "real" one. Luckily, since the copy hadn't been touched, I could reset it to normal settings.

But yea, anywho.. still not sure how to put my happyfun gun onto a map, single or multi or anything. I'd really like to see this thing shoot... heh.

(or melee someone from 30 feet, but that's another story entirely)
 
Upvote 0
Assuming you've compiled your class and you have a *pickup class, you can test it in game by summoning it:

summon whateverpackage.whateverweaponpickup

for instance, you could do: summon roinventory.mg34pickup
and it would spawn a pickup-able mg34 in front of you.

To add it into maps once you are done testing it, you would edit one of the RoleInfo's (ie: the ROGEGunnerH actor in a level), to set a primary or secondary weapon to your new *weapon class.
 
Upvote 0
FINAL EDIT: Sorry for all the edits, minor intoxication + confusion = lots of problems. However, I have now successfully summoned my weapon! YAY! I forgot to have MP40Weapon(silly).uc in my ROinventoryTD directory, so it was "Defaulting" to the standard MP40.

So, now I have a MP40 that fires PTRD shells at 200RPM with half as much recoil as normal and has a meelee butt smack that extends 10 times farther than normal, that if you miss makes a grenade explosion sound. YES.

Thanks for the tip of sorts with the summon thing. Now I just need to keep tinkering and victory will be mine! Next project: getting the radio on FullMJ to switch music tracks "stations" if you use it.. well that can wait until I get this MP40 launching panzerfausts or something.. heh.

PS: Don't worry, I won't continue adding such crazy things into the game.. I don't think. I'm just in that young experimentation phase ;)

Edit part "you said you wouldn't edit anymore!?": Now all I need to figure out is how to make the pickup spawn with ammo... and how to make the melee attack much more lethal + gibbing when it hits. Yes, I know, not realistic, but this is just tinkering after all..

Side note: Have you ever seen an MP40 take out a T34 from across the bridge at Barashka while firing at a nice, slow, flaklike THUNK THUNK THUNK speed? If not, I suggest trying it. It's... amusing.
 
Last edited:
Upvote 0
Hrmm....

So, I'm still goofing around with the weapons code, trying to do things that don't seem physically possible. At the behest of others, I am/was attempting to make a Kar98 fire 120mm IS2 shells. It should have been a relatively simple process, in my mind, since I wasn't changing anything about the K98, only what projectile is spawned/"fired".

However, attempting make it fire a tank shell gives a compile time error, something to the effect of "Engine.WeaponFire.ProjectileClass: unresolved reference to 'class' 'IS2CannonShellHE'.

This mildly confuses me. On one hand, the MP40 I made was able to refer to PTRD bullets with no troubles at all, despite the .uc files for them being in ROInventory and not my little folder. On the other hand, I can't seem to refer to the tank shells which reside in ROVehicles ?? I just tried it with PantherShell as well, still no dice.

I'm assuming this has something to do with PTRD/Other infantry weapons being subclasses of ROBullet while tank shells are subclasses of ROAntiVehicleProjectile.. but still, a projectile is a projectile isn't it?


Meanwhile, I've managed to get DP28/MG42 to fire PTRD shells, MG42/K98 to fire panzerfausts. One odd thing I've noticed, though: K98 fausts fly... excessively far at high speeds, while MG42 fausts are much closer to the original. I'm not quite sure how this is happening, though. The speed of the projectile/etc. is stored in the projectile itself, right? So, aside from the angle its fired at, shouldn't all guns "fire" panzerfausts at the same speed to the same distance?

Edit: Here's a slightly less silly question: Is there a way to make a weapon pickup spawn with ammo? Or, perhaps, is there a way to spawn ammo? As it stands, to test a new gun I must spawn as a guy with the "base" gun, drop my ammo, pickup my modded gun, and load it. It'd be nice if it came loaded, for brevity's sake.

Also, another serious-ish question: How do you alter melee damage? I'm assuming it's the KDamageImpulse setting in __BashDamType.. but I'm not sure. There's also a gib modifier there.. I assume 0 means doesn't and 1 means does? Guess I should just test it.

Nevermind the "Tank gun speed question". Figured out it was tied to the reload sound effects.. bleh.
 
Last edited:
Upvote 0
Heh, most of what I'm doing is silliness for now simply because I'm working with what little I know. It's much easier to make a MP40 fire PTRD shells than it is to, say, model/texture/animate/code in a FG42. With the MP40, everything (including 95% of the code) already exists :p

That being said, my tinkerings are slowly leading me to "serious" issues that will help me if I one day decide to do serious modding.

For the sake of simplicity, I think I'll just list my questions from now in in a 1...2... setup, so that if anyone has the answers to one in particular they can post it.

1. How do you alter melee damage? I mean, there's a BashDamType script, but it is identical to BayoDamType scripts for the same gun. Generally, I see Gib = 0.0 , which I assume means no gibbing, and KDamageImpact = 400 or something. I changed those values once or twice, but saw no appreciable difference.

2. For tanks, is there some form of hidden "Horsepower" or weight stat? I noticed while changing an IS2s gear ratios/transmission settings that no matter how you altered them, there seemed to be an upper limit on speed that corresponds to your accelleration. Basically, 60kph is as fast as you can go while still having anything that resembles quickness (and even then, some settings won't even let you climb the hill out of the Barashka spawn).

3. I've made a MG42 and a K98 both fire Panzerfaust rounds. However, the Kar seems to fire them at much higher velocities. Why is this occurring? After all, all projectile speed data is stored in the projectile itself, so it shouldn't really matter which gun fires it?

4. Is there any form of resource/compilation that explains the functions of classes? I mean, I get the gist of it, i.e. ROScopedRifle->G43ScopedWeapon->G43____ , but there's a ton of variables/functions(?) in the higher classes that I simply can't decipher.

5. I just noticed in the editor that the radios used to call in artillery... don't appear to do anything. I mean, under their properties, there's nothing. It's just a radio. Does this mean I can assume that the artillery system isn't in any way connected to the radios themselves, but rather that they are simply designated (somehow) as the thing you "use" to drop the artillery?

6. Ok, so I "made" a map, included my new franken-weapons (and a different song on the radio!). Saved it. Went to RedOrchestra.ini and made sure that the package with all my crazy weapons was included under ServerPackage=_______ . Hosted a server, had a friend join it. It automatically made him download the new music/the map/the crazy gun package (note: I wonder if its possible to combine all of these into one nice file?) Game launches, we are in playing.

However, while the K98 Panzerfaust edition works, and the MP40 PTRD variant works, the machine guns do not. Neither a DP28 firing PTRDs or a MG42 firing fausts would fire properly. In game, both fired their standard MG rounds (at least on each others screens)

We closed the game, I start up practice mode. Machine Guns work as intended there. I start up a listen server. Guns fail to work here (in fact, they show no tracers AND shoot no bullets).

I'm guessing this has something to do with Machine Guns having seperate Client/Server side stuff in their "fire" classes. But, I Set both of those to the given shell type, so it shouldn't give me a problem, right? Or is it working in practice because the client side bullets register, but for servers it doesn't? hmm.



I guess I'll post more when they arise. For now, I'm going to switch agendas, and instead of making a silly gun I will attempt to make a radio that you can "use" to change stations. FullMJ needs a little more variety on the airwaves, methinks.

Edit: Well, I don't know how to switch what's playing yet, but I did manage to replace the normal music with the soviet national anthem.

I then decided to pull a "what's this button do?" while trying to make it play louder, doubled the pitch, and now have the Chipmunks singing the glorious USSR anthem.

I love this.... editor... err.. modding... something.

Ok, so emitters isn't the way to go... 1) you can't select which sound is emitted via "using" (I don't think), and 2) you can only set how often it plays a sound, and if that sounds and entire musical track chances are it'll be a bit dicey.. I mean, I could time two tracks/make it where 1 emits, then as it ends the second emitter kicks in, but eventually they will desync and.. ARGH.
 
Last edited:
Upvote 0
minor intoxication + confusion = lots of problems.

So, now I have a MP40 that fires PTRD shells at 200RPM with half as much recoil as normal and has a meelee butt smack that extends 10 times farther than normal, that if you miss makes a grenade explosion sound. YES.

The minor intoxication would certainly explain the attributes you decided to give the wep :D ;)

Sounds like you are having a fun learning experience here, though.
 
Upvote 0
FINAL EDIT: Sorry for all the edits, minor intoxication + confusion = lots of problems. However, I have now successfully summoned my weapon! YAY! I forgot to have MP40Weapon(silly).uc in my ROinventoryTD directory, so it was "Defaulting" to the standard MP40.

So, now I have a MP40 that fires PTRD shells at 200RPM with half as much recoil as normal and has a meelee butt smack that extends 10 times farther than normal, that if you miss makes a grenade explosion sound. YES.

Thanks for the tip of sorts with the summon thing. Now I just need to keep tinkering and victory will be mine! Next project: getting the radio on FullMJ to switch music tracks "stations" if you use it.. well that can wait until I get this MP40 launching panzerfausts or something.. heh.

PS: Don't worry, I won't continue adding such crazy things into the game.. I don't think. I'm just in that young experimentation phase ;)

Edit part "you said you wouldn't edit anymore!?": Now all I need to figure out is how to make the pickup spawn with ammo... and how to make the melee attack much more lethal + gibbing when it hits. Yes, I know, not realistic, but this is just tinkering after all..

Side note: Have you ever seen an MP40 take out a T34 from across the bridge at Barashka while firing at a nice, slow, flaklike THUNK THUNK THUNK speed? If not, I suggest trying it. It's... amusing.

an mp40 firing ptrd rounds LOLS make it fire tiger run rounds.. emm .. i mean .. the he ones... lols ... that would be a killer .. cept in cqb...
 
Upvote 0