Jump to content

Hero Missions


Achmed

Recommended Posts

I have had a player on my server ask if there is a way to make some "hero" missions instead of bandit missions. I think its a good idea but im not 100% sure how to do it or what would need changing/adding to dzms to make it work.

 

this is what hes posted on my forum, it might help to explain

 

 

As we all know in the current mission system bandits are always doing the bad thing well enuf is enuf i wona see hero AI so that when the server goes quite it is still possible to gain bandit as the missions could be split.

 
I.E........... One mission is for Hero's (Bandits have taken control of a weapon cash) and one for bandits (Hero's are Protecting a weapon cash)
 
Same mission worded different and gives different humanity so how the server could split the humanity up is.
 
All in bandit skins give + humanity and all in ie Marksman skins when killed gives - humanity this way these's missions could be different and bandits don't need players to achieve bandit if the server is quite
 
 
What do you guys think and mat is this possible to do??
 
 
please bear in mind the skins listed (Marksman) i know is popular one so this dose not need to be used if possible to do it just a guide line so you can picture what im trying to say =D

 

Link to comment
Share on other sites

How would I get the hero and bandit missions to use different skins?

The plan is to have heros and bandits dressed accordingly, Hero markers green and bandit markers red, and obviously -humanity for hero kills and +humanity for bandit kills.

I'm not good at coding so would somone mind helping oit?

Link to comment
Share on other sites

  • 2 months later...

How would I get the hero and bandit missions to use different skins?

The plan is to have heros and bandits dressed accordingly, Hero markers green and bandit markers red, and obviously -humanity for hero kills and +humanity for bandit kills.

I'm not good at coding so would somone mind helping oit?

 

Would also love help on this.

Link to comment
Share on other sites

You can make it hand out different humanity based on the skin, but you would still have "Hero" AI shooting at Hero players, and "Bandit" AI shooting at Bandit players.

 

How would I go about doing this? Sorry, still really new on all this. First server!

Link to comment
Share on other sites

You could also change the behaviour of the AI based on nearby players humanity. That would stop hero AI shooting at heros, same for bandits.

 

Really like the sound of this, but again I have no idea where to begin on this. I know enough to get by but that's my limit atm. My server has only been going for around a week now.

 

Plus any way to like have Minor missions not change Humanity? 

Link to comment
Share on other sites

You can make it hand out different humanity based on the skin, but you would still have "Hero" AI shooting at Hero players, and "Bandit" AI shooting at Bandit players.

We need that Hero AI shot at Heros, becouse the loot is not save if they don´t shot :D

And i think i have a solution to make this, i will test it tomorrow ;)

Link to comment
Share on other sites

Just a theory nothing more..

in the mission files

 

//Lets make AI for the plane and get them in it
_aiGrp = creategroup civilian

 

in the dzmsinit.sqf

// Create the groups if they aren't created already
    createCenter east;
    // Make AI Hostile to Survivors
    WEST setFriend [EAST,0];
    EAST setFriend [WEST,0];
    // Make hero mission ai friendly to west
    EAST setFriend [CIVILIAN,0];
    CIVILIAN setFriend [EAST,0];
    CIVILIAN setFriend [WEST,1];

    WEST setFriend [CIVILIAN,1];
} else {

 

alot easier to do this in wai
 not all the mission in dzms have _aiGrp = creategroup

;
 

Link to comment
Share on other sites

Just a theory nothing more..

in the mission files

 

//Lets make AI for the plane and get them in it

_aiGrp = creategroup civilian

 

in the dzmsinit.sqf

// Create the groups if they aren't created already

    createCenter east;

    // Make AI Hostile to Survivors

    WEST setFriend [EAST,0];

    EAST setFriend [WEST,0];

    // Make hero mission ai friendly to west

    EAST setFriend [CIVILIAN,0];

    CIVILIAN setFriend [EAST,0];

    CIVILIAN setFriend [WEST,1];

    WEST setFriend [CIVILIAN,1];

} else {

 

alot easier to do this in wai

 not all the mission in dzms have _aiGrp = creategroup

;

 

 

That won't work.

Zombies are Civilians.

Players are West.

 

What you are doing there will make all AI and Zombies friendly with players.

 

All that needs done is a switch added to DZMSAIKilled.sqf to change the amount of humanity based on the skin of the killed ai.

Link to comment
Share on other sites

Yea thats why i mentioned wai cause this is what i did in wai and was able to setup static mg to protect cities from dzai vehicle and foot patrols effectively made elektro a hero safe haven

and made all the missions into united nations helping people with supplies when i set their side to civilian

Link to comment
Share on other sites

so i think this will work. but i can´t test it at the moment.

 

in the private string we need "_human"

 

search for:

//Name of the Mission

 

right below we add:

 

_human = 1;

 

the value 1 is for banditkills

2 is for herokills

and 0 is for no humanity

 

 

find the line like this:

[_coords,1,_skill,"DZMSUnitsGeneral"] call DZMSAISpawn;

 

make it like this

 

[_coords,1,_skill,_human,"DZMSUnitsGeneral"] call DZMSAISpawn;

 

go to DZMSAISpawn.sqf

 

change this

_unitArrayName = _this select 3;

 

to this

 

_unitArrayName = _this select 4;

 

search for

_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }];

 

and change it to

_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1), (_this select 3)] ExecVM DZMSAIKilled; }];
   

open your DZMSAIKilled.sqf

 

add to private "_human"

 

add the line

_human = _this select 2;

 

right under:

_player = _this select 1;

 

 

search for

 

private ["_banditkills","_humanity"];

 

add make it to:

 

private ["_humankills","_banditkills","_humanity"];

 

find the line and remove it:

_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];

 

set at the position from the removed line:

 

switch (_human) do {
            case 0 : {
            
            };
            case 1 : {
                _player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
            };
            case 2 : {
                _player setVariable ["humanity",(_humanity - DZMSCntHumanity),true];
            };
        };

 

 

the last point is to add the kills

find the line:

 

_player setVariable ["banditKills",(_banditkills + 1),true];

 

and change it to:

 

if (_human == 1) then {
            _player setVariable ["banditKills",(_banditkills + 1),true];
        }else{
            _player setVariable ["humanKills",(_humankills + 1),true];
        }

 

 

but you have to change all missions and i can´t test it. let me now if it works....

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...

Since this was bumped anyways to do an infodump for people looking to actually do coding on this.

All of what makes Zombies, Bandits, and Players hostile is based on side relations. There are a few set "sides" in the game and you can change the relationship between the four.

Players are always "WEST" or "BLUFOR". Zombies are always "CIVILIAN". Bandits are generally "EAST" or "OPFOR". Then there is the Independent/Guerrilla side. In Arma 3 sides set hostile to Civilians will not attack them, so A3 Epoch instead uses the Independent side for their hostiles.

The setFriend command changes the relationship between the sides. 0 is Hostile KOS, 1 is perfectly friendly. This also means that whichever script calls setFriends last on the server is the relations that is the current setting for the server. It is pointless to use it more than in one script.

There is no way to juggle the sides to achieve a working Hero and Bandit AI setup. SARGE AI was the only one to attempt this. What it did was make Hero AI be "Independent" and Bandit were "East". When a "West" player fired on a "Independent" AI the code would change the players side to "East". This caused the infamous bug where you cannot get in a vehicle with other players. Players of separate sides cannot enter the same vehicles together.

The only way I see it working is setting up groups of AI and then dynamically creating and transferring them to a new group based on what is happening to them (like who they are under attack from). You would need to basically program a whole new AI system for it to be able to track all the things you would need to get it to work, I don't think it would be possible to hotpatch it onto an existing system.

Link to comment
Share on other sites

Very possible. I have a custom version of dzms. Hero and bandit mission. With mine fields, M2 gunners, and patrolling vehicles kinda like wai has. I did not make the custom dzms mission system only the missions i made. If i get permission from the guy that actually made the custom version ill release it. You can check out yRun to see how the custom dzms works.

Link to comment
Share on other sites

1 hour ago, TheVampire said:

Although the above code was good, it didn't change relations between any sides simply the skins of the AI per mission.

In that code, I simply made it set a variable on each AI relevant to what unit type it was suppose to be. So when a player killed an AI with variable Hero, they would have their stats adjusted accordingly. The skins were also differentiated between the two types. Really didn't see the point in changing sides for both, as it is un-necessary and actually saved me some trouble.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...