Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Killing Floor Forums > Killing Floor Modifications > Coding

Reply
 
Thread Tools Display Modes
  #41  
Old 06-24-2012, 12:52 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,732
Default

Quote:
Originally Posted by Gartley View Post
Give this function a go in your perk class. Let me know if it works for you.

[CODE]function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('KFHumanPawn'))
{
KFHumanPawn(Other).RequiredEquipment[0] = "";
KFHumanPawn(Other).RequiredEquipment[1] = "";
}
return true;
}
Jst so you know, this doesn't work inside the perk as me and ro_sauce tried to get this to work for his perks.
__________________

Reply With Quote
  #42  
Old 06-24-2012, 03:20 PM
Marco Marco is offline
Senior Member
 
Join Date: May 2009
Location: Finland
Posts: 452
Default

Quote:
Originally Posted by StuKKa View Post
Hi there,
I'm working on a custom perk and all is working fine. I got a random melee weapon ability specific to your perk level (i.e. tireiron for perk under level 3 and i.e. a rusty shovel above). But what I need is to remove the given Weapons "Knife" and "9mm" Pistol, because this perk should use it's own. How could I do this? I searched all classes for the veterancy types (anchestors included), if there is some line that says giving this items to the player, but I don't find one.
Would be nice if someone could help me. Thank you.
Put this in your perk code:
Code:
static function AddDefaultInventory(KFPlayerReplicationInfo KFPRI, Pawn P)
{
	local Inventory I;

	// Delete standard guns
	I = P.FindInventoryType(Class'Knife');
	if( I!=None )
		I.Destroy();
	I = P.FindInventoryType(Class'Single');
	if( I!=None )
		I.Destroy();
	KFHumanPawn(P).RequiredEquipment[0] = "";
	KFHumanPawn(P).RequiredEquipment[1] = "";

	// Then give perk specific weapons.
	if ( KFPRI.ClientVeteranSkillLevel < 3 )
		KFHumanPawn(P).CreateInventoryVeterancy(string(Class'MyTireIron'), GetCostScaling(KFPRI, class'MyTireIron'));
	else KFHumanPawn(P).CreateInventoryVeterancy(string(Class'MyShovel'), GetCostScaling(KFPRI, class'MyShovel'));
}
__________________
Quote:
Originally Posted by HuNteR- View Post
Sadly no, we can't do anything about it, fools like Marco will always exist, and with no one with power pulling strings, its a lost cause.

Last edited by Marco; 06-24-2012 at 03:22 PM.
Reply With Quote
  #43  
Old 06-25-2012, 08:51 AM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

Brilliant, thanks Marco. *Adds to the collection of useful information.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"
Reply With Quote
  #44  
Old 06-25-2012, 11:11 PM
bluenog143 bluenog143 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 8
Default

Hi
I'm trying to get the G36C Ammo/Mag and the recoil upgrades into a new commando perk I'm making

Would I be able to get the code to add the G36C to these?

Code:
static function float ModifyRecoilSpread(KFPlayerReplicationInfo KFPRI, WeaponFire Other, out float Recoil)
-------------------------------------------------------------------------------
static function float AddExtraAmmoFor(KFPlayerReplicationInfo KFPRI, Class<Ammunition> AmmoType) 
-------------------------------------------------------------------------------
static function float GetAmmoPickupMod(KFPlayerReplicationInfo KFPRI, KFAmmunition Other)
-------------------------------------------------------------------------------
static function float GetMagCapacityMod(KFPlayerReplicationInfo KFPRI, 
KFWeapon Other)
The "---------------" lines above are ment to seperate the lines of code and are not part of the actual code (I had trouble spacing the lines). And as for the damage and the price changes those should be working and set right now. Thanks!
Reply With Quote
  #45  
Old 06-26-2012, 03:01 AM
ASSAYARO's Avatar
ASSAYARO ASSAYARO is offline
Senior Member
 
Join Date: Sep 2010
Location: Behind you...
Posts: 137
Default I've a questions...

Is there limits of appilcation weapons and perks, charater command line in Serverperks.ini?
I was appiled 20~25 perk and approximately 200~250 weapons in serverperks.ini
By the way.... Server'll work ... But, Access is not.
I guess a problem with weapons.
I never had a problem when coding, It's a problem that applies to the server...hm
And ...If a problem with the weapon in "serverperks.ini", Is there any way to automatically removed?

Last edited by ASSAYARO; 06-26-2012 at 03:12 AM.
Reply With Quote
  #46  
Old 06-26-2012, 09:18 AM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

Hmm, If I follow what you are saying ASSAYARO, I think that's to do with a limit with array sizes. Until Marco's implementation of sub categories in the trader you were limited to about 50 weapons. As for a work around I don't know where to start looking.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"
Reply With Quote
  #47  
Old 06-26-2012, 12:17 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,732
Default

Quote:
Originally Posted by bluenog143 View Post
Hi
I'm trying to get the G36C Ammo/Mag and the recoil upgrades into a new commando perk I'm making

Would I be able to get the code to add the G36C to these?

Code:
static function float ModifyRecoilSpread(KFPlayerReplicationInfo KFPRI, WeaponFire Other, out float Recoil)
-------------------------------------------------------------------------------
static function float AddExtraAmmoFor(KFPlayerReplicationInfo KFPRI, Class<Ammunition> AmmoType) 
-------------------------------------------------------------------------------
static function float GetAmmoPickupMod(KFPlayerReplicationInfo KFPRI, KFAmmunition Other)
-------------------------------------------------------------------------------
static function float GetMagCapacityMod(KFPlayerReplicationInfo KFPRI, 
KFWeapon Other)
The "---------------" lines above are ment to seperate the lines of code and are not part of the actual code (I had trouble spacing the lines). And as for the damage and the price changes those should be working and set right now. Thanks!
Hey. I would personally say the best way to see how a perk is fully unstable is to look at the official perks TWI made. They are a great way of learning by comparing to what is already made. They are in the KFMod file under the names KFVetBerserker etc. I hope this'll help with your learning
__________________

Reply With Quote
  #48  
Old 06-26-2012, 05:39 PM
ASSAYARO's Avatar
ASSAYARO ASSAYARO is offline
Senior Member
 
Join Date: Sep 2010
Location: Behind you...
Posts: 137
Default so sad=..=

Quote:
Originally Posted by Gartley View Post
Hmm, If I follow what you are saying ASSAYARO, I think that's to do with a limit with array sizes. Until Marco's implementation of sub categories in the trader you were limited to about 50 weapons. As for a work around I don't know where to start looking.
Mr.Gartley Look pm
Spoiler!

I regret making perks.
so sad...labor in vain...hm
Reply With Quote
  #49  
Old 06-26-2012, 07:55 PM
xtsnet xtsnet is offline
Member
 
Join Date: Jun 2012
Posts: 42
Default Mutator Newbie

Hi, I'd like to create a mutator that makes it so that only the Owner of a weapon can pick it up.

In other words, if someone buys a weapon at the trader and then turns around and drops it so that he can buy another - Someone else cant come along and pick it up and sell it. Only the ORIGINAL owner can pick it back up. Any weapon that spawns on the map would have an owner set as WORLD so that anyone can pick it up, and maybe if the player dies, all of their weaps would then be set to Owner = WORLD

I am a C/C++ programmer so i should be able to create it (Assumnig it doesn't already exists somewhere) But I have never even looked at the UR SDK or anything yet.

Question is:

1) Looking for a good quick start guide to mutators (this thread will probably work) And any other links.

2) SDK docs and reference materials - Obviously I would need to study the STRUCTS and CLASSES associated with players and Items

3) Any other suggestions for a newbie - Just need to get pointed in the right direction, dont need to have my hands held along the way
Reply With Quote
  #50  
Old 06-27-2012, 02:06 AM
ro_sauce ro_sauce is offline
Senior Member
 
Join Date: Sep 2007
Posts: 3,110
Default

well, then post what code you did so we can see, it's hard to figure out what is going on just from error messages.
__________________


For RO2 Crash Support Help, PM me your problem and teamview connection, and I will see if I can fix it for you.
Reply With Quote
  #51  
Old 06-27-2012, 10:44 AM
bluenog143 bluenog143 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 8
Default

Thanks FluX, I was able to make the perk successfully and add some other stuff so it's working very good!

Just one question for whoever can answer. I was making a custom assault-rifle (bullpup model for now) that fires .50AE rounds and when I tried it ingame I noticed that it couldn't cause headshot damage (their heads didn't blow up and I didn't hear the cracking noise and I could see that when I shot their heads they received normal body damage and not headshot damage.

I did notice that I removed
Code:
 PvPDamageMult=1.0
from the damtype file. It was giving me compiler errors so I had to remove it from the code, did that remove headshots? If so how can I fix the problem? Thanks!
Reply With Quote
  #52  
Old 06-27-2012, 11:39 AM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

Quote:
Originally Posted by bluenog143 View Post
Thanks FluX, I was able to make the perk successfully and add some other stuff so it's working very good!

Just one question for whoever can answer. I was making a custom assault-rifle (bullpup model for now) that fires .50AE rounds and when I tried it ingame I noticed that it couldn't cause headshot damage (their heads didn't blow up and I didn't hear the cracking noise and I could see that when I shot their heads they received normal body damage and not headshot damage.

I did notice that I removed
Code:
 PvPDamageMult=1.0
from the damtype file. It was giving me compiler errors so I had to remove it from the code, did that remove headshots? If so how can I fix the problem? Thanks!
Extend the damage class from KFProjectileWeaponDamageType.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"
Reply With Quote
  #53  
Old 06-28-2012, 04:48 AM
ASSAYARO's Avatar
ASSAYARO ASSAYARO is offline
Senior Member
 
Join Date: Sep 2010
Location: Behind you...
Posts: 137
Default one question...

Quote:
Originally Posted by Gartley View Post
Extend the damage class from KFProjectileWeaponDamageType.
in DamType,
What is the difference between KFProjectileWeaponDamageType and KFWeaponDamageType?
I don't know the difference between 2.
Explain in greater detail...
And... If misuse, make a trouble or issue or serious problem?
Reply With Quote
  #54  
Old 06-28-2012, 07:17 AM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

One's a generic damage type the other is one for projectile weapons, ie guns. I had this when I made a Colt1911 for KF, I wasn't getting the head shots, I changed the damage type and viola, it worked. I was going to add something about how some additional functions are handled but I can't remember so I'd rather stay silent then spread misinformation.

@xtsnet Hi there, welcome to the TWI boards. For getting started I suggest Benjamin's threads I posted right at the beginning of my thread. Those plus the other links to the likes of Beyond Unreal and the Unreal Script reference should be all you need to get started. Nose through the threads, especially in this sub forum, if you would like to see how something works most of the authors around here would happily share their source or point you in the right direction.

Have fun! ^^
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"

Last edited by Gartley; 06-28-2012 at 07:32 AM. Reason: Spelling
Reply With Quote
  #55  
Old 06-28-2012, 11:31 AM
bluenog143 bluenog143 is offline
Junior Member
 
Join Date: Apr 2012
Posts: 8
Default

Thanks Gartley!

One last question for whoever can answer.
Is it possible to have more than one damagetype level up a perk?

For example, I made a perk that needs assault-rifle damage to level up, is it possible to add demolitions and melee damage to the perk without having another requirement? Thanks!
Reply With Quote
  #56  
Old 06-28-2012, 11:48 AM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

Without adding a second requirement the only thing I could think of is either:
(Using your examples of AR, Explosive and Melee)

#1
Edit your Explosive/Melee weapons' damage classes to add to the AR damage count (or vice versa)

#2
Create a new requirement for the perk ie BoomyARSlashyDamCount and use the perk to replace the damage types with new ones that have the function AwardDamage add to that new requirement count. (as well as the old)

I'd personally opt for option 2 myself, it's cleaner.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"
Reply With Quote
  #57  
Old 06-28-2012, 02:30 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,732
Default

Quote:
Originally Posted by ASSAYARO View Post
in DamType,
What is the difference between KFProjectileWeaponDamageType and KFWeaponDamageType?
I don't know the difference between 2.
Explain in greater detail...
And... If misuse, make a trouble or issue or serious problem?
From experiementing on some of the weapon types, they do different things to the gameplay and how they affect the specimens.

KFWeaponDamageType is a base for all the other different damage types that TWI had made. Some are designed to give a massive kick in the shots and some are to set enermys on fire. It all depends on which one you use as to what affect they have on the specimens. You could potentially have a look at all the defaultproperties and experiment on what affects each of the functions what do. It's actually quite funny sometimes what a number change etc can do.
__________________

Reply With Quote
  #58  
Old 06-30-2012, 07:27 AM
StuKKa's Avatar
StuKKa StuKKa is offline
Member
 
Join Date: Mar 2010
Posts: 61
Default

Hi, and thanks for helping me with removing the knife and the pistol from the perk. Now I could continue working on my perk .....that was exactly I was looking for....
Sorry for the late replay, had a hard working week.....
__________________
There's only one way to win a campaign: shout, shout and shout again!
Reply With Quote
  #59  
Old 07-15-2012, 01:58 AM
EpharGy EpharGy is offline
Senior Member
 
Join Date: Jan 2011
Location: Australia
Posts: 1,350
Default

Hi all,

I've been trying to make a custom headshot requirement for sharpshooter, So the requirement only counts a headshot kill if its a Siren/Husk/Scrake or Fleshpound.

If possible I still want it to record stats of headshot kills like normal. (So i can pull the % of Siren/Husk/Scrake/FP HS kills against All Sharpshooter HS at a later date.


Anyways, the tutorial shows how to set up for a damage based progression (which i've managed fine, I've also added a Sharpshooter damage requirement)

But I'm not sure about how i go about creating the custom HS requirement.


Below is from the KFWeaponDamageType.uc, this is for regular headshot kills with Sharpshooter weapons right?
Code:
static function ScoredHeadshot(KFSteamStatsAndAchievements KFStatsAndAchievements, bool bLaserSightedM14EBRKill)
{
	if ( KFStatsAndAchievements != none && Default.bSniperWeapon )
		KFStatsAndAchievements.AddHeadshotKill(bLaserSightedM14EBRKill);
}
Any help would be much appreciated.
Reply With Quote
  #60  
Old 07-15-2012, 10:14 AM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,732
Default

This all depends on how you have setup your mod for your server. If you use Marco's ServerPerks, then you'll have to do some extending unless you have your own customised version and prefer to hard code it with the other stats.

Extending of ServerPerks (or your own):
http://forums.tripwireinteractive.co...46&postcount=3

Hard coding stats (if your own renamed ServerPerks version):
Look at files ClientRepLink.uc, ServerStStats.uc, StatsObject.uc and SRStatList.uc (I think that is it). They all are part of the creation of the custom stat you would like to make but the function for it would be set in ServerStStats so make sure you double check for the stats ready made and compare.

Any problems, contact me
__________________

Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC