AI Hero Support Script

Releasing the source files for your mod or map? Post em' here. (Applies to both SWBF1 & SWBF2)

Moderator: Moderators

Post Reply
archer01

AI Hero Support Script

Post by archer01 »

*Update:
Considering how much better this "gameplay feature" works with the bot count fix, I decided to upload an update of the script. It is used EXACTLY the same way the older version is used so no scripting changes are needed. Just overwrite the old lua with the newer one. The error in the readme has also been corrected.

Link:
AI Hero Support Script 1.2 on MediaFire

AIHeroSupportModv1_3.zip on MediaFire

Again, this is for modders and mappers. Don't bother downloading it if you're neither.


*Edit -> Please note: There is an inheritance-related bug in version 1.2 of the script. To clarify, the script should still work correctly but only one instance of the script can be running at a time. I've fixed this error for v1.3, but have not had a chance to throughly test it yet (my OFM map has been my focus lately).




*Original post:
Well here it is:
(old)http://files.filefront.com/AIHeroSuppor ... .html(old)

It's for modders and mappers. Don't bother downloading it if you're neither.

Please inform me if you find something wrong with it.

Screenshot Example:
Recoginize the map? :wink:
Hidden/Spoiler:
Image
Last edited by archer01 on Tue Dec 12, 2006 6:22 pm, edited 5 times in total.
Rekubot
Jedi
Jedi
Posts: 1080
Joined: Wed Apr 05, 2006 12:34 pm
Projects :: No Mod project currently.
Games I'm Playing :: Shadow Complex
xbox live or psn: Rekubot
Location: UK

RE: HeroSupport Script for modders

Post by Rekubot »

:shock: I've only just seen this!

Thanks a lot archer, you've made my day. (If I can get it to work that is, LoL.)
archer01

RE: HeroSupport Script for modders

Post by archer01 »

I made getting it up and running as easy a process as I possibly could. If you have any problems, feel free to ask for help! :D



@Everyone
I made a slight error in the readme. See the original post for details.
-=DE=-Nade_Master

RE: HeroSupport Script for modders

Post by -=DE=-Nade_Master »

Aryo Pass at Yavin !V.
archer01

RE: HeroSupport Script for modders

Post by archer01 »

Yup, I'm guessing the platforms and Jedi gave it away? :P

Just as an example, it only took about 5 minutes to setup the script for my map. Most of that time was spent looking up the CP and path names... I forgot what I had named them. :oops:



Question:
While looking through the "SWBF2 Wiki" I noticed something...

Does anyone know what these functions do?:
SetHeroUnlockRule()
SetHeroTeamRule(string)


Although it would be kinda sad to see my hero support script become obsolete; if there is a way to enable bot heroes using the game's own functions it would be nice to find out how.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

RE: HeroSupport Script for modders

Post by [RDH]Zerted »

There are similar names in the game's command line arguments and the server manager. I assume they do the same things. However, they are never used in any of the retail scripts. UnlockHeroForTeam() is used.

Wouldn't just adding the hero as a standard unit let the AI use it?

Anyway, nice work on the script.
archer01

RE: HeroSupport Script for modders

Post by archer01 »

I'm not sure how it works in a netgame, but in instant action I've found that the AI will always leave one unused spot on each character class for the player to take. So setting a restriction of one unit on the class will allow the opposite team to use their hero, but the side with the human player will only have their hero active when the player is using it. Also the unit class will be available at all times.


Do I expect everyone to use this script in their map? Nah... I imagine it isn't needed for 99% of the maps out there. I was just "ticked off" by the fact that the AI never used the hero, so I tried to make a "fix" for it. :D

Thanks for the response to my question [RDH]Zerted.


Oh and as I found out through experimentation:

Code: Select all

SetHeroPlayerRule("Random") --Sets the player assignment for the hero to "Random Player"
SetHeroRespawnRule("10") --Sets the hero respawn time to 10 seconds
Just so everyone knows.
-=DE=-Nade_Master

Post by -=DE=-Nade_Master »

A few things gave it away. Number one i have played ur map soo many times if u showed me a screenshot i could tell where it is. Two if u made a map would u most likely wnat to give a screenshot of that map to advertise.

PS. Can't wait for ur next mod.
Post Reply