[:3] TF2_CTFWeaponInfo
Rawr moar stuff. This allows you to change weapon information that you would find in the ctx files.
PHP Code:
Edit: Include weapon_parse.h from the HL SDK for the FileWeaponInfo_t class. |
Re: [:3] TF2_CTFWeaponInfo
Also, <3 and :3
------------------------------------------------------------------- 0 - projectile_none (lowers ammo, does no damage) 1 - projectile_bullet (bullets) 2 - tf_projectile_rocket (rocket launcher) 3 - tf_projectile_pipe (grenade) 4 - tf_projectile_pipe_remote (sticky) 5 - tf_projectile_syringe (needlegun -- doesn't always work) 6 - tf_projectile_flare (flaregun) 7 - tf_projectile_jar (doesn't work) 8 - tf_projectile_arrow (huntsman) ------------------------------------------------------------------- DO NOT CHANGE THE PIPEBOMBLAUNCHER'S PRIMARY FIRE. If anyone right-clicks the server crashes... (You could use TF2Items to kill alt-fire on the stickylauncher, but why nerf it? =\) ------------------------------------------------------------------- There are two groups of projectiles (as far as I'm concerned). Those which require force (2, 3, and 8), and those which don't. Those which require force (not sure how this works, haven't really looked) will drop straight down (so arrows -- 8 -- will shoot straight into the ground). The rest fire from any gun. Obviously, the guns from which these weapons originally spawn -- pipebomb launcher (stickies), grenade launcher (pipes), and huntsman (arrows) -- will shoot these weapons (and the others) fine. The arc appears to belong to the weapon, so with any luck it's a ctx attribute. From what I've gathered (based on how these projectiles spawn) the reason for this is likely to be tied to "CBaseEntity::ApplyLocalAngularVelocityImpuls e". What this does isn't something I've looked into... but it's used by pipes and jars (which both arc). There's likely to be something similar for arrows and stickies, but I haven't looked yet. |
Re: [:3] TF2_CTFWeaponInfo
CCSWeaponInfo:
PHP Code:
|
Re: [:3] TF2_CTFWeaponInfo
in TF2 it doesnt seem to work ... here my console output:
Code:
wazz_weapons tf_weapon_minigun |
Re: [:3] TF2_CTFWeaponInfo
Changes still seem to work for me however I just tested it using a slightly different function.
PHP Code:
|
Re: [:3] TF2_CTFWeaponInfo
with your your i get the following now:
PHP Code:
|
Re: [:3] TF2_CTFWeaponInfo
Ah, I rebuilt FileWeaponInfo_t because I didn't like its naming convention. http://wazz.ampaste.net/d76b20ba4
|
Re: [:3] TF2_CTFWeaponInfo
Are changes to FileWeaponInfo_t replicated on TF2? Can somebody change iSlot/m_nBucket for me and see if it works?
|
Re: [:3] TF2_CTFWeaponInfo
Doesn't look like it
|
Re: [:3] TF2_CTFWeaponInfo
D:
|
Re: [:3] TF2_CTFWeaponInfo
Thx it's working now :) and another question ...
is there any way to get the owner/carrier client index of a CTFWeaponInfo object? for example that i could say "all weapons used by bots should fire rockets with minigun" ? |
Re: [:3] TF2_CTFWeaponInfo
The this pointer of a CTFWeaponBase detour will give you an CTFWeaponBase object that inherits from CBaseEntity. The object represents the actual weapon in the world. Then you can look up m_hOwner (or m_hOwnerEntity, I forget the property name) to get the entity of the player that owns the weapon.
|
Re: [:3] TF2_CTFWeaponInfo
puh ... do you have a small pseudo code example ? :D
|
Re: [:3] TF2_CTFWeaponInfo
Should get you started: http://wazz.ampaste.net/d61226c77
|
Re: [:3] TF2_CTFWeaponInfo
interesting .... but i wonder. when i use this one:
PHP Code:
Do you have a class/struct or whatever of CBaseEntity, that you are able to call function on those objects? |
Re: [:3] TF2_CTFWeaponInfo
Use http://wazz.ampaste.net/d2b6e9bf0 EDIT: Forums still failing me.
|
Re: [:3] TF2_CTFWeaponInfo
thanks a lot ... worked, too ... but now i get this error when i try to compile:
PHP Code:
|
Re: [:3] TF2_CTFWeaponInfo
Quote:
http://wiki.alliedmods.net/Writing_e...ons#Link_Paths And don't forget to #define GAME_DLL 1 before including. |
Re: [:3] TF2_CTFWeaponInfo
Or just dont use GetOwnerEntity()
|
Re: [:3] TF2_CTFWeaponInfo
how do i use this in/for a plugin?
like, add everything before the CON_COMMAND and then make my own CON_COMMAND? (it simply looks completely different from the sourcepawn i've been using, so it looks quite confusing to me) is it possible to explain it somewhat, so i could understand and adapt it myself? from what i can gather, the stuff within the #ifdef _win32 to #endif is for signature finding, so i'd need to put that in my con cmd too. then there's a check for the number of args, after which it converts the arg to a char? (is that simply a string? or actually just 1 character?), which is then used to find which effect? (with a check to see if name is invalid) and then followed by the actual stuff that does something i think... (do i remember correctly if -> has something to do with pointers?) basically i'm looking for a way to up a player's weapondamage in tf2 (not everyone with that weapon btw), the problem in tf2 is that in the ctx, there is a max damage defined so even if i use a point hurt, i can't actually damage them with more then the max damage for that weapon at the same time. (i'd need multiple different point hurts, which if they kill someone spams loads of kill messages) so ye... could you explain a bit? or provide a small example of what i'm wanting to try? (or even tell me this isn't the way to do it, cos you know a better way?) |
Re: [:3] TF2_CTFWeaponInfo
It's C++, not SourcePawn. You could use SDKHooks to change the weapon damage.
|
Re: [:3] TF2_CTFWeaponInfo
how could i use sdkhooks?
I guess you're thinking of OnTakeDamage or OnTakeDamagepost, but they only provide a solution if the damage i want to do is within the limits the ctx's provide, thus rocketlauncher cant do more then about 120 damage, and stickys about 140. I can reduce the damage perfectly with sdkhooks, but if i tell it to do 400damage with any gun, it won't... (or am i missing something?) |
Re: [:3] TF2_CTFWeaponInfo
You should be able to go over the damage limitations, I'm not 100% in TF2 but it works in all other games. I don't see any reason why it would not work in TF2.
|
Re: [:3] TF2_CTFWeaponInfo
ok, i tested it again with sdkhooks, and although my first results proved in my favor, not everything was as i remembered.
basically, if you shoot yourself, while in contact with the ground, it works. but if i'm in the air and shoot myself it doesn't... since there's a 40% damage reduction... which i should be able to fix... if i check wether the person is touching the ground and such...(do have to check if it also works this way on others though) thanks.. i think i'll be able to get it done now EDIT: actually, after some more testing, i was right, though my original question appears to not have anything to do with damage. you see, i wanted more knockback from explosions, which i figured would be calculated from damage done... which is true... uptill full damage, and then it somehow doesn't go higher, like setting tf_damageforce_self_soldier to 1.0 (no damagereduction) gives you the max boost, but anymore is not attainable by damage or by upping that cvar further (and/or some other cvars) ahwell since my problem probably hasn't got anything to do with this snippet anymore, i'll stop :P |
Re: [:3] TF2_CTFWeaponInfo
Quote:
|
Re: [:3] TF2_CTFWeaponInfo
Quote:
Quote:
added them in Project Properties -> Linker -> Input -> Additional Dependencies and Project Properties -> VC++ Directories -> Library Directories Could you show me your VS link path configuration? Or do I need a special .lib file or so which doesnt exist by default? |
Re: [:3] TF2_CTFWeaponInfo
There are a couple of issues with this code and it's unlikely the detours will work from what Wazz said alone (when I say unlikely, I mean I haven't managed to make it work, even with asherkin's help).
I integrated the structures/classes into my code some time ago ... From VS2010 C++ -> Additional Includes Code:
..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(SOURCEMOD13)\public;$(HL2SDKOBVALVE);$(HL2SDKOBVALVE)\public;$(HL2SDKOBVALVE)\public\engine;$(HL2SDKOBVALVE)\public\game\server;$(HL2SDKOBVALVE)\public\tier0;$(HL2SDKOBVALVE)\public\tier1;$(MMSOURCE17)\core;$(MMSOURCE17)\public;$(MMSOURCE17)\core\sourcehook;%(AdditionalIncludeDirectories)Code:
$(HL2SDKOBVALVE)\lib\public\tier0.lib;$(HL2SDKOBVALVE)\lib\public\tier1.lib;%(AdditionalDependencies) |
Re: [:3] TF2_CTFWeaponInfo
Updated FileWeaponInfo_t for L4D2, along with L4D2's CCSWeaponInfo and CTerrorWeaponInfo...
Patch for FileWeapoInfo_t on hl2sdk-l4d2: https://bugs.alliedmods.net/show_bug.cgi?id=4744 CCSWeaponInfo + CTerrorWeaponInfo: PHP Code:
|
| All times are GMT -4. The time now is 18:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.