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


Author Topic: I want to ask about lua.  (Read 6658 times)

0 Members and 1 Guest are viewing this topic.

Offline Johnny Hopkins

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
I want to ask about lua.
« on: February 22, 2013, 11:26:36 PM »
I modded Johnny beta style (2_B.lua) with lua. But it works at just ArcRace1.lur 




    So my question is I have to compile  only ArcRace1.lur????   I want to use beta style

  in quest . ㅠ ㅠ 

Offline xXxNarumi

  • Apprehended (Captured)
  • Hero Member
  • ****
  • Posts: 2,641
  • Gender: Male
  • xNarumi wont be missed.
    • View Profile
Re: I want to ask about lua.
« Reply #1 on: February 23, 2013, 01:18:48 AM »
Make the lua run on load game.
May work that way.

Offline Johnny Hopkins

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Re: I want to ask about lua.
« Reply #2 on: February 23, 2013, 03:19:21 AM »
Make the lua run on load game.
May work that way.


I'm asking about that how to Make the lua run on load game.


So How????

Offline Evolution

  • Elitist
  • *********
  • Posts: 13,574
  • Gender: Male
    • View Profile
Re: I want to ask about lua.
« Reply #3 on: February 23, 2013, 03:38:51 AM »
What's wrong with using arcade?

Offline xXxNarumi

  • Apprehended (Captured)
  • Hero Member
  • ****
  • Posts: 2,641
  • Gender: Male
  • xNarumi wont be missed.
    • View Profile
Re: I want to ask about lua.
« Reply #4 on: February 23, 2013, 03:42:07 AM »
Arcade doesn't make you play missions nor Using it for Faction such as Greaser.
So i agree i want to use it for load game.
I'll check into this later since im bored,lazy, on APB.

deadpoolXYZ

  • Guest
Re: I want to ask about lua.
« Reply #5 on: February 23, 2013, 11:44:35 AM »
(2_B.lua) ??

How does that work?

Offline UltimateGamer1

  • BullyLeecher
  • Full Member
  • ***
  • Posts: 189
  • Gender: Male
    • View Profile
Re: I want to ask about lua.
« Reply #6 on: February 23, 2013, 11:53:05 AM »
You can load (2_B).lua through the arcade machine. Loading the beta style through lua is pretty hard you would have to edit the main.lua file.

deadpoolXYZ

  • Guest
Re: I want to ask about lua.
« Reply #7 on: February 23, 2013, 12:06:50 PM »
I remember Red posted how to do that but I forgot about it.
Wasn't ImportScript and then the mission lua file?

Offline xXxNarumi

  • Apprehended (Captured)
  • Hero Member
  • ****
  • Posts: 2,641
  • Gender: Male
  • xNarumi wont be missed.
    • View Profile
Re: I want to ask about lua.
« Reply #8 on: February 23, 2013, 02:30:56 PM »
Guys he is asking how do you make the Lua load up soon as you start the game.
Like Direct Starting Lua.
For instance.
If I load the save file the LUA is gonna enable soon as the gameplay starts.

Offline Prosecute

  • Full Member
  • ***
  • Posts: 244
  • Gender: Male
    • View Profile
    • NewDayStudios
Re: I want to ask about lua.
« Reply #9 on: February 24, 2013, 05:13:40 AM »
main.lur and check that file as it has links too other .lurs which enable this

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: I want to ask about lua.
« Reply #10 on: February 24, 2013, 01:26:53 PM »
What you will have to do is edit a library script and force that script to load the modified script you made.

One way to do this is to edit the stimecycle.lua which is a library script.

Library scripts are certain scripts that stay loaded all the time in the game.....stimecycle.lua, libplayer.lua, libped.lua, bdorm.lua, main.lua, mainmap.lua and a few others are library scripts.

What you need to do is easy on paper...but in practice it needs a little experimentation to get working properly which all of us lua coders are still figuring out a few odds and ends since the bully lua scripts are not exactly documented at all by rockstar and the only documentation that exists is what I have provided from what I have figured out.

To add a external script to a library script you need to edit at the beginning of a script and add:

ImportScript("ArcRace1.lua")

That line will add the external script which in this case is the Arcade Machine in the boys dorm.

You will also need to launch the external script which has to be done in key parts of the script. This can be launching the script only once or launch it any number of times and it should work.

To launch a imported script you need to use:

LaunchScript("ArcRace1.lua") This is the arcade machine in the boys dorm as per our example for importing the script.

I will paste the STimeCycle.lua script here with the changes and what you need to do is compile the modified STimecycle.lua to STimeCycle.lur and replace the original file. Make backups first of the original file JUST IN CASE since I cannot stress that point enough since backups are a must. If you have the space a complete copy of your installed game folders for bully is the best option since all you have to do then is copy the good files back over the bad files if you make a mistake.

Copy and save the following as STimeCycle.lua and compile it with the bully lua compiler that I uploaded which can be found here: http://www.bully-board.com/index.php?action=downloads;sa=downfile&id=60

To compile it just simply open up a command window by going to your start menu, click run if you have it and type cmd and hit enter. This will open up the command window. Next change to the folder where you extracted the lua compiler....I use the root of my c drive for the lua compiler since it is easy to get to and far faster then trying to type in long folder names and paths. So for example you would type: cd \ and hit enter which will take you to teh root of C:\ and then type: luac -o STimeCycle.lua STimeCycle.lur and hit enter. The compiled STimeCycle.lur will appear in the same place that luac.exe was placed. Just simply make a new scripts.img with the new compiled file in it replacing the old file and load up bully and give it a shot.

Code: [Select]
ImportScript("ArcRace1.lua")

main = function()
  repeat
    Wait(1000)
  until not Alive
end
 
F_AttendedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(false)
  PlayerSetPunishmentPoints(0)
end
 
F_MissedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(true)
  StatAddToInt(166)
end
 
F_AttendedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrintString("You got home in time for curfew", 4)
  end
end
 
F_MissedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrint("TM_TIRED5", 4, 2)
  end
end
 
F_StartClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
  local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
end
 
F_EndClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
end
 
F_StartMorning = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndMorning = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartLunch = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    F_UpdateTimeCycle()
    return
  end
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndLunch = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartAfternoon = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndAfternoon = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartEvening = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndEvening = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartCurfew_SlightlyTired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartCurfew_Tired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartCurfew_MoreTired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_StartCurfew_TooTired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndCurfew_TooTired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_EndTired = function()
  F_UpdateTimeCycle()
  LaunchScript("ArcRace1.lua")
end
 
F_Nothing = function()
end
 
F_ClassWarning = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  local l_23_0 = math.random(1, 2)
end
 
F_UpdateTimeCycle = function()
  if not IsMissionCompleated("1_B") then
    local l_24_0 = GetCurrentDay(false)
    if l_24_0 < 0 or l_24_0 > 2 then
      SetCurrentDay(0)
    end
  end
  F_UpdateCurfew()
end
 
F_UpdateCurfew = function()
  local l_25_0 = shared.gCurfewRules
  if not l_25_0 then
    l_25_0 = F_CurfewDefaultRules
  end
  l_25_0()
end
 
F_CurfewDefaultRules = function()
  local l_26_0 = ClockGet()
  if l_26_0 >= 23 or l_26_0 < 7 then
    shared.gCurfew = true
  else
    shared.gCurfew = false
  end
end
 
« Last Edit: February 24, 2013, 01:34:46 PM by |XF|-MadmaN[AR] »

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: I want to ask about lua.
« Reply #11 on: March 01, 2013, 11:21:12 AM »
delete
« Last Edit: May 13, 2013, 07:45:58 AM by esai »

Offline WhenLifeGivesYouLemons

  • xfire: 1emonthatsme
  • Sr. Member
  • ***
  • Posts: 971
  • Gender: Male
  • 波動バースト
    • View Profile
Re: I want to ask about lua.
« Reply #12 on: March 01, 2013, 12:19:03 PM »
this script cant load the beta fighting style....only the regular boss style
I think your suppose to manually load the boss style in the script or something  so the game always have the beta boss styles running
« Last Edit: March 01, 2013, 10:03:25 PM by LemonThatsMe »

Offline xbetstyler

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: I want to ask about lua.
« Reply #13 on: March 05, 2013, 05:12:38 AM »
delete
« Last Edit: May 13, 2013, 07:45:51 AM by esai »

Offline Rise

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Re: I want to ask about lua.
« Reply #14 on: March 07, 2013, 04:16:18 PM »
lol
« Last Edit: March 07, 2013, 04:19:13 PM by Rise To Honor »