News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Prefects bat spawn  (Read 3377 times)

0 Members and 1 Guest are viewing this topic.

Offline RSta

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Prefects bat spawn
« on: June 21, 2016, 04:02:59 PM »
Hi,so how can i make the prefects have them hold a bat everytime,for eg,like mr luntz having that giant broom with him everytime he spawns.

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Prefects bat spawn
« Reply #1 on: June 21, 2016, 11:54:28 PM »
I see two ways of doing this: editing the authority ped-stat, or giving all authority peds the weapon. Both ways are fairly simple but for the most part I'd suggest going with the first method unless you have a reason not to.

METHOD ONE: PEDSTATS
Open up "/Bully Scholarship Edition/Config/dat/pedstats.dat", you can view this file with any ol' text editor though notepad++ would be preferred in my opinion. You'll notice that there are different stats for various types of peds each with a set of values that are explained in the upper part of the file. Find "STAT_PF_BASIC_S", this is the prefect stat. Scroll enough to the right and you should find this:
  100 unarmed -1 1 init unarmed -1 1 init unarmed -1 1 init unarmed -1 1 init

These values are described like this:
 AT: Likelihood (n/100) of having a weapon
 AU: Weapon slot 1: Type of melee/projectile
 AV: Weapon slot 1: Amount of Ammo
 AW: Weapon slot 1: Selection weight for melee/projectile weapon - HIGHEST NUMBER WINS
 AX: "Weapon slot 1: Available after mission (use ""init"" to signify start of game)"
 AY: Weapon slot 2: Type of melee/projectile
 AZ: Weapon slot 2: Amount of Ammo
 BA: Weapon slot 2: Selection weight for melee/projectile weapon
 BB: "Weapon slot 2: Available after mission (use ""init"" to signify start of game)"
 BC: Weapon slot 3: Type of melee/projectile
 BD: Weapon slot 3: Amount of Ammo
 BE: Weapon slot 3: Selection weight for melee/projectile weapon
 BF: "Weapon slot 3: Available after mission (use ""init"" to signify start of game)"
 BG: Weapon slot 4: Type of melee/projectile
 BH: Weapon slot 4: Amount of Ammo
 BI: Weapon slot 4: Selection weight for melee/projectile weapon
 BJ: "Weapon slot 4: Available after mission (use ""init"" to signify start of game)"

Edit AT through AX like this:
 100 cricket 1 100 init

You can find a list of weapon names in "/Bully Scholarship Edition/Objects/default.ide" if you'd like more weapons.

METHOD TWO: SCRIPTING
 If you know how to make custom scripts, this is also something you could use, but if not do not worry about it.
 In a LUA script (any script that you can get constantly running will work, STimeCycle.lur would be my personal choice), add this code:
 
Code: [Select]
function main()
  -- Main loop:
  while true do
    -- Loop through all peds:
    for i,ped in ipairs({PedFindInAreaXYZ(0,0,0,999999)}) do
      -- Check that i is greater than 1 (since the first value returned by PedFindInAreaXYZ is a ped count and not an actual ped), that the ped is a prefect, and that they aren't already armed:
      if i > 1 and PedGetFaction(ped) == 0 and PedGetWeapon(ped) ~= 357 then
        PedSetWeapon(ped,357,1)
      end
    end
   
    -- Wait:
    Wait(0)
  end
end



This should hopefully also open a few doors for experimentation yourself, you should be able to safely edit a majority of the stats in pedstats.dat, it can be pretty fun to play with. G'luck and happy modding.