PDA

View Full Version : Punishment script?



♣_Spiritus_♣
Apr-14-2014, 20:50
I was wondering if there was some type of script out there that would punish a side for destroying certain elements of the mission?

I would like to have military targets as well as civilian activity near by where if bombed or destroyed it would incur a penalty on that side or player. They would be far enough away that it would have to be deliberate plus mission briefing and recon photos would show locations of both.

Any ideas?

III./ZG76_Keller
Apr-14-2014, 21:16
I'm not sure that makes much sense, adding more objects to missions would only degrade the playability of the mission.

And why would you add objects to missions that would cause a penalty for those that destroy it if destroying it would have to be deliberate? It'd be as useful as a self destruct button in the cockpit.

♣_Spiritus_♣
Apr-14-2014, 21:23
I've been told missions can have up words of 5000 static objects so having 30 or so civilian refugee objects evacuating an area being overrun seems to make perfect sense to me. They are not AI so degrading of the mission wouldn't occur from what I understood Hans Gruber say.

And as far as the other thing, if my mission briefing states that the military targets are the only ones to be targeted, why not have a punishment for someone who deliberately attacks civilians? If not Ill just fly in a JU88 and drop all my bombs like a carpet bomb mission and whoever/whatever I hit is fine by me. No skill required. To dive in and target the overrunning military targets near off limit targets adds to the immersion and skill required for that target.

MonThackma
Apr-14-2014, 21:56
If the repercussions were true to the sim experience, then yes, maybe? The problem...

What is the punishment? What would the punishment be in real-life? Is there one? It's effects certainly wouldn't fall within the scope of flying combat missions.

Simulated dishonorable discharge resulting in a ban from ATAG? Or are you suggesting that the sim simply track your stats for "civilian kills?" Label you a Serial Killer? Charge your credit card a dollar?

I am being facetious of course, but you get my point. I am just not sure there is an appropriate "punishment".

III./ZG76_Keller
Apr-14-2014, 21:56
And as far as the other thing, if my mission briefing states that the military targets are the only ones to be targeted, why not have a punishment for someone who deliberately attacks civilians? If not Ill just fly in a JU88 and drop all my bombs like a carpet bomb mission and whoever/whatever I hit is fine by me. No skill required. To dive in and target the overrunning military targets near off limit targets adds to the immersion and skill required for that target.

So, let me get this straight. You would want a mission with civilian targets that are close, but not too close to military targets; just far enough away that you'd have to intentionally hit them? So basically you are inviting people to act like jerks and hit civilian targets in order to punish the team that they happen to be flying for? I don't see any benefit to this. As it stands now, I've never known anyone to fly bombers and just randomly drop bombs on areas of the map that don't contain targets. All bomber pilots that I know pride themselves on accuracy, and flying for 45 minutes just to get to target and miss is punishment enough for the pilot.

Adding punishable civilian targets would introduce a problem that until now has never existed.

III./ZG76_Keller
Apr-14-2014, 21:57
If the repercussions were true to the sim experience, then yes, maybe? The problem...

What is the punishment? What would the punishment be in real-life? Is there one? It certainly wouldn't fall within the scope of flying combat missions.

Simulated dishonorable discharge resulting in a ban from ATAG? Or are you suggesting that the sim simply track your stats for "civilian kills?" Label you a Serial Killer? Charge your credit card a dollar?

I am being facetious of course, but you get my point. I am just not sure there is an appropriate "punishment".

Hahaha! Well put!

♣_Spiritus_♣
Apr-14-2014, 22:18
I think there is an appropriate punishment, perhaps losing a spawn point or a type of aircraft, something obliviously related to the sim. Maybe not to the team, but to the player. What do you do to someone who spawns as blue and starts shooting blues down? It is the same thing.

The civilians are not "targets", they are static objects within the same vicinity of actual targets. Not close enough where a bomb on target would take them out, but close enough where you have to be aware of which are who and what your direction of attack is.

And people will be jackoffs either way but for us bomber pilots who enjoy a challenge I think this is a fresh idea for a target rather than another airfield or ship convoy, which both are in my mission but there needs to be fresh things in the server rotation in my opinion.

Skoshi_Tiger
Apr-15-2014, 01:42
I think it's a good idea.

Knock out the pill box and sever the demolition cables without damaging the important railway bridge before the friendly troop trains cross. Take out the heavily defended rail junction without hitting the hospital that's a block away. Knock down the wall of the prison without hitting the chapel where the prisoners have barricaded themselves.

I think there is enough historical precedence to make some really interesting missions with a script like the one put forward.

palker
Apr-15-2014, 01:54
I do not see a point in real WW2 the bomber command and Luftwaffe did not care about collateral damage.
The only thing that should be punished is attacking friendly targets. You shot down G-50 cause you thought it was a Hurricane, bomb your own airfield? You get kicked so maybe next you will be more cautious.

♣_Spiritus_♣
Apr-15-2014, 02:14
The only reason both sides started bombing whatever and not caring about collateral is because a flight of HE-111's got lost one night and bombed London on accident, then England bombed Berlin and the rest is history.

Either way, I have no idea how to write scripts but thought it might be a good change of pace if thrown into the mission rotation. Keep things fresh and get people out of their comfort zones.

Skoshi, I had two of those exact things in mind! If you don't mind I would like to use your other idea about the bridge/friendly train crossing.

♣_Spiritus_♣
Apr-15-2014, 03:57
Maybe instead of a punishment since there would be no way of telling if it was deliberate or not, have a script that adds another target to the side?

So if whatever side destroys the target area but also the hospital or civs or whatever, have a trigger or something that if the "off limits" area is destroyed, then another target/s are brought up for that side to destroy?

Its a tricky issue but I think one worth figuring something out for.

EG14_Marcast
Apr-15-2014, 04:53
I don't think such punishments have ever existed, or will ever exist, in real life. For bombing by mistake, I mean.

Skoshi_Tiger
Apr-15-2014, 07:57
Skoshi, I had two of those exact things in mind! If you don't mind I would like to use your other idea about the bridge/friendly train crossing.

Spriitus, Feel free to use that idea. It's not exactly original. If memory serves me right it was exactly that mission that a group of JU-87 were on that opened the air war against Poland. (The Stukas achieved their objectives but the train was delayed and the Poles managed to destroy the bridge anyway - but it was still an interesting mission)

Cheers!

No601_Swallow
Apr-15-2014, 10:32
I also think there's nothing wrong with the idea. Quite the contrary - the more we can work out how to do things, the better.

It might be worth pointing out (again) that mission builders (and script designers) write missions for a variety of different ways of playing the game. An ATAG-type DF server isn't the be-all and end-all of CloD.

For instance, I've been doing a variety of "Friday Fun" missions for my squadron, such as "Stuka Golf", "Blenheim Hockey", etc. Penalising players for missing a target would add to the fun. So far, the only punishment I've been able to trigger has been a sarcastic HUD message. Something more tangible (the miscreant loses his wings, or automatically bails, etc) would be a hoot! Ju88 darts, anyone?

VMF214_Jupp
Apr-15-2014, 17:38
Actually, IL-2's predecessors used scoring for targets, and destroying any assest of your own side resulted in "the punishment of" subtracting the value in points, of that target, even going into negative scores for extremely bad game play. So, the precedent and methodology is there and valid. Developing a script for that in CLoD would most certainly be worth the effort in sorting out, if possible, and would be very well received by many players, especially those finally migrating to CloD from 1946. Good Luck with it. ~S~

TWC_Fatal_Error
Oct-08-2017, 11:35
Ok we are trying a crack at this script and have run into some issues since OnBuildingKilled does not function,we are attempting to use triggers for our destruction of public civilian areas:

Each trigger was set up initially using a Specific name such as CaenCiv1 . We then used Ground destroyed and designated a radius and an amount of damage set to light 10%. Since we were using a script for this there was no need to do an action that corresponded to CaenCiv1. Hopefully in newer versions the mission builder will let you do more things than call an air group and things like OnBuildingKilled will work as intended.

We also don't want to punish players for mistakes but we do want to make them aware of them. The areas in question are not in the industrial areas depicted on the map but clearly in the City itself. Usually within a 300 yard range of the target so hitting this could be by accident but due only to poor target detection on the part of the bombardier or a absolute intentional strike on a civilian target.
Using the 3 strikes method we have also written a script that keeps track of these bombing infractions and could at a point where the attacks continue then end the player's career at that point.But this player would have been warned privately that this type of behavior is not good for his career.



We are currently testing a second script that calls for OnChiefKilled or the OnAIActorDamaged and placing a vehicle in the area such as an ambulance or city bus or other non military target vehicle but it is all still under testing.

I see no one even attempted to have a go at the code so TWC will gladly share what we have in the hopes that we can get this working with a bit more simplicity with help from the community of coders out there!




public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);

if ("CaenCiv1".Equals(shortName) && active) //simple triggers to start
{
AiAction action = GamePlay.gpGetAction(shortName);//
if (action != null)
{
action.Do();
// doesn't matter what the pre-set trigger action was, we'll do the following:
string name = "!";
if (initiator.Player.Name() != null) name = ", " + initiator.Player.Name() + "!";// this could be used to punish the player but we believe the embarrassment of his mistake could be enough to deter further actions of this type also a private warning of this infraction could be placed in the code bel
GamePlay.gpLogServer(null, "Civilian area bombed! This behavior under investigation!!", new object[] { });
GamePlay.gpHUDLogCenter("A Civilian area in the city of Caen has been bombed!");
if (DEBUG) GamePlay.gpLogServer(null, "Mission trigger " + shortName + " executing now." , new object[] { });
{

}
}
GamePlay.gpGetTrigger("CaenCiv1").Enable = true; // need to reactivate the trigger, can be time delayed if u want
}
}

Kendy for the State
Oct-11-2017, 13:28
Punishment script sounds kind of kinky! I envision some device connected to a USB port that causes me to be flogged with a whip when I do something wrong, like friendly fire.

THANK YOU SIR! May I have another?

Susime
Nov-15-2017, 11:18
To add to this idea, you could place some civilian buildings around the target area and if the civilian buildings get destroyed it could limit that players fuel or bomb load, or limit the whole teams bomb/fuel load, when they next go up. Not sure if this could be done but it's just an idea.

TWC_Flug
Nov-17-2017, 13:26
FWIW this idea is implemented in the TWC Mission and Tactical Servers. If you bomb most any civilian area in a large city, you will get negative points for yourself and your team, and this can lead to demotions and your team losing the match depending on how severe.

The scheme is to use c# scripting and you designate certain objects as indicating civilian areas. One type of object indicates an area of 100 meters radius as civilian, another is 500 meters radius, another is 1km radius, etc. Whenever a bomb drops, when OnBombExplosion is called the script checks for any of these special objects within the given radius and then awards penalty points if any are found.

By using objects with different effective radius (which is programmed into the c# scripting in the mission script) you can cover the entire civilian area of a major city on the map with just a few of the stationary objects, maybe 10-15.

And, 10-15 stationary objects in the mission file is going to have zero effect on the server. When you get somewhere up into the many thousands, and also have maybe 50-100 live players on, then maybe.

But using a scheme like this I have designated basically every civilian area in the entire north of France with maybe a couple hundred stationary objects. This isn't going to affect server performance in any meaningful way.

FYI all the code for Mission Server is online so you are welcome to have a look at it:

https://github.com/bhugh/TWC_Mission_Server

The implementation there gets pretty convoluted because it all fits into a fairly complex scoring, stats, promotion/demotion, mission scoring and (now!) campaign scoring system.

But the basics are very simple. For example, just to make certain area designated as civilian and give the player a HUD message when that area is hit saying "You have bombed a civilian area, you are EVIL!" would be like 10 lines of code.