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


Author Topic: Tutorial Boxes  (Read 5569 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Tutorial Boxes
« on: November 10, 2015, 10:02:59 PM »
Hello everyone. This is a well requested tutorial, however, many have already figured out how to even make this work. And I looked around the board for a bit, and discovered there is NO full tutorial on how to actually do this.

So here we go...

BEFORE STARTING THE TUTORIAL, make sure you do this:
Go to control panel, then find Folder Options. Now, go to the second tab on the top,(iirc its View) and uncheck "Hide extensions for known file types". This will allow you to view the full extension of files, and you will also be able to change them. Now click OK.

First, you may need the decompiled scripts. I am not sure if I can release those, so I will post the Last Minute Shopping(note it's most likely not going to be able to compile, but we just need 1 line from it):
Code: [Select]
-- Decompiled using luadec 3.2 -- Sun Feb 07 23:28:49 2010
-- File name: 2_01.lur

local l_0_0 = false
local l_0_1, l_0_2, l_0_3, l_0_4, l_0_5, l_0_6, l_0_7 = nil, nil, nil, nil, nil, nil, nil
local l_0_8 = 300
local l_0_9 = nil
local l_0_10 = 209.03199768066
local l_0_11 = -73.281303405762
local l_0_12 = 8.6000003814697
local l_0_13 = false
local l_0_14 = false
local l_0_15 = false
local l_0_16 = true
local l_0_17 = nil
local l_0_18 = {}
local l_0_19, l_0_20, l_0_21 = nil, nil, nil
local l_0_22 = {}
local l_0_23, l_0_24, l_0_25, l_0_26, l_0_27 = nil, nil, nil, nil, nil
local l_0_28 = PedGetUniqueModelStatus(58)
local l_0_29, l_0_30, l_0_31, l_0_32, l_0_33, l_0_34 = nil, nil, nil, nil, nil, nil
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Overwrote pending register. (Assignments::assign)
 -- Confused at declaration of local variable. (Assignments::declareLocals) -- Overwrote pending register. (Assignments::assign)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Overwrote pending register. (Assignments::assign)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Overwrote pending register. (Assignments::assign)
 
F_TableInit = function()
  l_0_18 = nil
end
 
F_CameraDebug = function()
  while 1 do
    if IsButtonPressed(14, 0) then
      F_CameraTweak()
    end
    Wait(0)
  end
  Wait(0)
end
 
F_Debug = function()
  CameraFade(1000, 1)
  AreaTransitionPoint(2, POINTLIST._2_01_PLAYERSTART)
  local l_3_0, l_3_1, l_3_2 = nil, nil, nil
  TextPrint("2_01_OBACKEDNA", 4, 1)
  l_0_2 = nil
  l_0_1 = PedCreatePoint(58, POINTLIST._2_01_EDNAFIN)
  PedSetFlag(l_0_1, 133, false)
  PedSetPosPoint(l_0_1, POINTLIST._2_01_EDNAFIN)
  TextPrintString("Move to Caf Entrance to ready NIS", 4, 1)
  l_0_2 = AddBlipForChar(l_0_1, 12, 0, 4)
  PedSetInvulnerable(l_0_1, true)
  repeat
    Wait(0)
  until PlayerIsInTrigger(TRIGGER._2_01_EDNAFACEPLAYER)
  TextPrintString("NIS ready to fire", 4, 1)
  PedFaceObject(l_0_1, gPlayer, 3, 1)
  repeat
    if PlayerIsInAreaObject(l_0_1, 2, 1, 0) then
      F_CinEnding()
      Wait(500)
      l_0_13 = true
    end
    Wait(0)
  until l_0_13
end
 
MissionSetup = function()
  PlayCutsceneWithLoad("2-01", true, true, true)
  shared.gEdnaOverride = true
  DATLoad("2_01.DAT", 2)
  DATInit()
  F_TableInit()
  SoundPlayInteractiveStream("MS_SearchingLow.rsm", 0.80000001192093)
  SoundSetMidIntensityStream("MS_SearchingMid.rsm", 0.80000001192093)
  SoundSetHighIntensityStream("MS_SearchingHigh.rsm", 0.80000001192093)
  MissionDontFadeIn()
  l_0_30 = MissionObjectiveAdd("2_01_O1")
  PedSetUniqueModelStatus(58, -1)
  LoadAnimationGroup("2_01LastMinuteShop")
  LoadAnimationGroup("NIS_2_01")
  shared.gOverrideSchoolGates = false
  CreateThread("T_BikeMountTut")
end
 
T_BikeMountTut = function()
  repeat
    Wait(0)
  until if not PlayerIsInTrigger(TRIGGER._2_01_TUTPLAY1) or not PlayerIsInAnyVehicle() then
    TutorialShowMessage("TUT_BIKE3", 5000, false)
  end
  collectgarbage()
end
 
main = function()
  LoadModels(l_0_35)
  LoadModels(l_0_36)
  LoadWeaponModels(l_0_36)
  LoadVehicleModels(l_0_37)
  LoadActionTree("Act/Conv/2_01.act")
   -- Overwrote pending register. (Assignments::assign)
  AreaSetDoorLocked("DT_ischool_Janitor", 370)
  shared.gOverrideSchoolGates = false
  AreaSetDoorLocked("DT_ischool_Attic", false)
  local l_6_0 = nil
  if l_0_0 then
    F_Debug()
  end
  CameraFade(500, 0)
  Wait(500)
  AreaTransitionPoint(2, POINTLIST._2_01_PLAYERSTART, nil, true)
  CameraFade(1000, 1)
  TextPrintString("Go Find Edna's Bike.", 6, 1)
  if PedIsValid(shared.gEdnaID) then
    PedDelete(shared.gEdnaID)
  end
  F_CreateMissionCharacters()
  CreateThread("T_FailCond")
  CreateThread("T_Timer")
  CameraFade(1000, 1)
  TextPrint("2_01_OFINDBIKE", 3, 1)
  F_tBikeManager()
  F_StartCounter()
  local l_6_1, l_6_2, l_6_3 = GetPointList(POINTLIST._2_01_RAZORSPAWN)
  l_0_20 = BlipAddXYZ(l_6_1, l_6_2, l_6_3, 0, 4)
  l_6_1, l_6_2, l_6_3 = GetPointList(POINTLIST._2_01_PLAYERSTORE)
  l_0_21 = BlipAddXYZ(l_6_1, l_6_2, l_6_3 + 0.10000000149012, 0, 4)
  l_6_1, l_6_2, l_6_3 = GetPointList(POINTLIST._2_01_PANTYSPAWN)
  blipCloth = BlipAddXYZ(l_6_1, l_6_2, l_6_3, 0, 4)
  l_0_31 = MissionObjectiveAdd("2_01_O2")
  l_0_32 = MissionObjectiveAdd("2_01_O3")
  l_0_33 = MissionObjectiveAdd("2_01_O4")
  F_tIngredientsGet()
  repeat
    Wait(0)
  until AreaGetVisible() == 0
  l_0_34 = MissionObjectiveAdd("2_01_GOTOBUS")
  TextPrint("2_01_GOTOBUS", 4, 1)
  l_0_2 = BlipAddPoint(POINTLIST._2_01_busstoppoint, 0, 1, 2, 0)
  TutorialStart("BUS01")
  F_CheckBackToEdna()
end
 
MissionCleanup = function()
  BlipRemove(l_0_2)
  SoundStopInteractiveStream()
  shared.gEdnaOverride = nil
  F_CleanBlip(l_0_19)
  F_CleanBlip(l_0_21)
  F_CleanBlip(l_0_20)
  ItemSetCurrentNum(528, 0)
  ItemSetCurrentNum(507, 0)
  ItemSetCurrentNum(499, 0)
  PedSetUniqueModelStatus(58, l_0_28)
  if l_0_9 ~= nil then
    BlipRemove(l_0_9)
  end
  if l_0_9 ~= nil then
    BlipRemove(l_0_3)
  end
  CameraAllowChange(true)
  CameraReset()
  CameraReturnToPlayer()
  CameraSetWidescreen(false)
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
  CounterMakeHUDVisible(false)
  UnLoadAnimationGroup("2_01LastMinuteShop")
  UnLoadAnimationGroup("NIS_2_01")
  DATUnload(2)
end
 
F_CleanBlip = function(l_8_0)
  if l_8_0 then
    BlipRemove(l_8_0)
    l_8_0 = nil
  end
end
 
F_tIngredientsGet = function()
  local l_9_0, l_9_1, l_9_2 = nil, nil, nil
  local l_9_3 = false
  local l_9_4 = false
  local l_9_5 = false
  local l_9_6 = -1
  local l_9_7 = -1
  local l_9_8 = -1
  local l_9_9, l_9_10, l_9_11 = nil, nil, nil
  repeat
    if not l_0_39.grocery.got and AreaGetVisible() == 26 then
      repeat
        Wait(0)
      until if not PedIsValid(shared.vendettaClerk) or not l_9_5 then
        l_9_8 = PickupCreatePoint(528, POINTLIST._2_01_PLAYERSTORE, 1, 0, "PermanentButes")
        l_9_5 = true
      end
      if PlayerHasItem(528) then
        BlipRemove(l_0_21)
        l_0_39.grocery.got = true
        CounterIncrementCurrent(1)
        if PedIsValid(shared.vendettaClerk) then
          SoundPlayScriptedSpeechEvent(shared.vendettaClerk, "M_2_01", 6, "SpeechX3")
        end
        MissionObjectiveComplete(l_0_31)
        l_9_0 = true
      end
    end
    if l_9_0 and AreaGetVisible() == 0 then
      if CounterGetCurrent() == CounterGetMax() - 1 then
        TextPrint("2_01_OGETREMAIN1", 2.5, 1)
        l_9_0 = false
      else
        TextPrint("2_01_OGETREMAIN", 2.5, 1)
        l_9_0 = false
      end
    end
    if not l_0_39.barber.got and AreaGetVisible() == 39 then
      if not l_9_4 then
        l_9_7 = PickupCreatePoint(499, POINTLIST._2_01_RAZORSPAWN, 1, 0, "PermanentButes")
        l_9_4 = true
      end
      if PickupIsPickedUp(l_9_7) then
        BlipRemove(l_0_20)
        l_0_39.barber.got = true
        CounterIncrementCurrent(1)
        MissionObjectiveComplete(l_0_32)
        l_9_1 = true
      end
    end
    if l_9_1 then
      if PlayerIsInTrigger(TRIGGER._2_01_TUTOFF2) and IsButtonPressed(9, 0) then
        TutorialRemoveMessage()
      end
      if AreaGetVisible() == 0 then
        if CounterGetCurrent() == CounterGetMax() - 1 then
          TextPrint("2_01_OGETREMAIN1", 2.5, 1)
          l_9_1 = false
        else
          TextPrint("2_01_OGETREMAIN", 2.5, 1)
          l_9_1 = false
        end
      end
    end
    if not l_0_39.clothing.got and AreaGetVisible() == 34 then
      if not l_9_3 then
        l_9_6 = PickupCreatePoint(507, POINTLIST._2_01_PANTYSPAWN, 1, 0, "PermanentButes")
        l_9_3 = true
      end
      if PickupIsPickedUp(l_9_6) then
        BlipRemove(blipCloth)
        l_0_39.clothing.got = true
        CounterIncrementCurrent(1)
        MissionObjectiveComplete(l_0_33)
        l_9_2 = true
      end
    end
    if l_9_2 and AreaGetVisible() == 0 then
      if CounterGetCurrent() == CounterGetMax() - 1 then
        TextPrint("2_01_OGETREMAIN1", 2.5, 1)
        l_9_1 = false
      else
        TextPrint("2_01_OGETREMAIN", 2.5, 1)
        l_9_2 = false
      end
    end
    if CounterGetCurrent() == CounterGetMax() then
      l_0_15 = true
      CounterMakeHUDVisible(false)
    end
    Wait(0)
  until l_0_15
  collectgarbage()
end
 
F_tBike = function()
  local l_10_0, l_10_1, l_10_2, l_10_3, l_10_4, l_10_5 = nil, nil, nil, nil, nil, nil
  local l_10_6 = false
  local l_10_7 = false
  repeat
    if not PlayerIsInVehicle(l_0_23) then
      if not l_0_24 then
        l_0_24 = AddBlipForCar(l_0_23, 0, 4)
      end
    elseif PlayerIsInAnyVehicle() and l_0_24 then
      BlipRemove(l_0_24)
      l_0_24 = nil
    end
    if l_0_15 and PlayerIsInTrigger(TRIGGER._AMB_SCHOOL_AREA) then
      l_10_7 = true
      if l_0_24 then
        BlipRemove(l_0_24)
        l_0_24 = nil
      end
    end
    Wait(0)
  until l_10_7
  collectgarbage()
end
 
T_Timer = function()
  MissionTimerStart(325)
  repeat
    if MissionTimerHasFinished() then
      l_0_29 = "2_01_FAILTIME"
      l_0_14 = true
    end
    Wait(0)
  until l_0_13
end
 
F_CinEnding = function()
  PlayerSetControl(0)
  PedSetPosXYZ(gPlayer, -638.70001220703, -269.5, -1.7000000476837)
  CameraSetWidescreen(true)
  PedFaceObject(l_0_1, gPlayer, 3, 1)
  PedFaceObject(gPlayer, l_0_1, 2, 1)
  CameraSetXYZ(-638.61383056641, -271.38647460938, -0.082731001079082, -638.43994140625, -270.41360473633, -0.23510600626469)
  F_MakePlayerSafeForNIS(true, true, true)
  CameraAllowChange(false)
  PedLockTarget(gPlayer, l_0_1, 3)
  PedLockTarget(l_0_1, gPlayer, 3)
  repeat
    Wait(0)
  until RequestModel(370)
  PedLockTarget(gPlayer, l_0_1, 3)
  PedLockTarget(l_0_1, gPlayer, 3)
  SoundPlayScriptedSpeechEvent(gPlayer, "M_2_01", 19, "SpeechX3")
  repeat
    Wait(100)
    PedSetActionNode(gPlayer, "/Global/2_01/Anim/Give/GiveEdna_2_01", "Act/Conv/2_01.act")
  until PedIsPlaying(gPlayer, "/Global/2_01/Anim/Give/GiveEdna_2_01", true)
  repeat
    Wait(0)
  until not PedIsPlaying(gPlayer, "/Global/2_01/Anim/Give/GiveEdna_2_01", true)
  PedLockTarget(gPlayer, l_0_1, 3)
  PedLockTarget(l_0_1, gPlayer, 3)
  CameraSetXYZ(-638.68316650391, -270.42636108398, -0.35699498653412, -638.39971923828, -269.4704284668, -0.28116899728775)
  F_PlaySpeechWait(l_0_1, 20, "/Global/2_01/Anim/EndingNIS/20")
  shared.gEdnaID = l_0_1
  PedMakeAmbient(shared.gEdnaID)
  PedSetMissionCritical(l_0_1, false)
  PedMoveToXYZ(shared.gEdnaID, 0, -629.4033203125, -264.99234008789, -0.66108798980713)
  Wait(100)
  CameraFade(500, 0)
  Wait(501)
  CameraAllowChange(true)
  PlayerSetPosPoint(POINTLIST._2_01_CAFENDPOS, 1)
  CameraSetWidescreen(true)
  Wait(10)
  CameraReset()
  Wait(1)
  CameraSetXYZ(-639.10656738281, -275.26489257813, -0.46272400021553, -639.08819580078, -274.26519775391, -0.45218300819397)
  Wait(10)
  Wait(500)
  CameraFade(500, 1)
  Wait(501)
  MinigameSetCompletion("M_PASS", true, 1500)
  SoundPlayMissionEndMusic(true, 10)
  repeat
    Wait(0)
  until not MinigameIsShowingCompletion()
  CameraFade(500, 0)
  Wait(501)
  CameraReset()
  CameraReturnToPlayer()
  MissionSucceed(false, false, false)
  CameraSetWidescreen(false)
  F_MakePlayerSafeForNIS(false)
  Wait(500)
  CameraFade(500, 1)
  Wait(101)
  PlayerSetControl(1)
end
 
F_CBPlayerEndPath = function(l_13_0, l_13_1, l_13_2)
  if l_13_2 == PathGetLastNode(l_13_1) then
    l_0_27 = true
  end
end
 
F_KillCars = function()
  local l_14_0 = true
  repeat
    if PlayerIsInTrigger(TRIGGER._AMB_BUSINESS_AREA) then
      l_14_0 = false
    end
  until not l_14_0
end
 
F_tBikeManager = function()
  local l_15_0 = nil
  l_0_23 = VehicleCreatePoint(281, POINTLIST._2_01_BIKESPAWN)
  l_0_24 = AddBlipForCar(l_0_23, 0, 4)
  VehicleSetOwner(l_0_23, gPlayer)
  repeat
    if not l_15_0 and PlayerIsInTrigger(TRIGGER._2_01_MOUNTBIKE) then
      l_15_0 = true
    end
    Wait(0)
  until PlayerIsInAnyVehicle() or PlayerIsInTrigger(TRIGGER._AMB_BUSINESS_AREA)
  MissionObjectiveComplete(l_0_30)
  TextPrint("2_01_OFINDITEMS", 3, 1)
  BlipRemove(l_0_24)
  l_0_24 = nil
end
 
F_CreateMissionCharacters = function()
  l_0_1 = PedCreatePoint(58, POINTLIST._2_01_EDNA)
  PedSetFlag(l_0_1, 133, false)
  PedSetMissionCritical(l_0_1, true, cbFail, true)
  PedIgnoreStimuli(l_0_1, true)
end
 
F_CreatePedTable = function(l_17_0)
  for l_17_4 = l_17_0, nil, nil do
    l_17_4.id = PedCreatePoint(l_17_4.model, l_17_4.point, l_17_4.element)
    if l_17_4.animation then
      Wait(0)
    end
  end
end
 
F_tEdnaWalk = function()
  l_0_25 = true
  local l_18_0 = nil
  local l_18_1 = 1
  local l_18_2 = GetTimer()
  l_0_26 = GetTimer()
  repeat
    if l_0_25 and GetTimer() > l_0_26 + 1000 then
      PedSetActionNode(l_0_1, "/Global/2_01/Anim/EdnaShrug", "Act/Conv/2_01.act")
      l_18_0 = math.random(1, table.getn(l_0_18))
      repeat
        l_18_0 = math.random(1, table.getn(l_0_18))
        Wait(0)
      until l_18_0 ~= l_18_1
      PedFollowPath(l_0_1, l_0_18[l_18_0], 3, 0, F_CBShrug)
      l_0_25 = false
      l_18_1 = l_18_0
    end
    Wait(0)
  until l_0_15
  PedStop(l_0_1)
  PedClearObjectives(l_0_1)
end
 
cbFail = function()
  l_0_29 = "2_01_HITEDNA"
  l_0_14 = true
end
 
T_FailCond = function()
  repeat
    Wait(0)
    if PedIsValid(l_0_1) and PedGetWhoHitMeLast(l_0_1) == gPlayer then
      l_0_29 = "2_01_HITEDNA"
      l_0_14 = true
    end
    if l_0_14 then
      if l_0_1 then
        shared.gEdnaID = l_0_1
        PedMakeAmbient(shared.gEdnaID)
      end
      SoundPlayMissionEndMusic(false, 10)
      MissionFail(false, true, l_0_29)
      Wait(50000)
    end
  until l_0_13
end
 
F_CBShrug = function()
  l_0_25 = true
  l_0_26 = GetTimer()
end
 
F_CheckBackToEdna = function()
  local l_22_0, l_22_1, l_22_2 = nil, nil, nil
  repeat
    Wait(0)
  until until PlayerIsInTrigger(TRIGGER._ZONESCHOOL) and not shared.gBusTransition
MissionObjectiveComplete(l_0_34)
l_0_34 = MissionObjectiveAdd("2_01_OBACKEDNA")
TextPrint("2_01_OBACKEDNA", 4, 1)
BlipRemove(l_0_2)
l_0_2 = nil
PedSetPosPoint(l_0_1, POINTLIST._2_01_EDNAFIN)
l_0_2 = AddBlipForChar(l_0_1, 12, 0, 4)
repeat
  Wait(0)
until PlayerIsInTrigger(TRIGGER._2_01_EDNAFACEPLAYER)
PedFaceObject(l_0_1, gPlayer, 3, 1)
repeat
  if not l_0_14 and PlayerIsInAreaObject(l_0_1, 2, 1, 0) then
    if PedIsValid(l_0_1) then
      PedSetInvulnerable(l_0_1, true)
    end
    MissionTimerStop()
    MissionObjectiveComplete(l_0_34)
    F_CinEnding()
    if PedIsValid(l_0_1) then
      PedAddPedToIgnoreList(l_0_1, gPlayer)
      PedSetInvulnerable(l_0_1, false)
      BlipRemove(l_0_2)
    end
  end
  Wait(0)
until l_0_13
end
 
F_StartCinematic = function(l_23_0, l_23_1, l_23_2)
  CameraSetWidescreen(true)
  PlayerSetControl(0)
  PedStop(l_23_0)
  PedStop(gPlayer)
  PedFaceObject(l_23_0, gPlayer, 2, 0)
  PedFaceObject(gPlayer, l_23_0, 2, 0)
  PedStartConversation(l_23_1, l_23_2, gPlayer, l_23_0)
  repeat
    Wait(100)
  until until not PedInConversation(l_23_0) and not PedInConversation(gPlayer)
CameraSetWidescreen(false)
PlayerSetControl(1)
end
 
F_StartCounter = function()
  CounterSetIcon("caflady", "caflady_x")
  CounterMakeHUDVisible(true)
  CounterSetCurrent(0)
  CounterSetMax(3)
end
 
F_BlipCreateXYZ = function(l_25_0, l_25_1, l_25_2)
  local l_25_3 = nil
  l_25_3 = BlipAddXYZ(l_25_0, l_25_1, l_25_2, 0)
  table.insert(l_0_22, {blip = l_25_3})
  return l_25_3
end
 
F_BlipCleanup = function()
  for l_26_3 = l_0_22, nil, nil do
    if l_26_3.blip ~= nil then
      BlipRemove(l_26_3.blip)
    end
  end
  l_0_22 = nil
end
 
F_FindClosestPed = function()
  local l_27_0 = {}
  local l_27_1, l_27_2, l_27_3 = PlayerGetPosXYZ(), {target = -1}, {target = -1}
   -- Overwrote pending register. (Assignments::assign) -- Overwrote pending register. (Assignments::assign)
  local l_27_4 = {target = -1}
   -- Overwrote pending register. (Assignments::assign)
  local l_27_5 = {target = -1}
   -- Overwrote pending register. (Assignments::assign)
  local l_27_6 = {target = -1}
   -- Overwrote pending register. (Assignments::assign)
  local l_27_7 = {target = -1}
   -- Overwrote pending register. (Assignments::assign)
  local l_27_8 = {target = -1}
   -- Overwrote pending register. (Assignments::assign)
  local l_27_9 = l_27_0[6]
  target = PedFindInAreaXYZ(l_27_1, l_27_2, l_27_3, 19)
   -- Attempted to generate an assignment, but got confused about usage of registers. (Assignments::flushPending)
  l_27_4 = table
  l_27_4 = l_27_4.getn
  l_27_5 = l_27_0
  l_27_4 = l_27_4(l_27_5)
  l_27_5 = 1
  l_27_6 = -1
  l_27_4 = l_27_4 - l_27_6
  l_27_7 = PedIsValid
  l_27_8 = l_27_0[l_27_4]
  l_27_8 = l_27_8.target
  l_27_7 = l_27_7(l_27_8)
  if l_27_7 then
    l_27_7 = l_27_0[l_27_4]
    l_27_7 = l_27_7.target
    return l_27_7
  end
end
 
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals)
 -- Confused at declaration of local variable. (Assignments::declareLocals) -- Overwrote pending register. (Assignments::assign)
 -- Overwrote pending register. (Assignments::assign)
 -- Overwrote pending register. (Assignments::assign)
 -- Overwrote pending register. (Assignments::assign)
 -- Confused at declaration of local variable. (Assignments::declareLocals) -- Overwrote pending register. (Assignments::assign)
F_PlaySpeechWait = function()
end
 
T_NIS_Loop = function()
  while 1 do
    if not l_0_41 and F_IsButtonPressedWithDelayCheck(6, 1) then
      if AreaIsDoorLocked("DT_tbusines_BikeShopDoor") then
        AreaSetDoorLocked("DT_tbusines_BikeShopDoor", false)
        TextPrintString("Unlocking Bikeshopdoor", 4, 1)
      else
        AreaSetDoorLocked("DT_tbusines_BikeShopDoor", true)
        TextPrintString("Locking Bikeshopdoor", 4, 1)
      end
    end
    Wait(0)
  end
end
 
F_Clamp = function(l_38_0, l_38_1)
  if l_38_0 <= 0 then
    l_38_0 = l_38_1
  elseif l_38_1 < l_38_0 then
    l_38_0 = 1
  else
  end
  return l_38_0
end
 
F_NISSelect = function()
  if F_IsButtonPressedWithDelayCheck(11, 1) then
    l_0_40 = l_0_40 - 1
    l_0_40 = F_Clamp(l_0_40, l_0_42)
    TextPrintString("NIS: " .. l_0_40, 3, 1)
  elseif F_IsButtonPressedWithDelayCheck(13, 1) then
    l_0_40 = l_0_40 + 1
    l_0_40 = F_Clamp(l_0_40, l_0_42)
    TextPrintString("NIS: " .. l_0_40, 3, 1)
  elseif F_IsButtonPressedWithDelayCheck(6, 1) then
    TextPrintString("run NIS", 3, 1)
    F_RunNIS = l_0_47[l_0_40]
    F_RunNIS()
    TextPrintString("Finished NIS", 4, 1)
    Wait(1000)
  end
end
 
 -- Confused about usage of registers for local variables. (Assignments::releaseLocals)

On line 95, there is a line of code with TutorialShowMessage("TUT_BIKE3", 5000, false)

As you can see, there is no possible way of using this TutorialShowMessage() function in ONLY the lua script. Thus, we'll have to go even deeper.

We are going to need a tool. You can download it here.

Now that you have that, drag it to the <bully root>\Config\Text folder.

Before we can go any further, you must find out what language of Bully you're using. Don't get the British and American confused. Note that in the British version, favor is actually spelled favour (from the 3_03 beta mission).

Now, drag both the .dir and .img (of the language you're using) over the executable file. (BullyLanguageFilesEditor_en.exe)

Once you've done that, a folder should be created with the same name of the .IMG you dragged.


Now, open Notepad++ again, then press CTRL+F, and click the tab "Find in Files"


You also need to know what the tutorial box shows in that part of the mission.

And I know that it definitely has the word "bike" in it, as that was the only tutorial box in the mission. So type the word "bike" in the first textbox, and adjust the perimeters to match your bully folder.

When you click "Find All" this should appear on the bottom of the notepad window:


We can see there are 2. So what do we do now? Well, instead of pulling a trial and error, we can just edit both of them with whatever you want your textbox to say.

Once you've done that, SAVE the file. Now go back to the Text folder. Drag the folder which was generated earlier, over the executable file once more. Now, you should see 2 new files. They should be with a .gv extension.

Delete the original .img and .dir files you used, then rename the .gv files, without the .gv extension. They should be a .dir and .img now.

Almost done. Now, in your script, you can use TutorialShowMessage("TUT_BIKE3", 5000, false) to display the new text you inserted.



I apologize for not uploading more screenshots, but I will try to edit this soon, and make it more detailed and hopefully easier to understand.

If you have further questions, please add me on steam(unknownsoldier1138), or leave a reply asking what you didn't understand.

Offline UltimateGamer9

  • Full Member
  • ***
  • Posts: 190
  • Gender: Male
    • View Profile
Re: Tutorial Boxes
« Reply #1 on: November 10, 2015, 11:11:05 PM »
Great job, but I think it's the same method that I did with the white text.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Tutorial Boxes
« Reply #2 on: November 10, 2015, 11:19:07 PM »
well you asked for TEXT boxes, and this is a text box. And it's a SIMILAR way you did it, but I don't think anyone else has ever done the custom tutorial boxes before I uploaded this. I'm a first. :D

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Tutorial Boxes
« Reply #3 on: November 11, 2015, 05:55:24 AM »
Great tutorial, Unknown.

Offline UltimateGamer9

  • Full Member
  • ***
  • Posts: 190
  • Gender: Male
    • View Profile
Re: Tutorial Boxes
« Reply #4 on: November 11, 2015, 08:10:48 AM »
Thanks for making this tutorial so I can make a boss selector mod. With full styles even tho The Dream Is Dead made this before. But with a bit different features. So I might be doing this. But I need more texts since there's a lot of peds with boss styles. I only found out 8 texts M_PASS,M_FAIL,TUT_BIKE3,2_01_OFINDBIKE,2_01_GOTOBUS,2_01_OGETREMAIN,2_01_OGETREMAIN1 and 2_01_OFINDITEMS. Do you have 3 more? I need 11 texts.
« Last Edit: November 11, 2015, 08:15:15 AM by UltimateGamer9 »

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Tutorial Boxes
« Reply #5 on: November 11, 2015, 02:08:39 PM »
Yeah, i've got every occurrence of it in the Scripts.img. here you go:

Code: [Select]
  C:\Games\BULLY\Scripts\Mods\Decompile\1_02.lua (3 hits)
Line 417:   TutorialShowMessage("TUT_RMGL1", 5000, false)
Line 1275:   TutorialShowMessage("1_02_FightTut", 3500, false)
Line 1277:   TutorialShowMessage("TUT_TARGET01", 4000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\1_02B.lua (11 hits)
Line 413:     TutorialShowMessage("TUT_RUSS01A", 4500, false)
Line 423:     TutorialShowMessage("TUT_RUSS02C", -1, false)
Line 433:     TutorialShowMessage("TUT_RUSS03A", 4500, false)
Line 443:     TutorialShowMessage("TUT_RUSS03C", -1, false)
Line 455:     TutorialShowMessage("TUT_RUSS04A", 5000, false)
Line 553:     TutorialShowMessage("TUT_EUNSOC01", 4500, false)
Line 557:     TutorialShowMessage("TUT_EUNSOC03", -1, false)
Line 598:     TutorialShowMessage("1_02B_TUT09", 6000)
Line 772:   TutorialShowMessage("TUT_PUN01", 4500, false)
Line 774:   TutorialShowMessage("TUT_PUN04", 4500, false)
Line 776:   TutorialShowMessage("TUT_PUN03", 4500, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\1_02C.lua (3 hits)
Line 71:     TutorialShowMessage("TUT_CLASS01", 4500, false)
Line 73:     TutorialShowMessage("TUT_CLASS02", 4500, false)
Line 75:     TutorialShowMessage("TUT_CLASS03", 4500, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\1_03.lua (8 hits)
Line 547:   TutorialShowMessage("TUT_RSPX02", 4500, true)
Line 549:   TutorialShowMessage("TUT_RSPX03", 4500, true)
Line 677:   TutorialShowMessage("TUT_GBIN1")
Line 903:       TutorialShowMessage(l_63_1)
Line 924:         TutorialShowMessage(l_64_2)
Line 928:         TutorialShowMessage(l_64_2)
Line 941:   TutorialShowMessage("1_03_T01")
Line 951:           TutorialShowMessage("1_03_T02")
  C:\Games\BULLY\Scripts\Mods\Decompile\1_06_01.lua (1 hit)
Line 269:   TutorialShowMessage("TUT_TRANX01", 4500, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\1_08.lua (2 hits)
Line 1035:       TutorialShowMessage("1_08_OBJ08", 6000)
Line 1521:   TutorialShowMessage("1_08_OBJ14", 4)
  C:\Games\BULLY\Scripts\Mods\Decompile\1_E01.lua (6 hits)
Line 204:   l_5_5 = TutorialShowMessage
Line 212:   l_5_5 = TutorialShowMessage
Line 240:     TutorialShowMessage("TUT_ERR3", -1, false)
Line 255:     TutorialShowMessage("TUT_ERR4", 4500, false)
Line 262:     TutorialShowMessage("TUT_ERR5", -1, false)
Line 286:     TutorialShowMessage("TUT_ERR6", 4500, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_01.lua (1 hit)
Line 95:     TutorialShowMessage("TUT_BIKE3", 5000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_02.lua (1 hit)
Line 432:     TutorialShowMessage("BIKECOMBAT_TUT01", 6000)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_03.lua (1 hit)
Line 228:         TutorialShowMessage("2_03_22", 4000)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_06.lua (1 hit)
Line 963:       TutorialShowMessage("TUT_APOLOGY1", 4000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_G2.lua (2 hits)
Line 143:     TutorialShowMessage("2_G2_FLOWERTUT", 6000, true)
Line 874:   TutorialShowMessage("2_G2_TUT_01", 6000)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_R03.lua (1 hit)
Line 703:   TutorialShowMessage("2_R03_05", 4000, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_S02.lua (2 hits)
Line 789:   TutorialShowMessage("TUT_SKTC01", 5000, false)
Line 930:   TutorialShowMessage("2_S02_24", 4000)
  C:\Games\BULLY\Scripts\Mods\Decompile\2_S06.lua (1 hit)
Line 724:   TutorialShowMessage("TUT_GIRLD1", 5000)
  C:\Games\BULLY\Scripts\Mods\Decompile\3_01A.lua (1 hit)
Line 246:       TutorialShowMessage("3_01A_WARNING2", -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\3_S10.lua (1 hit)
Line 694:       TutorialShowMessage("3_S10_12", 7000)
  C:\Games\BULLY\Scripts\Mods\Decompile\3_S11.lua (1 hit)
Line 612:     TutorialShowMessage("3_S11_SNEAK", 10000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\4_06.lua (4 hits)
Line 411:     TutorialShowMessage("TUT_BULL1")
Line 1679:           TutorialShowMessage("TUT_MARBX1", 6000)
Line 2109:       TutorialShowMessage("4_06_OBJDANCE", 5000)
Line 2124:       TutorialShowMessage("4_06_OBJDANCE", 5000)
  C:\Games\BULLY\Scripts\Mods\Decompile\4_B2.lua (1 hit)
Line 312:   TutorialShowMessage("4_B2_Tut1", 9500, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\5_B.lua (3 hits)
Line 349:   TutorialShowMessage("5_B_Tut1", 5000, true)
Line 380:         TutorialShowMessage("5_B_Tut2", 5000, true)
Line 470:       TutorialShowMessage("5_B_Tut3", 5000, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\Boxing.lua (1 hit)
Line 192:     TutorialShowMessage("TUT_AQUA1", 5000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassArt.lua (5 hits)
Line 473:       TutorialShowMessage("MGCA_KISS01", -1, true)
Line 481:       TutorialShowMessage("MGCA_KISS02", -1, true)
Line 498:       TutorialShowMessage("MGCA_KISS03", -1, true)
Line 507:       TutorialShowMessage(l_8_3, -1, true)
Line 521:       TutorialShowMessage(l_8_3, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassBiology.lua (1 hit)
Line 301:     TutorialShowMessage(unlockTextRoom, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassChem.lua (2 hits)
Line 387:     TutorialShowMessage("C4_INST01")
Line 709:     TutorialShowMessage(l_12_4, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassEnglish.lua (14 hits)
Line 401:     TutorialShowMessage("MGCE_TUTORIAL01", -1, true)
Line 412:     TutorialShowMessage("MGCE_TUTORIAL02", -1, true)
Line 446:       TutorialShowMessage(l_12_1, -1, true)
Line 458:     TutorialShowMessage("MGCE_TAUNT01", -1, true)
Line 470:     TutorialShowMessage("MGCE_TAUNT02", -1, true)
Line 497:       TutorialShowMessage(l_12_1, -1, true)
Line 512:     TutorialShowMessage("MGCE_PREFAPOL01", -1, true)
Line 523:     TutorialShowMessage("MGCE_PREFAPOL02", -1, true)
Line 554:     TutorialShowMessage("MGCE_TUTORIAL02", -1, true)
Line 583:       TutorialShowMessage(l_12_1, -1, true)
Line 596:     TutorialShowMessage("MGCE_ENG0401", -1, true)
Line 609:     TutorialShowMessage("MGCE_ENG0402", -1, true)
Line 633:       TutorialShowMessage(l_12_1, -1, true)
Line 646:       TutorialShowMessage(l_12_1, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassGeography.lua (1 hit)
Line 287:     TutorialShowMessage(unlockTextRoom, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassMath.lua (1 hit)
Line 914:     TutorialShowMessage(l_10_2, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassPhoto.lua (1 hit)
Line 773:     TutorialShowMessage(l_18_1, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\ClassShop.lua (2 hits)
Line 320:   TutorialShowMessage("C6_INST01")
Line 486:       TutorialShowMessage(l_7_21, -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\Copy of 1_01.lua (2 hits)
Line 242:   TutorialShowMessage("TUT_START1A", 4500, false)
Line 244:   TutorialShowMessage("TUT_START1B", 4500, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\DodgeballGame.lua (2 hits)
Line 571:               TutorialShowMessage("DB_TUT_HOLDBALL", 5000)
Line 693:       TutorialShowMessage("DB_UNLOCK01", -1, true)
  C:\Games\BULLY\Scripts\Mods\Decompile\FreakShow.lua (1 hit)
Line 241:     TutorialShowMessage("MIF_BET01")
  C:\Games\BULLY\Scripts\Mods\Decompile\GoKartRaces.lua (1 hit)
Line 263:   TutorialShowMessage("TUT_PSLIDE", 4000)
  C:\Games\BULLY\Scripts\Mods\Decompile\GraffitiCleanup.lua (1 hit)
Line 531:       TutorialShowMessage("TUT_GP_02", 6000)
  C:\Games\BULLY\Scripts\Mods\Decompile\LawnMowing.lua (3 hits)
Line 1240:     TutorialShowMessage(gTutorialMessage, 8000)
Line 1243:       TutorialShowMessage(gTutorialMessage2, 8000)
Line 1252:   TutorialShowMessage("TUT_LMP_03", 8000)
  C:\Games\BULLY\Scripts\Mods\Decompile\MGHacky.lua (2 hits)
Line 210:   TutorialShowMessage("MGSK_11", 5000)
Line 339:   TutorialShowMessage("MGSK_21")
  C:\Games\BULLY\Scripts\Mods\Decompile\MGSocPen.lua (2 hits)
Line 114:     TutorialShowMessage("MGSP_INST")
Line 342:   TutorialShowMessage("MGSP_BTUT")
  C:\Games\BULLY\Scripts\Mods\Decompile\PriOff.lua (1 hit)
Line 59:     TutorialShowMessage("TUT_NOW01", 5000, false)
  C:\Games\BULLY\Scripts\Mods\Decompile\P_Snow.lua (1 hit)
Line 65:   TutorialShowMessage("TUT_SP_01", 7000)
  C:\Games\BULLY\Scripts\Mods\Decompile\SGlFunc.lua (1 hit)
Line 494:   TutorialShowMessage(l_43_0)
  C:\Games\BULLY\Scripts\Mods\Decompile\SScriptTracks.lua (1 hit)
Line 351:     TutorialShowMessage("CHEMSET_FULL", 3000)
  C:\Games\BULLY\Scripts\Mods\Decompile\SStores.lua (1 hit)
Line 134:           TutorialShowMessage("TUT_VESPA", 5000)
  C:\Games\BULLY\Scripts\Mods\Decompile\Wrestling1.lua (1 hit)
Line 747:         TutorialShowMessage("C3_01_03", 4000)

Ignore the other arguments in the function (like the numbers, and true/false)