eezstreet Posted January 12, 2018 Posted January 12, 2018 I got a request to make the AI Workshop from JK:Enhanced standalone. So I did that, seeing as how it was super straightforward. It will be available to download here, as soon as it is approved: https://jkhub.org/files/file/3384-ai-workshop/alternate download link available here: https://www.dropbox.com/s/acz86nkz4u76rcs/AIWorkshop.zip?dl=0 What does this do?It adds over 30 fifty commands to the game for manipulating the AI.Additionally it adds a display which shows detailed statistics about NPCs.AND as a bonus I have increased the veh, vwp, sab, and npc limits by 16x.AND I've added an "npc spawn random" command which spawns random NPCs.and a cvar to make it so that friendly NPCs dont follow you by default What commands are there?Just a note, none of these commands have any restrictions. Meaning, you can do silly stuff like giving mouse droids lightsabers and have them shoot lightning at each other. I did not add the ability to add new waypoints to maps because the waypoint system is different in JKA from JK2 and this is more or less a straight port by redsaurus. Here are the commands:aiworkshop - enable/disable the workshopworkshop_commands - show all commands in the consoleworkshop_cmdhelp - gets help for a commandworkshop_toggle_display - toggle the visualsworkshop_select - selects the NPC in your crosshairs. Only one NPC can be targeted at a time.workshop_deselect - deselects the selected NPCworkshop_list_bstates - lists all of the Behavior States in the game, e.g. BS_CINEMATICworkshop_list_scriptflags - lists all of the scriptflags that can be assigned to an AIworkshop_list_teams - lists all of the teams that an AI can belong toworkshop_list_aiflags - lists all of the AI flagsworkshop_list_classes - lists all of the classes, eg CLASS_STORMTROOPERworkshop_list_ranks - lists all of the usable ranksworkshop_list_movetypes - lists all of the movement types that you can assign to an NPCworkshop_list_forcepowers - lists all of the force powers that can be given to an NPCworkshop_list_bsets - lists all of the Behavior Sets in the game, eg BSET_ANGER, BSET_VICTORY, etcworkshop_view_timers - lists all active timers on the selected NPCworkshop_set_timer <timername> <milliseconds> - sets a timer on the selected NPCworkshop_set_bstate <bstate> - sets the bstate of an NPC. This can be used to make an NPC follow the player, make the NPC do nothing, make the NPC stand guard, make the NPC hunt down enemies, etc etc. You'll want to experiment with different BS_ types.workshop_set_goalent - sets the entity in the crosshairs as the current "goal entity". If you are targetting an item, this seems to make them go and pick it up. Or sometimes follow an NPC. It seems to vary based on context.workshop_set_leader - sets the entity in the crosshairs as the "leader". If an NPC is in BS_FOLLOW_LEADER, they will follow this target and flee from enemies when it diesworkshop_set_enemy - sets the entity in the crosshairs as the "enemy". The NPC will attack it.workshop_set_scriptflags - sets the NPC's scriptflagsworkshop_set_weapon <weapon, or "me"> - sets the weapon that the enemy is using. This can be for e.g. WP_BRYAR_PISTOL, WP_SABER, WP_DISRUPTOR, etc. If you use "me" as a parameter it will set it to the weapon that you have equipped.workshop_set_team <team> - sets the NPC's "team"workshop_set_enemyteam <team> - sets the NPC's "enemy team", or who they will consider as enemiesworkshop_set_aiflags <flags> - sets AI flags. I don't know what these are used for.workshop_set_class <class> - sets the class type. This can alter behavior in some cases, especially when used on droids or animals like wampas.workshop_set_rank <rank> - sets the rank. For the most part this has only subtle changes.workshop_set_movetype <movetype> - sets the movement type. For instance, you can make probe droids skid around on the ground, etcworkshop_set_forcepower <power> <rank> - sets a force power's rank for the NPC. It doesn't mean that they'll necessarily use it, though.workshop_set_bsetscript <bset> <path to ICARUS script> - tell the game to run a script when a certain bset gets activated. This would be like setting angerscript on an NPC, as an example.workshop_set_parm <parm number> <value> - set a value that can be read by icarus with GET_PARM1 for exampleworkshop_play_dialogue <path to sound file> - make the NPC speak !workshop_activate_bset <bset> - activates a behavior set and triggers the scripts associated with that bsetworkshop_god - toggle godmode on an NPCworkshop_notarget - toggle notarget on an NPCNew in 1.01:workshop_toggle_follow: With the selected NPC, toggles following on it. Meaning if you are targeting a friendly NPC, it will switch between them following you or not.workshop_kill: Kills the selected NPC.workshop_list_anims: Lists all of the animations in the game (warning, console spam)workshop_set_health <amount>: Sets the health of the NPC.workshop_set_armor <amount>: Sets the shield of the NPC.workshop_set_gravity <amount>: Sets the gravity of the NPC (note, default is 800)workshop_set_anim <animation>: Sets the animation that the NPC is using.workshop_control: Take total control of the NPC. Better than Mind Trick Level 4 as it works on all NPCs, has infinite duration, and jump doesn't exit.workshop_end_control: Stop controlling the NPC.workshop_freeze: Freezes the NPC in place.workshop_undying: Toggle undying mode on the NPCworkshop_shielding: Toggles a bubble shield on the NPC (like assassin droids have)workshop_set_scale <amount>: Sets the NPC's scale. swegmaster, Stoiss, redsaurus and 5 others like this
Noodle Posted January 12, 2018 Posted January 12, 2018 This is great! Might be very useful for all of us SP modders. I think the AI flags are related to special npcs like vkothos and dkothos, who have a special AI flag that tells them to heal evil rosh, who alsi has a special AI flag. TheWhitePhoenix likes this
eezstreet Posted January 13, 2018 Author Posted January 13, 2018 I've made an update with some extra features. See the link in the OP for the download. Currently awaiting JKHub approval still.Updates in this new version:Added new commands:workshop_toggle_follow: With the selected NPC, toggles following on it. Meaning if you are targeting a friendly NPC, it will switch between them following you or not.workshop_kill: Kills the selected NPC.workshop_list_anims: Lists all of the animations in the game (warning, console spam)workshop_set_health <amount>: Sets the health of the NPC.workshop_set_armor <amount>: Sets the shield of the NPC.workshop_set_gravity <amount>: Sets the gravity of the NPC (note, default is 800)workshop_set_anim <animation>: Sets the animation that the NPC is using.workshop_control: Take total control of the NPC. Better than Mind Trick Level 4 as it works on all NPCs, has infinite duration, and jump doesn't exit.workshop_end_control: Stop controlling the NPC.workshop_freeze: Freezes the NPC in place.workshop_undying: Toggle undying mode on the NPCworkshop_shielding: Toggles a bubble shield on the NPC (like assassin droids have)workshop_set_scale <amount>: Sets the NPC's scale.Added new cvar: g_noAutoFollow. When this is 1, friendly NPCs don't follow you.Added new functionality to "npc spawn" command. You can do "npc spawn random" to spawn random NPCs. For instance, "npc spawn random rodian weequay trandoshan gran" picks a random npc, either rodian, weequay, trandoshan or gran. This is good for populating a city quickly and easily with a variety of townsfolk. dg1995, Daedra and Stoiss like this
TheWhitePhoenix Posted January 13, 2018 Posted January 13, 2018 I've made an update with some extra features. See the link in the OP for the download. Currently awaiting JKHub approval still.Updates in this new version:Added new commands:workshop_toggle_follow: With the selected NPC, toggles following on it. Meaning if you are targeting a friendly NPC, it will switch between them following you or not.workshop_kill: Kills the selected NPC.workshop_list_anims: Lists all of the animations in the game (warning, console spam)workshop_set_health <amount>: Sets the health of the NPC.workshop_set_armor <amount>: Sets the shield of the NPC.workshop_set_gravity <amount>: Sets the gravity of the NPC (note, default is 800)workshop_set_anim <animation>: Sets the animation that the NPC is using.workshop_control: Take total control of the NPC. Better than Mind Trick Level 4 as it works on all NPCs, has infinite duration, and jump doesn't exit.workshop_end_control: Stop controlling the NPC.workshop_freeze: Freezes the NPC in place.workshop_undying: Toggle undying mode on the NPCworkshop_shielding: Toggles a bubble shield on the NPC (like assassin droids have)workshop_set_scale <amount>: Sets the NPC's scale.Added new cvar: g_noAutoFollow. When this is 1, friendly NPCs don't follow you.Added new functionality to "npc spawn" command. You can do "npc spawn random" to spawn random NPCs. For instance, "npc spawn random rodian weequay trandoshan gran" picks a random npc, either rodian, weequay, trandoshan or gran. This is good for populating a city quickly and easily with a variety of townsfolk. So essentially, with this, I can make a friendly sparring scene between two friendly NPCs like the one in Yavin_Temple in Jedi Outcast, correct?
eezstreet Posted January 13, 2018 Author Posted January 13, 2018 So essentially, with this, I can make a friendly sparring scene between two friendly NPCs like the one in Yavin_Temple in Jedi Outcast, correct?Sort of, yeah. Give two NPCs undying and set them to be enemies and they'll fight for days. dg1995 and TheWhitePhoenix like this
TheWhitePhoenix Posted January 13, 2018 Posted January 13, 2018 Sort of, yeah. Give two NPCs undying and set them to be enemies and they'll fight for days.Sounds like a plan.
Daedra Posted January 16, 2018 Posted January 16, 2018 I've made an update with some extra features. See the link in the OP for the download. Currently awaiting JKHub approval still.Updates in this new version:Added new commands:workshop_toggle_follow: With the selected NPC, toggles following on it. Meaning if you are targeting a friendly NPC, it will switch between them following you or not.workshop_kill: Kills the selected NPC.workshop_list_anims: Lists all of the animations in the game (warning, console spam)workshop_set_health <amount>: Sets the health of the NPC.workshop_set_armor <amount>: Sets the shield of the NPC.workshop_set_gravity <amount>: Sets the gravity of the NPC (note, default is 800)workshop_set_anim <animation>: Sets the animation that the NPC is using.workshop_control: Take total control of the NPC. Better than Mind Trick Level 4 as it works on all NPCs, has infinite duration, and jump doesn't exit.workshop_end_control: Stop controlling the NPC.workshop_freeze: Freezes the NPC in place.workshop_undying: Toggle undying mode on the NPCworkshop_shielding: Toggles a bubble shield on the NPC (like assassin droids have)workshop_set_scale <amount>: Sets the NPC's scale.Added new cvar: g_noAutoFollow. When this is 1, friendly NPCs don't follow you.Added new functionality to "npc spawn" command. You can do "npc spawn random" to spawn random NPCs. For instance, "npc spawn random rodian weequay trandoshan gran" picks a random npc, either rodian, weequay, trandoshan or gran. This is good for populating a city quickly and easily with a variety of townsfolk. I was messing around with it all and you know what would be useful? A "workshop_list_weapons" command. It's just nice to get it there and then rather than go through game files. Also a command to set an NPC's saber color/style on the fly would be pretty neat. Would save going into the .npc/.sab file and altering stuff.
eezstreet Posted January 17, 2018 Author Posted January 17, 2018 The weapons are pretty easy to remember so I didn't include a command. But it is easy to write one. WP_NONEWP_BLASTER_PISTOLWP_BLASTERWP_DISRUPTORWP_BOWCASTERWP_REPEATERWP_DEMP2WP_FLECHETTEWP_ROCKET_LAUNCHERWP_THERMALWP_TRIP_MINEWP_DET_PACKSWP_SABERWP_MELEEWP_NOGHRIWP_TUSKEN_STAFFWP_TUSKEN_RIFLEWP_JAWAWP_TURRETWP_BOT_LASER
AshuraDX Posted January 17, 2018 Posted January 17, 2018 Can you add an optional "filter token" to your workshop_ist_anims command? That could be used to decrease the console spam.
Droidy365 Posted January 18, 2018 Posted January 18, 2018 The weapons are pretty easy to remember so I didn't include a command. But it is easy to write one. WP_NONEWP_BLASTER_PISTOLWP_BLASTERWP_DISRUPTORWP_BOWCASTERWP_REPEATERWP_DEMP2WP_FLECHETTEWP_ROCKET_LAUNCHERWP_THERMALWP_TRIP_MINEWP_DET_PACKSWP_SABERWP_MELEEWP_NOGHRIWP_TUSKEN_STAFFWP_TUSKEN_RIFLEWP_JAWAWP_TURRETWP_BOT_LASERYeah, you could even do it with a config file. echo WP_NONE echo WP_BLASTER_PISTOL echo WP_BLASTER echo WP_DISRUPTOR echo WP_BOWCASTER echo WP_REPEATER echo WP_DEMP2 echo WP_FLECHETTE echo WP_ROCKET_LAUNCHER echo WP_THERMAL echo WP_TRIP_MINE echo WP_DET_PACKS echo WP_SABER echo WP_MELEE echo WP_NOGHRI echo WP_TUSKEN_STAFF echo WP_TUSKEN_RIFLE echo WP_JAWA echo WP_TURRET echo WP_BOT_LASER Save that in notepad as "weaponlist.cfg" without quotes.Open the console in game and type "exec weaponlist" without quotes, once again. eezstreet likes this
Daedra Posted January 19, 2018 Posted January 19, 2018 @@eezstreet There seems to be a large problem with this. I'll try my best to explain what happened from my point of view. It worked fine when I copied over the modified exe and dll files. It all worked fine up until last night. I had made zero adjustments to my game, and I ran the game through the .bat file. The first thing that happened was that the intro video played audio, but my screen was black. I then skipped the intro by hitting the enter key, and it went to the menu, but my screen was still black (it made all the normal sounds that the menu does). I thought that maybe my computer was going to shit, so I tried out some other games, and they all loaded and worked fine. So it wasn't my computer. Anyway, I checked all the JKA folders for "date modified" and nothing new had been altered. There were also no errors, surprisingly. So I reloaded the game again through the bat file, it was still black. Now this is what I did, even though I couldn't see shit, only hear it. I opened the console, and devmapped a map. It then made all of the loading sounds, and I heard the map music playing, it all loaded fine (audio wise). I then made my character walk around and jump, and used force powers, and all the audio played perfectly, it was all fine as if my screen wasn't black at all. So, I couldn't figure it out at all. There was something wrong that was preventing me from viewing JKA at all. So what I did to fix it, was to put the original files back which the aiworkshop replaced - the exe and dll files. Now I can see everything, no more black screen. I installed it around 4-5 days ago. For me it just went black after 4 or 5 days. I had to uninstall it basically. I think it may be an issue with the exe or dll files.
eezstreet Posted January 29, 2018 Author Posted January 29, 2018 @@eezstreet There seems to be a large problem with this. I'll try my best to explain what happened from my point of view. It worked fine when I copied over the modified exe and dll files. It all worked fine up until last night. I had made zero adjustments to my game, and I ran the game through the .bat file. The first thing that happened was that the intro video played audio, but my screen was black. I then skipped the intro by hitting the enter key, and it went to the menu, but my screen was still black (it made all the normal sounds that the menu does). I thought that maybe my computer was going to shit, so I tried out some other games, and they all loaded and worked fine. So it wasn't my computer. Anyway, I checked all the JKA folders for "date modified" and nothing new had been altered. There were also no errors, surprisingly. So I reloaded the game again through the bat file, it was still black. Now this is what I did, even though I couldn't see shit, only hear it. I opened the console, and devmapped a map. It then made all of the loading sounds, and I heard the map music playing, it all loaded fine (audio wise). I then made my character walk around and jump, and used force powers, and all the audio played perfectly, it was all fine as if my screen wasn't black at all. So, I couldn't figure it out at all. There was something wrong that was preventing me from viewing JKA at all. So what I did to fix it, was to put the original files back which the aiworkshop replaced - the exe and dll files. Now I can see everything, no more black screen. I installed it around 4-5 days ago. For me it just went black after 4 or 5 days. I had to uninstall it basically. I think it may be an issue with the exe or dll files. Or perhaps your graphics card, if you are using integrated graphics.If you did a recent driver update it might be that. You might have to fiddle with that. The stuff I did was just done on a clean version of OpenJK and didn't modify the graphics any.
Daedra Posted January 29, 2018 Posted January 29, 2018 Or perhaps your graphics card, if you are using integrated graphics.If you did a recent driver update it might be that. You might have to fiddle with that. The stuff I did was just done on a clean version of OpenJK and didn't modify the graphics any. No I haven't made any changes to my drivers for a VERY long time. Plus they are all up-to-date anyway. I don't know the actual reason as to why it happened, though the only thing I did notice is that when I had my task manager open in the processes tab, OpenJK's memory (private network set) was over 3 million. my regular OpenJK only sometimes reaches 1 million max. But that still wouldn't explain why everything still seemed to work just fine but the .exe only showed a pure black screen. (Again, tested multiple different games from .exe format and they all load and work fine, if it was my drivers I am certain I would get issues with those games, or even with normal OpenJK already by now, but I haven't).
eezstreet Posted January 29, 2018 Author Posted January 29, 2018 No I haven't made any changes to my drivers for a VERY long time. Plus they are all up-to-date anyway. I don't know the actual reason as to why it happened, though the only thing I did notice is that when I had my task manager open in the processes tab, OpenJK's memory (private network set) was over 3 million. my regular OpenJK only sometimes reaches 1 million max. But that still wouldn't explain why everything still seemed to work just fine but the .exe only showed a pure black screen. (Again, tested multiple different games from .exe format and they all load and work fine, if it was my drivers I am certain I would get issues with those games, or even with normal OpenJK already by now, but I haven't).That memory change would not explain the graphics. (Upping the NPC/VEH/etc limits are what cause that)Try changing to windowed mode by adding "+set r_fullscreen 0"
Daedra Posted January 29, 2018 Posted January 29, 2018 That memory change would not explain the graphics. (Upping the NPC/VEH/etc limits are what cause that)Try changing to windowed mode by adding "+set r_fullscreen 0" I'll try that out if the screen goes black again.
Delta-573 Posted February 18, 2018 Posted February 18, 2018 A workshop_noclip command for an NPC would also be nice.
Delta-573 Posted February 18, 2019 Posted February 18, 2019 A workshop_noclip command for an NPC would also be nice. Do you guys still work on this Workshop? Any chance this command will be added?
DarthValeria Posted December 5, 2019 Posted December 5, 2019 Can this work on KOTF 2.1? Dark_Reaper likes this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now