Bully-Board
Bully Modding Section => Bully Modding => TUTORIALS => Topic started by: DaBOSS54320 on July 03, 2013, 06:52:54 AM
-
I have updated this tutorial to simplify it.
The below code is source code of a STimeCycle.lur script (Thanks to |XF|-MadmaN[AR] for releasing the source of the original STimeCycle.lur script). This script, as it suggests is related the the time cycle of the game. Thus, always running (Yes even before the clock is displayed on screen in the tutorial mission) Copy and paste it into notepad++ and then treat the main function as you would if you were putting it into a ArcRace1.lur script (Assuming you did that before this tutorial).
Tip: You cannot use MissionSetup function or MissionCleanup function. You can make a function for setting things up, but not by those names. They are not called in this script.
I have slightly modified some code here and inserted notes.
main = function()
Wait(500) -- Wait 0.5 seconds. This is needed for some scenarios.
-- Setup code goes here.
repeat
-- Constantly running code goes here.
Wait(0) -- Waits 0 seconds. Seems pointless but leave this in!
until not Alive
end
-- In most cases, you can ignore everything below here
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()
end
F_EndMorning = function()
F_UpdateTimeCycle()
end
F_StartLunch = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
F_UpdateTimeCycle()
return
end
F_UpdateTimeCycle()
end
F_EndLunch = function()
F_UpdateTimeCycle()
end
F_StartAfternoon = function()
F_UpdateTimeCycle()
end
F_EndAfternoon = function()
F_UpdateTimeCycle()
end
F_StartEvening = function()
F_UpdateTimeCycle()
end
F_EndEvening = function()
F_UpdateTimeCycle()
end
F_StartCurfew_SlightlyTired = function()
F_UpdateTimeCycle()
end
F_StartCurfew_Tired = function()
F_UpdateTimeCycle()
end
F_StartCurfew_MoreTired = function()
F_UpdateTimeCycle()
end
F_StartCurfew_TooTired = function()
F_UpdateTimeCycle()
end
F_EndCurfew_TooTired = function()
F_UpdateTimeCycle()
end
F_EndTired = function()
F_UpdateTimeCycle()
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
-
Is Mad okey that u post this?
-
I am ok with this.
However I will not allow the secret to changing player skins to be made public. I want the modding community to discover that secret on their own since it will just ruin everything Rise and I have worked for these past couple years on making a player model selector mod.
-
Great, now Darby's code is released.
Hope Rise is okay with that.
-
:D
-
Well
I admit, Mad teached me this and asked me not to release, thats why I ask but, Walter, u sure he said he isn't okey with it? Cuz he just posted that he is okey with this.
-
Nice work DaBoss. Your work is awesome.
It's not his work.
-
Mad is the one who found this.
He explained me how to do this quite long ago, I guess I can tell since DaBOSS just did a tutorial on this well...
-
Rise to honor is not okey with this
Madman already says he was ok with this.
-
I just noticed the Derby code. I edited it out.
-
loadanimationgroup dont work in free mode..
anyone has any suggestion..?
-
it works, you just type it wrong. Becuz mine worked
-
How the hell is that important?
-
Another about to break out
-
I AM ok with releasing how to run lua scripts this way since this method is not exactly something I wish to hold back from the community.
Rise happens to be the one who originally figured this method out and he then taught me how to do it and he deserves the credit for it not me.
The only thing I can take credit for is teaching DaBOSS54320 and a couple others how to do this.
I have no idea if Rise is/was ok with this since I did kinda forget to ask him about it....but since the cat is outta the bag anyways on this I don't think it will hurt much.
Rise and I however will be coming up with a way better way to load our own scripts up since this method IS flawed and does not work perfectly so please use this method with caution.
The following bugs exist with this specific method:
- If you get busted the loaded script will reset and not load back up. The only way to load it back up is to load from a save.
- If you pass out or get knocked out....the same thing above will happen.
Meanwhile...I will be looking into a way to embed a mod menu directly into the ingame menu for executing any mods which should make things much easier....but this will take some time and careful planning.
I will be talking to Rise about this and see what we can do. I also am currently looking into adding some things from the original canis canem edit which were removed from Bully: Scholarship Edition...but this also will take some time.
As soon as I redo my main system (the one I am on now) I will release some things for everyone.....a new .IMG editing tool which is command line only...but it has its own shell so it should not be too hard to figure out how to use this.....it also has batch file support to automate use and it is way better then the Bully Img Editor that I long ago released...but it is NOT meant as a full replacement for that....however it is meant as a companion tool and I have already released it for testing to one person already.
I also will be releasing a few more .lua script sources that are original scripts from Bully and will try to comment them so everyone has a way to understand how those work a bit easier.
I also am working as fast as I can to write and release a excel spreadsheet that will detail all of the lua commands and their full syntax (minus a couple things like the player model switching codes) since I still wish everyone to figure that out on their own due to how long Rise and I have worked on this mod.
-
@romeos2013 and Evolution
It would be best if the two of you wish to argue to do it via pm or somewhere else since this will turn people away from the subject of this topic.
-
How the hell is that important?
then why you talked to me in the first place?
Romeos knock it off.
Mad, Romeos starts the argues doing : "Do I know you?" ect...
also :
Well, Ye, You teached me this before DaB0ss released that.
When this got released I got shocked, cuz I remembered Mad, that u asked me not to share this currectly.
Propebly wanted to test this around before u release.
Anyway, Good Job guys.
-
Ok
sorry Madman
Apology accepted m8. 8)
I just don't like to see arguing like that since it really just serves no purpose in the end. Much like most of the violence in the world today. Just makes more problems then before each time....rofl.
Well, Ye, You teached me this before DaB0ss released that.
When this got released I got shocked, cuz I remembered Mad, that u asked me not to share this currectly.
Propebly wanted to test this around before u release.
Anyway, Good Job guys.
I really didn't wish this to be released really for some time so I could figure out a way thats much more stable and guaranteed to work each time.....but the method I showed DaBoss happens to be a alternate way that I long knew about that loads scripts the same way that Rise and I have been doing for some time now...only the way he and I have been doing this differs a bit. But this method gives the same exact result.
-
RESPONDING TO ALL ABOVE REPLIES!
I have discovered this by myself, it is madman's original and I infact did know this, but did not ask him about it. I figured this out myself, I also got the source script for STimeCycle.lur i in one of mad's posts (As said in my post)
Mad, I would appreciate you confirming this message a bit so that people are aware of the facts.
And to Mad, sorry to argue with you but you must remember thing's wrong, I actually did figure this out myself. You didn't teach me. You may be confusing me with another person you taught.
This info has been modified into my original post.
-
I just noticed the Derby code. I edited it out.
Didn't know you wanted to hide action nodes too. The Grim Peeper taught me about action nodes.
-
DaBOSS54320 (Me)
Do you mind if I post a tutorial on running scripts in freemode?
Rise to Honor
yeah if you put credit
Rise to Honor was the original one to find this mod. Note: He didn't teach me, he just found it before me. I originally though madman found it.
-
It's not me that wants action nodes hidden, it's Rise to Honor. Grim Peeper learned most, if not all of it, from him.
So for now, it has to remain a secret. So please, keep it that way. I don't want hostilities to break out over this.
-
RESPONDING TO ALL ABOVE REPLIES!
I have discovered this by myself, it is madman's original and I infact did know this, but did not ask him about it. I figured this out myself, I also got the source script for STimeCycle.lur i in one of mad's posts (As said in my post)
Mad, I would appreciate you confirming this message a bit so that people are aware of the facts.
And to Mad, sorry to argue with you but you must remember thing's wrong, I actually did figure this out myself. You didn't teach me. You may be confusing me with another person you taught.
This info has been modified into my original post.
My apologies for getting slightly mixed up about that....lol
I shall stand corrected on that since I have taught quite a few people various little tidbits and I do at times get things confused due to my really shit memory which tends to fail me at the worst possible times....hah.
-
^ That's very understandable, I know that you help a lot of people at once. Who doesn't mess up every once in a while?
-
i've tried this method in my bodyguard script but why it not working.?
i mean the bodyguard do not spawn.
-
^ I've had trouble with spawning too. I usually use this to disable punishments, put in action nodes, switch fighting styles, etc. I know it's probably possible to spawn though. Try to make it by pressing a button they spawn. if IsButtonPressed(0,0)
-
Nice :) It looks useful to use :cheernutz:
-
(i'm typing this so i dont need to go to 2nd site evrytime i go here. sorry)
-
(i'm typing this so i dont need to go to 2nd site evrytime i go here. sorry)
(http://lepakjackwedding.files.wordpress.com/2014/02/dancing_potato_gif_by_artist119-d634szy.gif)
Did this because of you.
-
how sexy