Author Topic: Editing existing code for weapons and player-types  (Read 2230 times)

Yeah, I'm not planning on releasing them without original models.  I was thinking of using your method after looking through the .cs files some more, and I hadn't even seen your posts yet!

I've got some more questions, about player-types.

What exactly is run force?  If I set it to a low run force, but a high maximum run speed, that means my guy will start out slow, and then get to maximum speed after a while?

Why is run force calculated by "x multiplied by 90"?

What are all the default variables for the standard player?  The .cs doesn't include variables, leaving me to believe that that means they are set to the default values.  Where can I see these default values?

What is the variable for health, and is there any way I can prevent the "setHealth" event from overriding this?  Like a "maximum health" variable?

I was thinking about using the energy health playertypes, by iban, but then I realized that the Medigun probably wouldn't work with that, as health is determined only by energy, and not vice versa, correct?


Now for weapon questions:

I see that "impulse" is how far you get blown back when the projectile hits you.  Is the best way of getting the value you want to just mess around with it, trial and error?

The delay between firing on guns (in their states) is the "timeout" of the "Fire" state PLUS the "timeout" of the "Reload" state, and any other states in between, correct?  So once I have this sum, I could do the following (since the timeout values are in seconds):

1 divided by (sum) = how many projectiles a second assuming the projectile count is 1

Correct?


Thanks so much for your help.



What exactly is run force?  If I set it to a low run force, but a high maximum run speed, that means my guy will start out slow, and then get to maximum speed after a while?
Yes. Run force is added every step (tick?) to the player's velocity in whatever direction they are facing when holding 'forwards', so a low force but high speed means a time to accelerate first.

Why is run force calculated by "x multiplied by 90"?
Arbitrary constant that makes a specific value of run force related to the acceleration in Torque Units/Second probably. You could remove it and replace it with the actual value of 90x, but it lets you compare them easier, so if you want "double acceleration" then double the number before the 90.

What are all the default variables for the standard player?  The .cs doesn't include variables, leaving me to believe that that means they are set to the default values.  Where can I see these default values?
Correct.
playerStandardArmor.dump(); in console while hosting for a list of all usable variables.

What is the variable for health, and is there any way I can prevent the "setHealth" event from overriding this?  Like a "maximum health" variable?
Health is stored in the engine. Current health can be accessed with (%player.dataBlock.maxDamage - %player.getDamageLevel()). I think that the setHealth event can't go over the datablock's limit, but I might be wrong.

I was thinking about using the energy health playertypes, by iban, but then I realized that the Medigun probably wouldn't work with that, as health is determined only by energy, and not vice versa, correct?
If you're using his "shielded" players, then the Medigun would restore any physical damage, but not shielded damage.
If you're using the "health bar" players, then the Medigun would not function on it. You would have to rewrite the medigun code to make an "energy gun" or something similar.

I see that "impulse" is how far you get blown back when the projectile hits you.  Is the best way of getting the value you want to just mess around with it, trial and error?
Make the numbers you set relative to the existing value. You want twice as much impulse, double it etc.

The delay between firing on guns (in their states) is the "timeout" of the "Fire" state PLUS the "timeout" of the "Reload" state, and any other states in between, correct?  So once I have this sum, I could do the following (since the timeout values are in seconds):

1 divided by (sum) = how many projectiles a second assuming the projectile count is 1
Yes, I think. What would this be number used for? (DPS calculation?)

I tried the player.dump command, worked fine.  There is a maxDamage item, is that how much health you have?


I just copied all the useful items I need out of that list (from the player.dump), then I made another copy, but with the default values attached for reference.

Now, I am taking all the values I can from each classes' TF2 Wiki page, and then I will fit them into a blockland player type, one for each class.  In the TF2 wiki, they calculate run speed through percentages, obviously referencing an unknown base value.  I just plan to use 10 (maxForwardSpeed).  I believe 7 is the default maxForwardSpeed.

So, using percentages, if 10 is the base value, then the Scout's speed of 133% would mean that his maxForwardSpeed is 13.3.

I also plan on doing the same for weapons.  Damage values, intervals between firing, etc.

Also, the run force calculated by "x of 90" doesn't apply to the Standard Armor player.  He just has the straight value, like 1080 (12 times 90), for example.  Very interesting.  I had just found the "x of 90" in Iban's playertypes.


And yes, I would use the timeout sums to calculate the Rate of Fire (usually done by bullets per second), and that would lead straight to DPS.  ROF x (damage done per bullet) = DPS.

Bump.

tl;dr for above, basically I want to know if maxDamage is how much health you have.


Yes.

Thanks.  I think now I can go ahead and start working on the mod.

You have been a great help, Space Guy.  I really appreciate it.

Tip: If you're unsure what a setting (like maxDamage) does, try changing it! Experiment with what they do and see what it effect is has.

Alright, I just tried my hand at making a player-type for each class.

Worked beautifully.  I took the speed percentages from the TF2 wiki and applied them to base values I had arbitrarily set before.  Same thing with health and some others.

Now I will work on the weapons.

So far I have made all the playertypes that I need, and am now working on the last couple weapons.

I tried to edit the Rocket Launcher, and for some reason it will not show up in the item list which I try to spawn it from a brick.

I've edited it in the same way as the rest of the weapons.  I edited the damage, UIName, and the file paths to the models and such.  It shows up on the add-on list fine, it is enabled, the console says it loaded perfectly, but it will not show up when I try to spawn it from the brick.  It's not an option to select.

Is there anything I'm doing wrong?

Bump.  I have every weapon I need except for the Rocket Launcher.

It will not show up, but I have edited exactly like I have edited the other ones, which all work fine.

Yes, the original Rocket Launcher is disabled.
Yes, the uiName is different for the edited one.

Help!