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


Author Topic: Setting styles through lua without creating them  (Read 2286 times)

0 Members and 1 Guest are viewing this topic.

Offline UltimateGamer9

  • Full Member
  • ***
  • Posts: 190
  • Gender: Male
    • View Profile
Setting styles through lua without creating them
« on: September 02, 2015, 12:38:03 PM »
How do I set styles without creating them with STimeCycle.lur script?

Offline boyser

  • Wazzzuuupppp
  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • THE REAL G IS ME
    • View Profile
Re: Setting styles through lua without creating them
« Reply #1 on: September 02, 2015, 12:40:12 PM »
create them in arcrace.lur :D

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Setting styles through lua without creating them
« Reply #2 on: September 02, 2015, 04:33:47 PM »
changing them in the ide.img is easy, but not easy to explain.

OR you could try to make a hook, which from what I know, not a lot of people have(me neither)

Offline UltimateGamer9

  • Full Member
  • ***
  • Posts: 190
  • Gender: Male
    • View Profile
Re: Setting styles through lua without creating them
« Reply #3 on: September 02, 2015, 10:35:04 PM »
changing them in the ide.img is easy, but not easy to explain.

OR you could try to make a hook, which from what I know, not a lot of people have(me neither)
can you help me for norton and mascot boss style with ai?

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Setting styles through lua without creating them
« Reply #4 on: September 02, 2015, 10:53:13 PM »
Use the PedSetActionTree function to set a ped's action tree. Basically action tree being root of all the ped's actions, which determines the actions (and moves) the ped can perform. It's basically the fighting style. If you set an NPC's action tree on the player though, you won't be able to use all his moves normally as you would be able to with the player's style. This is because the controller/keyboard is only meant to activate certain actions the player action tree has. Some moves will work with NPC action trees but not all. Because of this problem people started to set action nodes (using PedSetActionNode) when they wanted to have the player play a move that he couldn't normally perform with just the action tree set. You can experiment with different action trees and find for yourself which moves you can and can't do while using the action tree with the player.

PedSetActionTree(ped,root,file)
ped: the ped to set the action tree on. Use gPlayer for the player.
root: the action tree's root, which luckily follows the same format for all npc action trees. Just "/Global/" followed by the style name. Example: "/Global/G_Grappler_A"
file: the action file (.act file). All of them are in the same directory, "Act/Anim", so you won't have to do anything special to find the location of the file but just know the name. The name is pretty simple too though, it's just the style name with a .act file extension. Example: "Act/Anim/G_Grappler_A.act"

Load animation groups too using LoadAnimationGroup("group"). Animation group names can be found in /Stream/World.img. They have the extension .agr.