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


Author Topic: My first work through Lua  (Read 6213 times)

0 Members and 1 Guest are viewing this topic.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: My first work through Lua
« Reply #15 on: December 04, 2013, 04:23:47 PM »
yea send your script

Offline Gustavinzaum

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
Re: My first work through Lua
« Reply #16 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
« Last Edit: December 06, 2013, 11:33:55 AM by Gustavinzaum »

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: My first work through Lua
« Reply #17 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:
« Last Edit: December 11, 2013, 04:01:50 PM by |XF|-MadmaN[AR] »

Offline Gustavinzaum

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
Re: My first work through Lua
« Reply #18 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

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: My first work through Lua
« Reply #19 on: December 07, 2013, 04:16:08 AM »
LOOOOL


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

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,136
  • Gender: Male
  • Any lua questions? Dont be shy, Ask me!
    • View Profile
    • My channel.
Re: My first work through Lua
« Reply #20 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.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: My first work through Lua
« Reply #21 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

Offline Gustavinzaum

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
Re: My first work through Lua
« Reply #22 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

Offline denifarropilha

  • LUA Modder 8)
  • Jr. Member
  • **
  • Posts: 24
  • Gender: Male
  • I'm a friendly brazilian bully modder :D
    • View Profile
Re: My first work through Lua
« Reply #23 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

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: My first work through Lua
« Reply #24 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.

Offline Craig Tucker

  • We,ve drawn a blank
  • Jr. Member
  • **
  • Posts: 73
  • Gender: Male
  • I suck at creating scripts
    • View Profile
    • My youtube
Re: My first work through Lua
« Reply #25 on: December 13, 2013, 11:15:32 PM »
great mod dude Like what you did  :)  :jajaja: