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


Author Topic: What makes the code do the code  (Read 2215 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
What makes the code do the code
« 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

deadpoolXYZ

  • Guest
Re: What makes the code do the code
« Reply #1 on: February 27, 2015, 12:45:42 PM »
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.

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: What makes the code do the code
« Reply #2 on: February 27, 2015, 04:18:55 PM »
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.

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: What makes the code do the code
« Reply #3 on: February 27, 2015, 05:44:55 PM »
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.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: What makes the code do the code
« Reply #4 on: February 27, 2015, 05:55:06 PM »
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

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: What makes the code do the code
« Reply #5 on: February 27, 2015, 06:03:59 PM »
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.
« Last Edit: February 27, 2015, 06:05:54 PM by DaBOSS54320 »