PvP but with AI enabled

Added by KadinX almost 6 years ago

I realize that this beautiful set of scripts pertains to PvP scenarios but I would like to creat PvP missions that play by themselves until more human players connect.

For Deathmuch missions for example, I would like to give the negative rating to ALL units not just the PLAYER. In the init.sqf file of the PvP script pack 2.08 there is the following script"

"
//For DM type maps, players must be made enemies of one another
if (CTF_gameType in ["FF","DM","KOH"]) then {
if (not isNull player) then {player addRating (-(rating player) -100000) ;};
} ;"

How can I modify it so ALL units get the negative rating and become hostile to each other? I tried replacing the PLAYER with ALLUNITS and delete the first THEN section but no go.
Any suggestions, kind gentlemen?
regards


Replies (5)

RE: PvP but with AI enabled - Added by sbsmac almost 6 years ago

Sorry,just noticed this post.
I think you were on the right track - it may be that addRating only operates locally

Try something like
1 //For DM type maps, players must be made enemies of one another 2 if (CTF_gameType in ["FF","DM","KOH"]) then { 3 4 { 5 _x addRating (-(rating _x) -100000) ; 6 }forEach allUnits ; 7

This is probably overkill but should do the trick.

RE: PvP but with AI enabled - Added by KadinX almost 6 years ago

Thanks for your reply and I understand that you have been buzy all around, so you don't have to answer any further.

I tried what you suggested and just so I got it right the whole line should be like this? (no quotes of course)

"//For DM type maps, players must be made enemies of one another
if (CTF_gameType in ["FF","DM","KOH"]) then {{ _x addRating (-(rating _x) -100000) ;}forEach allUnits ;};"

I did the change, open and saved the mission in multiplayer and previewed it. I heard a few shots not directed at me but then they stopped and my shooting them gave me negative points right of the start. I restarted the mission a few times and on one or two occasions my first kill was NOT negative. So it looks like the command does pass down to them but maybe not fast enough?

I tried something else: I did the addrating manually in each init line in the mission editor and took the "DM" out of the {"FF","DM","KOH"}.
The hostility was established :) but after a few deaths all the nice things (respawn delay, respawn limits, default gun e.t.c) you have strived for stopped working. So it seem like a complicated thing.
This is just for you feedback, you don't have to follow through.
Thanks again.

RE: PvP but with AI enabled - Added by sbsmac almost 6 years ago

Hmm - not sure what is going on but DM is one mode where it may make sense to allow AI. I'll stick it on the 'to-do' list :-)

RE: PvP but with AI enabled - Added by KadinX almost 6 years ago

...and I will be very willing to help if you need any grunt work :)

RE: PvP but with AI enabled - Added by sbsmac almost 6 years ago

Would you be willing to help with beta testing V3 ? (Actually any help of any kind is always appreciated - documenetation, videos, mission-making, marketing, scripting - just let me know what you want to do !)

If so, send me a PM with msn/email/skype contact details on the BIS forums.

(1-5/5)