![]() |
Request for scripters: Death/ESC-Ban
May I ask any talented c# expert to give me a hint how to install a kind of "death ban" script of online-players for
-leaving their plane via ESC without beeing on safely on the ground -after X number of deaths to have a ban for Y minutes. To draft our server-concept: We run an dedicated online server and our approach is orientated on historically circumstances and based on daily reports of missions during July 1940. Every ingame hour one mission is launched to simulate certain events of these days as far as possible with the given tools. The nature of these missions demand teamplay and organization, the player will have little chance flying alone or in small numbers and should stick to the tasks given. 95% of the online players just jump into a plane and go straight the shortest way to where they expect to find the fast action, that`s utterly ok (I myself do this also, when I am in the mood), but to have some diversity in servers, we choosed to keep this kind of gameplay out of our server as far as possible. (There are other and better servers for the fast fun&action). That`s why I am looking for a tool to "punish" players, who just press ESC to choose another and give killed pilots a few minutes to think about what they did wrong. Any help would be greatly appreciated. ;) Brgds SNAFU |
I can not script it but as you ask for a hint it is possible to remember player's name as adonys describes here http://forum.1cpublishing.eu/showthread.php?t=25817 then check if he left (not bailed out) the plane on the ground or in the air and if the latest break engine of his next aircraft onPlaceEnter and write a message on screen for him like "Sorry, it is prohibited to exit your plane while you are still in the air... etc. Try selecting a new plane in 1 minute."
I would be also interested to have this script running on Repka servers if someone can write it properly. |
Quote:
|
Quote:
Quote:
|
Quote:
Also possible, but I assume the casual player will spawn, curse, ESC, Spawn, curse, repaeat... and get loud, which would lead to a lot of planes spawing and therefore lags, but if it`s only feasible this route, would be ok also. ;) I like designing missions, but I don´t have time and the nerves to get myself into C# beyond just taking what I find and copy it together... ;) Quote:
But anyhow, if someone of the scripters would get his hands on a such lines, I`ll buy him a beer. ;) |
Thinking about it, I would even consider Ataros suggestion with blocking the players fuel pump as penalty as the best solution.
|
My quick and dirty solution ;) (for Beta Patch)
Code:
using System; |
PrisonCamp! :grin: LOL
Great idea! Thank you! Programming can be very creative :) Will do my best to enforce it on Repka servers. Since the script builds a list of prisoners anyway may I ask to add a message "player ... is killed by ..." instead of "AI was killed by..." as described by adonys here when you have some time? http://forum.1cpublishing.eu/showthread.php?t=25817 ps. Does the script excludes pilots who bailed-out from list of prisoners? |
Yes please someone try and work with this..
Nothing more annoying than everyone you shoot creating another plane and you've shot down 'AI' again.....really!? I've done this myself and its just annoying so I at least try an bail.. Any aircraft destroyed should be a kill and any aircraft your in that is destroyed or you bail from should be a death counted against you.. The stats have no meaning at all...As you know that everyone on the list has been shot down numerous times but has just created another plane when they've got themselves in trouble.. Everyone likes to know who they have shot down..come on Its also adds to the enjoyment of the game as your finishing them off or trying to evade to stay alive...instead of taking lote of hit, giving up and respawning |
Quote:
|
Thank you indeed Kodiak! I will try this as soon as I am home again (should not be before Sunday evening).
If you tell me how to extend this script with a kind of death-penalty (maybe "You are on Cloud 7 - Wait for the bells!")? As a return I could offer a personalized 109 skin, maybe not the best, but certainly unique... :-P :cool: |
Corrected Script after Ataros hint with bail out:
if the player bailed out OnPlaceLeave is also called and then OnPlaceEnter is called but the Actor is null. So i remove the player from prison if that's the case. Code:
using System; |
So for simpletons what does this mean..
A: If player bails out from plane after taking Dmg =? B: If player creates another plane after Dmg which AI now fly the plane =? Thanks for your work ~S~ |
After bailing the plane should hit the ground.
If the player leaves the plane and creates a new one the ai gets active. Or you destroy() the plane via script. |
Thank you. Implemented this into my mission script and put it online, currently running on the III/JG27 Server. Unfortunatly I have no chance to test it.
But I got it to the "plane-destroy-after-ESCleaving-script" with its OnPlaceLeave- and OnPlayerEnter- Call-ups, without putting out error messages, so far. So the plane is destroyed after abandoming and the player should get 10mins break, by blocked fuel pump in the next 10mins (I increased the time and that was what I thought the script does) If someone is able to test it on our server, please report back. My Mission-Skript looks following: ...Well, 169574 characters and only 50000 allowed.... |
Testing now - at the moment i've to wait 10min ;)
|
Another suggestion is to print time left for player till he can create new plane on screen.
Is it possible to add the last damager to the chat message for everyone to let everyone know who shot him down? |
Quote:
|
Quote:
|
@SNAFU
The fuelpump doesn't block! Haste mal wieder die Klammern durcheinandergebracht? :-P Quote:
Quote:
|
Maybe something like this would work?
Code:
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure); |
At my Testmission FuelPumpFailure works without a problem. So i dont know what's going wrong.
|
1 Attachment(s)
@Kodiak, nö, dann hätte er ja Fehlermeldungen rausgespuckt. I just get the usual "Object not set to a reference" messages as before, nothing unusual...
Does the script recognize that the player just spawned and wants to change the airfield, so didn´t even takeoff? Will the player get a penalty then also? I attached the script below. I have also the "plane-destroy-after-abandoming" script running, so I have troubles with calling up the "OnPlayerLeave" parts twice. |
No the script uses Aircraft.IsAirborne, if true the plane is in the Air, if false the plane is on ground. But this works only again in the Beta Patch and then i hope so forever after the next reqular patch. ;)
I will take a look at your script. At the moment i work on your Death penalty -> Brzzzzlll ;) and on the Arrest Count Down. |
Nice! :)
If you need further infos let me know, I`ve got access to our server, but not the game installed on my notebook. |
New Version, added Player Countdown, changed Player in Prisoncell from object refence to Playername, so the penalty should be still active, even the player reconnected.
Code:
using System; |
Thanks, I try now to load that script via submission and currently running on our server.
If someone is able to test, please report back... ;) |
So another Script, Player Plane Memory function. ;)
actual its a early 'alpha' it's shows the playername after shootdown, even if the enemy player leaved the plane via esc or bailed out. then a short message will shown playername1 shoot down by playername2. the message is only shown if a human shoot down a human, the others are in work. Knows anybody how to disable the gamemessages in chat or override them? I actually hoped we get this possibility with the beta patch, so we can change the game messages against our own messages, but i don't find anything. But i look deeper in it ;) Code:
using System; |
Allright, I just put these 2 scripst 1to1 into an empty submissions and load them into the main mission via mainscript.
Concerning your penalty script: Message and countdown works fine, only the fuelpump is still operable after penalty. I am now trying different damage types, will report back. I added the other damagetypes as you see below, but they all are ignored, I just can take off as usual. . . . if (ArrestTime.TotalSeconds < TotalArrestTime) { TimeSpan RestTime = pri.ArrestEndTime.Subtract(DateTime.Now); GamePlay.gpLogServer(null, "Player: {0} gets a time penalty for leaving Airplane in flight\n", new object[] { player.Name() }); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.ControlsElevatorDisabled); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.ControlsAileronsDisabled); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.ControlsRudderDisabled); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.FuelPumpFailure); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.FuelTank0Exploded); (actor as AiAircraft).hitNamed (part.NamedDamageTypes.Eng0TotalSeizure); } . . . PS: Tested the script also on an empty mission, without any other script with the same results... no penalty. ;( |
Are the player planes created in Submission or Mainmission?
|
Player planes are spawned on airfields of mainmission. But also didn´t work when I load the script as sole script of the main-mission, as mainscript, if you know what I mean. ;)
MissionA.mis (spawn-airfield) MissionA.cs (penalty script) |
So i tested the script as a single and a multiplayer version (as host) without any problem. But i don't have a dedicated server so i can not test this case.
Think we should meet us in ts, so we can run a test on a dedi. Edit: Ok there is a problem with Dedicated Server, hitnamed seems to be ignored. |
So script modified, hitnamed not working on dedicated so i use cutlimb ;)
On ground the Undercarriage is cut off and in Air the tail (@SNAFU: Works with Spitfires also, problem on spitfire was only one part should be cut off, all others are ignored). Code:
using System; |
When tested the script on III./JG27 Server (iirc) I was still able to enter aircraft that were already flying in AI groups while under arrest.
|
The script is currently not used on our server, due to problems with changing place in mulitcrew planes, but Kodiak posted that is aware of this problem and is going to correct it. ;)
|
All times are GMT. The time now is 04:49 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.