Bully-Board

Bully Modding Section => Script Modding => Topic started by: Gustavinzaum on November 30, 2013, 09:20:00 AM

Title: My first work through Lua
Post by: Gustavinzaum on November 30, 2013, 09:20:00 AM
Hello bully modders, today i'll show you my first mod made by using Lua, It may be easier for you, but a great step for me
Hope you guys enjoy, and if you want a different fight, just reply on that post  :biggrin:

Bully SE Fight: Darby (Boss Style) vs Bryce (Boss Style) (http://www.youtube.com/watch?v=jvDPFZeI918#)

Title: Re: My first work through Lua
Post by: denifarropilha on November 30, 2013, 11:33:24 AM
GOOD WORK!!!!!!!!!!!!!!!!!!!!!!!!!
Title: Re: My first work through Lua
Post by: Gustavinzaum on November 30, 2013, 11:48:18 AM
GOOD WORK!!!!!!!!!!!!!!!!!!!!!!!!!
Just thanks to u ;3
Title: Re: My first work through Lua
Post by: SWEGTA on November 30, 2013, 12:12:39 PM
Nice work.
Title: Re: My first work through Lua
Post by: c00ld0c26 on November 30, 2013, 12:19:09 PM
Great work so far.
Try mixing styles now, like have Darby's boss style and make him randomly do Johnny's kick, Powerbomb ect... It will be a great expirience and second goal for your scripting skill development.
Title: Re: My first work through Lua
Post by: Gustavinzaum on November 30, 2013, 12:34:00 PM
Great work so far.
Try mixing styles now, like have Darby's boss style and make him randomly do Johnny's kick, Powerbomb ect... It will be a great expirience and second goal for your scripting skill development.
Thanks, I'll try
Title: Re: My first work through Lua
Post by: Gustavinzaum on November 30, 2013, 12:35:12 PM
Nice work.
Many thanks  :)
Title: Re: My first work through Lua
Post by: MadmaN on December 02, 2013, 04:11:54 PM
Nicely done there m8!

I just love seeing all the things everyone has been working on for bully since it just proves that there is a nearly endless amount of possabilities for mods since even tho there has been a few 'front runners' in the community that started off with some amazing releases.....trust me when I say...: we have only just barely scratched the surface of what this game really is capable of.
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 02, 2013, 06:32:26 PM
Nicely done there m8!

I just love seeing all the things everyone has been working on for bully since it just proves that there is a nearly endless amount of possabilities for mods since even tho there has been a few 'front runners' in the community that started off with some amazing releases.....trust me when I say...: we have only just barely scratched the surface of what this game really is capable of.
I believe that will arrive a day when Bully can be full moddable  :cool:
Title: Re: My first work through Lua
Post by: MadmaN on December 02, 2013, 11:44:17 PM
It will be.

As long as there is interest in the game....it will be modded till people grow sick of it.
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 03, 2013, 02:16:47 PM
Nice work! :)


I would like to see Russel(Boss) vs Edgar boss.   

:)
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 04, 2013, 10:16:46 AM
Nice work! :)


I would like to see Russel(Boss) vs Edgar boss.   

:)
How weird, When I put Edgar to spawn, no one other ped can be.. Why?  :wacko:
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 04, 2013, 01:50:06 PM
Explain more so i can help you.
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 04, 2013, 02:10:29 PM
Explain more so i can help you.
If I create an Edgar ped to spawn, all the other peds I've created too do not spawn, but if I change Edgar by another character with a different id(of cours) it spawn and do everything i've programmed.
What could it be?  :hmm:
Title: Re: My first work through Lua
Post by: c00ld0c26 on December 04, 2013, 03:20:12 PM
We cant really help you without the codes.
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 04, 2013, 04:23:47 PM
yea send your script
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 06, 2013, 11:15:31 AM
Okay, heres my script

Code: [Select]
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = -550 -- X coords
  local l_1_1 = 133.3 -- Y coords
  local l_1_2 = 46.14702988 -- Z coords
 
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(32, l_1_0, l_1_1, l_1_2)
 
  SoundPlayStream("MS_DishonorableFight.rsm", 0.3)
 
end
 
Prep = function()

Bif = PedCreateXYZ(33, -544, 130, 46)

PedSetHealth(Bif, 800)

PedSetActionTree(Bif,"/Global/P_Bif","Act/Anim/P_Bif.act")

LoadActionTree("P_Bif")
LoadAnimationGroup("Boxing")
end
 
Towny = function()

Edgar = PedCreateXYZ(91, -544, 130, 46)

PedSetHealth(Edgar, 800)

PedSetActionTree(Edgar,"/Global/DO_Striker_A","Act/Anim/DO_Striker_A.act")

LoadActionTree("DO_Striker")
LoadAnimationGroup("DO_Striker")
 end
 
Bully = function()

Russell = PedCreateXYZ(75, -545, 135, 46)

PedSetStatsType(Russell,"STAT_BOSS_RUSSELL")

PedSetActionTree(Russell,"/Global/BOSS_Russell","Act/Anim/BOSS_Russell.act")

PedSetHealth(Russell, 800)

LoadActionTree("BOSS_Russell")
LoadAnimationGroup("BOSS_Russell")
end
 
Ted = function()
 
 Jock = PedCreateXYZ(19, -544, 130, 46)
 
 PedSetActionTree(Jock,"/Global/J_Ted","Act/Anim/J_Ted.act")
 
 PedSetHealth(Jock, 500)
 
 LoadActionTree("J_Ted")
 LoadAnimationGroup("J_Ted")
 end
 
Ass = function()

Darby = PedCreateXYZ(37, -545, 135, 46)

PedSetActionTree(Darby,"/Global/BOSS_Darby","Act/Anim/BOSS_Darby.act")

PedSetHealth(Darby, 800)

LoadActionTree("BOSS_Darby")
LoadAnimationGroup("Boxing")
LoadAnimationGroup("BOSS_Darby")
end

main = function() -- Main mission function

Towny()
Bully()

  PedAttack(Edgar, Russell, 3)
  PedAttack(Russell, Edgar, 3)
 
end

Edit: Now it worked, i was trying to put ActionTree("DO_Edgar") and his AI
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 06, 2013, 01:32:03 PM
Code: [Select]
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
 
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
 
 Jock = PedCreateXYZ(19, -544, 130, 46)
 PedSetActionTree(Jock,"/Global/J_Ted","Act/Anim/J_Ted.act")
 PedSetHealth(Jock, 500)
  Darby = PedCreateXYZ(37, -545, 135, 46)
PedSetActionTree(Darby,"/Global/BOSS_Darby","Act/Anim/BOSS_Darby.act")
PedSetHealth(Darby, 800)
Russell = PedCreateXYZ(75, -545, 135, 46)
PedSetStatsType(Russell,"STAT_BOSS_RUSSELL")
PedSetActionTree(Russell,"/Global/BOSS_Russell","Act/Anim/BOSS_Russell.act")
PedSetHealth(Russell, 800)
  PedAttack(Edgar, Russell, 3)
  PedAttack(Russell, Edgar, 3)
end
 
MissionCleanup = function()
end -- end statement
 
main = function() -- Main mission function
SoundPlayStream("MS_DishonorableFight.rsm", 0.3)
LoadActionTree("BOSS_Russell")
LoadAnimationGroup("BOSS_Russell")
LoadActionTree("BOSS_Darby")
LoadAnimationGroup("Boxing")
LoadAnimationGroup("BOSS_Darby")
LoadActionTree("J_Ted")
  repeat
    Wait(0)
  until l_0_0 ~= false
  Wait(3000)
  MissionSucceed()
end
 

I think i fixed it. idk.  xD
(playing assasin creed at same tame)

EDIT BY: |XF|-MadmaN [AR]
I edited your post to put the code into the # bb tags so it is much much easier to read and follow. Please try to use that tag if you can in future posts when it comes to posting any lua scripting.  :biggrin:
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 06, 2013, 04:18:31 PM
There is no difference by putting it together or not xD
I've just made alot of functions cuz its boring by changing all of it every time. xD
However, thanks for trying to help, and here's your fight request (I got using PedSetActionTree(Edgar, "/Global/DO_Edgar... ( ͡° ͜ʖ ͡°)
Watch in 480p  ;D

https://www.youtube.com/watch?v=_Rn1tJPI6Xk (https://www.youtube.com/watch?v=_Rn1tJPI6Xk)
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 07, 2013, 04:16:08 AM
LOOOOL


No need for functions unless you dont want to bind a button or something else
Title: Re: My first work through Lua
Post by: c00ld0c26 on December 07, 2013, 10:03:41 AM
LOOOOL


No need for functions unless you dont want to bind a button or something else

Not really.
Functions can be used for a lot of things.
Rockstar games has like 100000000000 functions in 1 mission script so... U can use it for literly anything.
Title: Re: My first work through Lua
Post by: Mick3Mouse on December 07, 2013, 12:57:50 PM
No Need for functions, if you are new to lua you shouldnt use functions to spawn peds and stuf
Title: Re: My first work through Lua
Post by: Gustavinzaum on December 07, 2013, 04:43:10 PM
No Need for functions, if you are new to lua you shouldnt use functions to spawn peds and stuf
I learn faster  :)
Now I preffer to make mods or tests with STimeCycle script, I think its pretty better
My objective for now is find fighting moves for ActionNode, searching through .car archives inside Act.img
Title: Re: My first work through Lua
Post by: denifarropilha on December 08, 2013, 02:10:31 PM
No Need for functions, if you are new to lua you shouldnt use functions to spawn peds and stuf
I learn faster  :)
Now I preffer to make mods or tests with STimeCycle script, I think its pretty better
My objective for now is find fighting moves for ActionNode, searching through .car archives inside Act.img
sure, .car archives are better because you can use it to go to school more faster
Title: Re: My first work through Lua
Post by: MadmaN on December 11, 2013, 04:13:24 PM
No Need for functions, if you are new to lua you shouldnt use functions to spawn peds and stuf
I learn faster  :)
Now I preffer to make mods or tests with STimeCycle script, I think its pretty better
My objective for now is find fighting moves for ActionNode, searching through .car archives inside Act.img

I think you mean .cat archives....heh

I can shed a lot of light on this subject if you want to attempt tackling the task of extracting them. I managed to partially extract one when I was working on coding a extractor for them while trying to reverse engineer their format but failed...namely due to taking on way too much at one time and the fact that only Rise and I have been trying to figure them out. No-one has attempted this yet to my knowledge and it is a difficult task to try to take on.

Here is the basic structure of those files since both Rise and I figured that part out.

Each .cat file is very similar to a normal archive except its not exactly a compression that I can see. They are more like a container file based on what I was able to figure out (not 100% positive about this yet) but inside each .cat file there is a plain text index file that is able to be edited via notepad and this index file basicly is the master setup file for each .cat file. Inside each of those files is a series of folders that have the root name of each animation that is inside said .cat file. Most of these folders have the names of the root portion of the animation/action tree that is usually accessed either via IDE or by lua if you bypass IDE and will have names like, heavyattacks, lightattacks, kick, powerbomb, etc and so forth and inside each of those folders is a binary animation file that allows that animation or move to be used.

Once we are able to not only extract the contents of these .cat files but also create our own from the files extracted from others...we will then be able to do complete custom animation sets per ped and also get all attacks flawlessly working without a ton of extra lua coding. This also will allow getting full strafes working too for the player since the .cat file for the player has a few missing entries which has certain things disabled...namely with the attacks since the player only has a partial range of attacks where the other peds have the complete full range which is why there is such a problem getting every style working fully without problems...this includes the boss styles and wrestling/mascot styles too.

Creating custom styles would be simple since it would be just a matter of swapping around the folders and their contents around each of the .cat files and editing the text index file accordingly and creating a new .cat file from the modded files. If Rise gives me permission I can post the contents of one .cat archive he managed to reconstruct by hand from info gathered from the game files themselves and a lot of best guessing and maybe this might help in possibly finding out something he and I don't know yet since this format has been a thorn in our collective sides since the start and after this...the only other thing left to crack is the encoding used in the .idb files of which the .ide files are the plain text sources....rockstar kinda goofed including all the .ide files with the pc version of bully since the console versions do not have these files included.
Title: Re: My first work through Lua
Post by: Craig Tucker on December 13, 2013, 11:15:32 PM
great mod dude
Like what you did
  :)  :jajaja: