Author Topic: How to make AI attack player Jedi without getting rid of invincibility?  (Read 281 times)

Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
Carried on from another post since no one was answering. Basically if I make say Mace Windu's health 1000, he will still block and such, however he'll die from grenades as well as turrets like on BES Platforms. If I keep his health at the 100000, no one will attack him. Why is this?


Dark_Phantom

  • The Official Ghost
  • Administrator
  • This Man Has No Life
  • *****
  • Posts: 1421
  • Awards SWBFspy SWBF1-Player of the Month To recognize Modders that make a most excellent contribution within the Month A member of the winning team of ICW6 Administered events in ICW5 A member of the winning team of ICW5 Special Award for those that play the original SWBF ICW4 Participant Recognizes someone who most generously donated funds to the site or the site ICW3 Participant
    • View Profile
    • The BOBclan
    • Awards
  • PSN: phantom567459
  • Steam ID:
  • Origin ID: phantom567459
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #1 on: November 19, 2020, 06:55:54 AM »
It's a hard coded limitation because you don't need AI attacking a target with no hope of destroying it.  There's a threshold that I think is based on weapon damage - but I don't know this for sure.  What I do know is that you can't change that behavior.

Generally, if you're not getting an answer, it's because we don't know. Keep the double posting about the same topic to a minimum please.
The BOBclan:  A Rich History


'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #2 on: November 19, 2020, 07:40:55 AM »
It's a hard coded limitation because you don't need AI attacking a target with no hope of destroying it.  There's a threshold that I think is based on weapon damage - but I don't know this for sure.  What I do know is that you can't change that behavior.

Generally, if you're not getting an answer, it's because we don't know. Keep the double posting about the same topic to a minimum please.
Okay, sure. I'd appreciate it if you would at least let me know if you don't know, I think it's a ridiculous to assume I'd know that, the forums don't seem very active so I thought there just weren't people looking.

But yeah, I'd actually wonder why it's hard coded for other units though, since they still attack the Jedi Heroes.

Napseeker

  • Master Modder
  • Frequent Poster
  • ***
  • Posts: 143
  • Awards Releasing Multiple Mods on SWBFgamers.com
    • View Profile
    • Awards
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #3 on: November 20, 2020, 04:25:10 PM »
Carried on from another post since no one was answering. Basically if I make say Mace Windu's health 1000, he will still block and such, however he'll die from grenades as well as turrets like on BES Platforms. If I keep his health at the 100000, no one will attack him. Why is this?

Well, if they only attack if his health is at 1000, but you want to keep him alive, then why not use AddHealth to just constantly restore his health?

Example:

MaxHealth   = 1000.0
AddHealth       = 999

I haven't tested this, but it might work as the addhealth happens every second.




Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #4 on: November 22, 2020, 06:09:00 PM »
Well, if they only attack if his health is at 1000, but you want to keep him alive, then why not use AddHealth to just constantly restore his health?

Example:

MaxHealth   = 1000.0
AddHealth       = 999

I haven't tested this, but it might work as the addhealth happens every second.
Hey, sorry for late reply, for some reason I'm not getting notifications.

I have tried the AddHealth method, however it only works on the ground, where as when a turret launches you in the air your health doesn't regenerate. Even then, most of the time it won't actually be fast enough since larger turrets and vehicles do way more damage.

Has any modders here tried to make it so that the player can gain "Jedi Hero Status"? If that were possible, then we wouldn't need to change anything. That way it'd make a true Jedi hero mod.

Dark_Phantom

  • The Official Ghost
  • Administrator
  • This Man Has No Life
  • *****
  • Posts: 1421
  • Awards SWBFspy SWBF1-Player of the Month To recognize Modders that make a most excellent contribution within the Month A member of the winning team of ICW6 Administered events in ICW5 A member of the winning team of ICW5 Special Award for those that play the original SWBF ICW4 Participant Recognizes someone who most generously donated funds to the site or the site ICW3 Participant
    • View Profile
    • The BOBclan
    • Awards
  • PSN: phantom567459
  • Steam ID:
  • Origin ID: phantom567459
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #5 on: November 22, 2020, 08:20:41 PM »
You can't change the state of the units after they are loaded in, unlike BF2.
For example:
At load time, the units are called in.  For the purposes of BF1, they are done.  You also can't lock classes out like in BF2.  Now, in BF2, with the award system/hero spawning, you could do this, but none of this dynamic code existed for the first game.

Melee combat and Jedi were not a focus of BF1.  That's why you see such limited support for it.  Also, if AddHealth isn't working, please check for typos.  AddHealth should be adding once a second if I remember correctly (like Napseeker said), even if you are in the air (I could be wrong here).
« Last Edit: November 22, 2020, 08:23:58 PM by Dark_Phantom »
The BOBclan:  A Rich History


'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #6 on: November 22, 2020, 10:38:25 PM »
You can't change the state of the units after they are loaded in, unlike BF2.
For example:
At load time, the units are called in.  For the purposes of BF1, they are done.  You also can't lock classes out like in BF2.  Now, in BF2, with the award system/hero spawning, you could do this, but none of this dynamic code existed for the first game.
Right, but what I mean is making it so the player has the "hero class", and if I'm correct only 1 hero can spawn, however I may be off the mark here.

Melee combat and Jedi were not a focus of BF1.  That's why you see such limited support for it.  Also, if AddHealth isn't working, please check for typos.  AddHealth should be adding once a second if I remember correctly (like Napseeker said), even if you are in the air (I could be wrong here).
Yeah, no, I did that. I tested it against less harmful items like grenades, and the "AddHealth" only activates when on the ground, while being launching in the air with the falling animation, the "AddHealth" doesn't activate.
« Last Edit: November 22, 2020, 10:43:54 PM by Bluetothestars »

Dark_Phantom

  • The Official Ghost
  • Administrator
  • This Man Has No Life
  • *****
  • Posts: 1421
  • Awards SWBFspy SWBF1-Player of the Month To recognize Modders that make a most excellent contribution within the Month A member of the winning team of ICW6 Administered events in ICW5 A member of the winning team of ICW5 Special Award for those that play the original SWBF ICW4 Participant Recognizes someone who most generously donated funds to the site or the site ICW3 Participant
    • View Profile
    • The BOBclan
    • Awards
  • PSN: phantom567459
  • Steam ID:
  • Origin ID: phantom567459
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #7 on: November 22, 2020, 11:18:56 PM »
There's two options here:
AddUnitClass(ALL,"all_inf_luke/whatever",0)
or use this:
http://www.swbfgamers.com/index.php?topic=12549.msg117130#msg117130

It's not the same, but maybe someone else has a better solution.
« Last Edit: November 22, 2020, 11:20:50 PM by Dark_Phantom »
The BOBclan:  A Rich History


'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #8 on: November 23, 2020, 03:36:43 AM »
or use this:
http://www.swbfgamers.com/index.php?topic=12549.msg117130#msg117130

It's not the same, but maybe someone else has a better solution.
Wow, I looked at that and tried it, it really is basically a true Jedi Herp mod/trainer, however, it spawns in two Heroes instead of one (that being the player).

Is the 6th class an actual class in the game, being the hero class? If so then you basically were able to successfully make it so we can play as a true Hero, now there's only one more thing to fix, that being there's an additional hero that spawns in. Would there be a way to fix that?

Dark_Phantom

  • The Official Ghost
  • Administrator
  • This Man Has No Life
  • *****
  • Posts: 1421
  • Awards SWBFspy SWBF1-Player of the Month To recognize Modders that make a most excellent contribution within the Month A member of the winning team of ICW6 Administered events in ICW5 A member of the winning team of ICW5 Special Award for those that play the original SWBF ICW4 Participant Recognizes someone who most generously donated funds to the site or the site ICW3 Participant
    • View Profile
    • The BOBclan
    • Awards
  • PSN: phantom567459
  • Steam ID:
  • Origin ID: phantom567459
Re: How to make AI attack player Jedi without getting rid of invincibility?
« Reply #9 on: November 23, 2020, 08:02:25 AM »
The technical explanation is that the game assigns the character select for human and AI in slots 0-4 in the base game.  Slot 5 (or if you start at 1, number 6) is assigned to the hero.  This was never meant to be selectable, but in my testing for a way to make more than 5 units work on the spawn screen, I came across this minor discovery.  It was fun and so I released it as a trainer.

I don't have any practical way to stop the AI from spawning as the hero though.  I ran into this issue on another map I did a long time ago.  If you don't spawn in quickly enough, the AI will compensate to balance teams - think of a hero as a +1, if there's already a hero, then it shouldn't spawn as one.  You could lengthen the time until the AI spawn by changing SetSpawnDelay(10.0, 0.25) to something higher, like SetSpawnDelay(20.0, 0.25), but then you'll be waiting longer for the AI to pop in.  However, the AI shouldn't spawn as a hero then.

For actual additional spawn screen units, see here: http://www.swbfgamers.com/index.php?topic=13140.msg119800#msg119800
TL;DR - the spawn screen only natively uses 5 units and any more than that is unstable and janky, but possible.

The BOBclan:  A Rich History


'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Bluetothestars

  • Member
  • **
  • Posts: 24
    • View Profile
    • Awards
The technical explanation is that the game assigns the character select for human and AI in slots 0-4 in the base game.  Slot 5 (or if you start at 1, number 6) is assigned to the hero.  This was never meant to be selectable, but in my testing for a way to make more than 5 units work on the spawn screen, I came across this minor discovery.  It was fun and so I released it as a trainer.

I don't have any practical way to stop the AI from spawning as the hero though.  I ran into this issue on another map I did a long time ago.  If you don't spawn in quickly enough, the AI will compensate to balance teams - think of a hero as a +1, if there's already a hero, then it shouldn't spawn as one.  You could lengthen the time until the AI spawn by changing SetSpawnDelay(10.0, 0.25) to something higher, like SetSpawnDelay(20.0, 0.25), but then you'll be waiting longer for the AI to pop in.  However, the AI shouldn't spawn as a hero then.

For actual additional spawn screen units, see here: http://www.swbfgamers.com/index.php?topic=13140.msg119800#msg119800
TL;DR - the spawn screen only natively uses 5 units and any more than that is unstable and janky, but possible.
Yeah, I just tested it, no matter how fast I spawn in, another hero on my side always spawns in as well. So I'm guessing it probably wouldn't matter if I did lengthen the time, since the AI spawns a hero regardless. It's strange, if the player becomes the hero, it makes sense that the AI would just not spawn in another one, but it doe anyway. Very strange.

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal