September 08, 2010, 05:13:43 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: i want to try to mod zafehouse  (Read 655 times)
dalamar
Survivor

Posts: 2


« on: January 28, 2010, 07:21:58 PM »

i want to try and mod zafehouse because i love this game so much but i've never modded a game in my life. i know nothing about how to get started. i downloaded the source code and microsoft visual basic 2008.  i have a few Q's. how do i get started? am i WAY over my head to even think about trying to mod with no experience? is there any other programs that i need to download? the most i want to try at first is putting in a couple of new weapons, increaseing the hours above 60, small stuff like that (err well i hope thats small stuff). but im very interested in trying!!


          thanks- dalamar
Logged
LoganB
Developer
Posts: 98



« Reply #1 on: February 01, 2010, 09:37:08 PM »

Hi dalamar,

Firstly, I just discovered a small problem with the source currently available. I've fixed the issue, but you'll need to download the code again.

Secondly, you've already taken the first steps by getting the source code and Visual Basic 2008. All you need to do to "access" the source is to extract the code to a folder and double-click on the "Zafehouse.sln" file in the  Zafehouse folder. The code itself is reasonably commented, so you can track down the various variables that control things.

One suggestion I can make to get you started is to check out the Game.vb file in the Core library (not the one in Zafehouse). You can access it by double-clicking on its file icon in the top right-hand window, once you've loaded Zafehouse.sln. This file contains a number of variables you can easily change to alter the gameplay - this includes starting supplies and the number of hours per game.

If you'd like to change/add weapons, here's what you need to do:

1) Open Game.vb in the Core library (as mentioned above).
2) Look for the following code in that file:
Code:
   Public Function Bat() As WeaponType
        Dim tempWeapon As New WeaponType

        With tempWeapon
            .Name = "Baseball bat"
            .Damage = 2
            .AmmoNeed = 0
            .IsMelee = True
        End With

        Return tempWeapon
    End Function
3) Copy this code, and paste it immediately below the original text, making sure you paste it after the "End Function" line.
4) Replace "Baseball bat" with a new name, and then replace the word "Bat" in "Public Function Bat() As WeaponType" to the name of your new weapon (without spaces). Keep a note of this name.
5) Edit the weapon variables. They are self-explanatory, so you shouldn't have too much trouble. For instance, AmmoNeed determines how much ammo the weapon needs to fire a single round, while IsMelee lets the game know how to treat the weapon in a fight.
6) Open the frmEncounter.vb file in the Zafehouse library
7) Find the line that reads "If ifChanceWithin(RewardChance, RaidPriority_Weapons) Then"
8) Directly below this line, change "WeaponsAvailable(7)" to "WeaponsAvailable(8)"
9) Directly below this line, change the part that reads "RND.Next(1, 8)" to "RND.Next(1, 9)"
10) Find the line that reads "WeaponsAvailable(7) = Shotgun()". Copy it and paste it just below the original line.
11) Replace the "(7)" with "(8)" and "Shotgun()" with the name you noted earlier. Be sure to include the closed brackets after the name.
12) Press F5 to run the game. Your new weapon will be available to find during raids.

That's a fairly speedy run-through of adding a new weapon. If you have any questions, let me know.

I'd recommending talking to flap when he gets back. He should be able to give you some tips.
Logged
dalamar
Survivor

Posts: 2


« Reply #2 on: February 02, 2010, 10:45:24 PM »

awesome thanks so very much! so far its easy going. i've added a few new weapons and 1 new building. this is awesome and man im loving it!!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2007, Simple Machines LLC