Bully-Board
Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: Mick3Mouse on February 27, 2015, 11:59:01 AM
-
Just out of curiosity.. what makes for example "PedAttack" make them attack? Like where does it say that code is an attack code? Is it the Gamebyro engine that is scripted that way or what?
:p
-
As far as I know it's a built in function so rockstar (or any other company with their own games) doesn't have to program the same things over and over again (like programing a ped to attack the player instead of just using PedAttack). However I don't know how it is made or where it is stated how it does work.
-
PedAttack is a shortening. It's connected to a function Rockstar wrote, and even that is connected to some other language. It all goes back to 0's and 1's. Similar to your OS.
-
The function is called within test scripts inside the game all functions are run on test scripts before fully loaded this is how the scripts.img and act.img are loaded. The act.img most preferably has these functions in them. All actionodes are scripted within certain scripts inside files in the games folders.
-
Ya, but it's it like possible to replace PedAttack with PedWander for example?
It would be cool, and useless too. But just for the lulz
-
Action nodes are just strings that each ped has, defining their current action. The game reads this string to make the ped perform necessary animations/movements/attacks.
PedAttack, is a LUA function. The game uses LUA 4.0 as a scripting language to make things happen in the game. Certain functions in the Bully.exe are named a little bit differently, but they have LUA bindings for the functions to be usable by LUA. So Bully.exe runs scripts with the LUA 4.0 interpreter, which reads functions from the script, functions binded to do things in the EXE like set a ped's current coordinates, make them attack, bla bla bla.
Normally LUA is a scripting language that would get it's source read and interpreted, but in Bully, they need to get compiled, then the compiled code gets interpreted instead. This was done by Rockstar to prevent modding (didn't work though...)
"Interpret" btw basically means for an application (Bully.exe) to read a script, and perform some action based on what is in the script.
However... remember this:
You won't be able to get a completely detailed and 100% accurate answer however unless you got a Rockstar developer to come on and answer, one who made the way LUA scripts get interpreted by the game.
Or if the EXE is decompiled good enough to where it's code is readable enough to get answers... but decompiling isn't exactly the easiest thing to do, and still can be hard to get our answer even with decompiled code as decompiled code isn't perfectly readable.