![]() |
Hi chaps,
figured I'd crash and burn on my first attempt. I'd like to mention the fact that I have virtually no experience with C# and am more or less learning this stuff via copy and paste :mad::grin: Kodiak, I dropped your script from post#2 (trying to keep it simple) into one of my missions, pressed compile and was greeted with numerous error messages that I can't wrap my head around atm. It is the only script within the mission. ----------------------------------------------------------------------- c:\Users\Gromic\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BOB\BOB1.cs(1,13): error CS1518: Klasse, Delegat, Enumeration, Schnittstelle oder Struktur erwartet. c:\Users\Gromic\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BOB\BOB1.cs(1,67): error CS1001: Bezeichner erwartet c:\Users\Gromic\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BOB\BOB1.cs(1,69): error CS1518: Klasse, Delegat, Enumeration, Schnittstelle oder Struktur erwartet. c:\Users\Gromic\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BOB\BOB1.cs(14,44): error CS1518: Klasse, Delegat, Enumeration, Schnittstelle oder Struktur erwartet. c:\Users\Gromic\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BOB\BOB1.cs(22,13): error CS1022: Typ- oder Namespacedefinition oder Dateiende erwartet. ----------------------------------------------------------------------- I figured that the initial script was in raw form so I ammended line 9 from: GamePlay.gpHUDLogCenter(null, msg, parms); to GamePlay.gpHUDLogCenter("en", "msg red", null ); Help! And let me be so kind as to say in advance, thank you for all that you, and others, have done with scripting. Especially with the lack of documentation from 1C. Cheers Gromic |
Seems you have set a wrong or missing Bracket. Can you show me your complete code please.
Deutsche Fehlermeldungen mir deucht ich hab nen Landsmann (oder Umgebung) vor mir ;) GamePlay.gpHUDLogCenter("en", "msg red", null ); couldn't work gpHUDLogCenter needs in this case a array of players as first argument (or null - null meens send message to all) Added a example script |
Moin Kodiak ;)
This is the code I was using. It's yours from post 2 of this thread. Code:
private void sendScreenMessageTo(int army, string msg, object[] parms) P.S. Landsmann ist richtig. Dürfte vermutlich nicht mal so weit von dir sein da "Bayern" auch bei mir im Perso steht. Nähe Aschaffenburg. Schöne Grüße und danke für alles was du bisher für die Community getan hast! |
Ah ok now i know the error:
These lines you copy are useless, without using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { // place the code here } |
Right, now I really look foolish. I'd forgotten to add the librarys.
We've got a chap in our squad that works with C# professionally and he sacrificed some time and helped me with a script, using the ones that you've so kindly donated as a basis to go on. He's come up with a script that works perfectly. We have it running on our dedicated server. Here's an excerpt from one of our sub-missions. Code:
using System.Collections.Generic; Cheers Gromic |
@ FG28_Kodiak
I am making a simple mission on Steppe map and trying to modify a script by TheEnlightenedFlorist which sends messages to a particular player in MP onPlaceEnter. I want to define a new method to do this in 3 languages, but I do not know how to do it correctly. Also I included a multi-engine aircraft into limited list and wonder if the script would kill its engines correctly. I included my questions into remarks. Would be grateful for any advice. Thank you for all your great help! Code:
using System; |
Script corrected:
Code:
using System; notAvailableMsg(new Player[] { player }); -to-> notAvailableMsg(player); notAvailableMsg needs a argument from type Player not an array of it. aircraft.hitNamed(...); -to-> (actor as AiAircraft).hitNamed(...) aircraft was not declared - as alternative you can declare AiAircraft aircraft = actor as AiAircraft; ---- //(actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0Tot alFailure); // Is this line for single-engined only? Yes, you kill the first engine with it. // Will this do for multi-engine? int iNumOfEngines = ((actor as AiAircraft).Group() as AiAirGroup).aircraftEnginesNum(); for (int i = 0; i < iNumOfEngines; i++) { (actor as AiAircraft).hitNamed((part.NamedDamageTypes)Enum.P arse(typeof(part.NamedDamageTypes), "Eng" + i.ToString() + "TotalFailure")); } Yes its correct. "Too many aircrafts of this type! Choose another aircraft." translated into german: "Limit für diesen Flugzeugtyp erreicht! Wähle ein anderes Muster!" |
Thank you very much!
|
Made some rework on the script:
latest version: http://forum.1cpublishing.eu/showpos...8&postcount=41 Added a exept version: private void sendChatMessageTo(int army, string[] exepttoplayerlanguages, string msg, object[] parms) private void sendScreenMessageTo(int army, string[] exepttoplayerlanguages, string msg, object[] parms) Second Argument is a array of string. so you can enter the languages this message should not be send sendScreenMessageTo(-1, new string[] { "de", "ru" }, "Hello", null); usefull if you have send a Message to for example the german players but dont want send a other language message to them sendScreenMessageTo(-1, "de" }, "Hallo", null); sendScreenMessageTo(-1, new string[] { "de" }, "Hello", null); so the germans (with the german game version) get the german "Hallo" and all other players gets the english "Hello". |
Just WOW! A lot of work and quality one. I will use it in a new mission version.
BTW can I replace my methods that send messages to individual players with your methods somehow? I use methods like follows: Code:
private void objMsg(Player player) I will replace "de" message if you give me a translation :) |
All times are GMT. The time now is 03:44 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.