IPB

Welcome Guest ( Log In | Register )

Is it possible to make a weapon to be unlocked after a specific number of kills?, The title's also a description
Frosty98B
post Aug 11 2017, 06:17 AM
Post #1


Captain
***

Group: Soldiers
Posts: 58
Joined: 11-July 14
From: Slovakia
Member No.: 10,231



Hi,

as BF2142 players might know, if you reach a rank 15 in the game, you'll automatically get a new knife with a dog tag attached to it. I've taken a look into the kits files and found out that it looks like this:


I was wondering of if it would be possible to replace the line ObjectTemplate.unlockLevel 15 by something else to make the knife appear for example after 20 knife kills instead of the rank.

I don't really want to replace the knife but I have a shotgun with two skins (featured as two separate weapons). One of the skins makes the shotgun look much more "worn". And I'd like to know if it's possible to make the original shotgun be replaced by the "worn" one in a single round (or not if it's not possible) after for example 25 shotgun kills.

Thanks for any kind of help. smile.gif


--------------------
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 1)
bad_santa12345
post Aug 15 2017, 12:43 AM
Post #2


Captain
***

Group: Soldiers
Posts: 67
Joined: 15-January 12
Member No.: 8,670



Could be done with a python script similiar to how wookie sniper mod and alpha project do the customization. But instead of choosing the kit based on which buttons were pressed on menu you could choose it based on score.

You would have to add a handler for player spawn event and check how many kills the spawning player has and invoke "gamelogic.setkit" from the spawn event.

CODE
def onPlayerSpawn(player, soldier):
    if player.score.kills >= 15:
        host.rcon_invoke("gamelogic.setkit x y z")
    else:
        host.rcon_invoke("gamelogic.setkit x y z")
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2017 - 03:35 AM