Was laut C# noch kommt

    Unser Forum verwendet Cookies. Durch die Nutzung unserer Seite erklärst du dich damit einverstanden, dass wir Cookies setzen. Datenschutzerklärung.


    Entscheidet mit wie es mit dem Forum in Zukunft weitergehen soll -> Status & Umfrage

      Was laut C# noch kommt

      Hey ich bin ja seid gestern(18.06.2014) hier und habe mich auch schon gut zurecht gefunden... Schönes Forum und Nette Community ;)

      Ich Programmiere ja auch etwas C# und habe mich dann mal etwas eingelesen in die Daten von The Forest und habe dann Dateien wie CarGUI.cs und CarUserControl.cs gefunden was vermuten lässt das man Fahrzeuge bekommen kann. Ob gecraftet oder gebaut weiß ich noch nicht.

      CarUserControl.cs:
      Spoiler anzeigen

      Quellcode

      1. using UnityEngine;
      2. [RequireComponent(typeof (CarController))]
      3. public class CarUserControl : MonoBehaviour
      4. {
      5. private CarController car;
      6. private void Awake()
      7. {
      8. this.car = this.GetComponent<CarController>();
      9. }
      10. private void FixedUpdate()
      11. {
      12. this.car.Move(CrossPlatformInput.GetAxis("Horizontal"), CrossPlatformInput.GetAxis("Vertical"));
      13. }
      14. }


      CarGUI.cs:
      Spoiler anzeigen

      Quellcode

      1. ​using System;
      2. using UnityEngine;
      3. [RequireComponent(typeof (GUIText))]
      4. public class CarGUI : MonoBehaviour
      5. {
      6. private string display = "{0:0} mph \nGear: {1:0}/{2:0}\nRevs {3:0%}\nThrottle: {4:0%}\n";
      7. private const float MphtoMps = 2.237f;
      8. public CarController car;
      9. private void Update()
      10. {
      11. object[] objArray = new object[5];
      12. int index1 = 0;
      13. // ISSUE: variable of a boxed type
      14. __Boxed<float> local1 = (ValueType) (float) ((double) this.car.CurrentSpeed * 2.23699998855591);
      15. objArray[index1] = (object) local1;
      16. int index2 = 1;
      17. // ISSUE: variable of a boxed type
      18. __Boxed<int> local2 = (ValueType) (this.car.GearNum + 1);
      19. objArray[index2] = (object) local2;
      20. int index3 = 2;
      21. // ISSUE: variable of a boxed type
      22. __Boxed<int> local3 = (ValueType) this.car.NumGears;
      23. objArray[index3] = (object) local3;
      24. int index4 = 3;
      25. // ISSUE: variable of a boxed type
      26. __Boxed<float> local4 = (ValueType) this.car.RevsFactor;
      27. objArray[index4] = (object) local4;
      28. int index5 = 4;
      29. // ISSUE: variable of a boxed type
      30. __Boxed<float> local5 = (ValueType) this.car.AccelInput;
      31. objArray[index5] = (object) local5;
      32. this.guiText.text = string.Format(this.display, objArray);
      33. }
      34. }


      Ebenfalls ist auch der Chat und das beklettern der Bäume eingebaut aber nicht aktiviert... Ich werde noch etwas weiter suchen und mal gucken ob man diese Features manuell aktivieren kann.


      Wörter sind es oft nicht wert Groß geschrieben zu werden.
      Ich glaube das ist einfach ein CharakterContoller - es wird sicher keine Autos geben, oder bist im falschen Spiel gelandet... ;)

      Oder die Entwickler haben sich mal einen Spass gemacht und haben während der Entwicklungsphase für sich ein Auto reingehauen, um etwas Abwechslung zu haben...
      Intelligenz schützt nicht vor Dummheit.

      fionera schrieb:

      Hey ich bin ja seid gestern(18.06.2014) hier und habe mich auch schon gut zurecht gefunden... Schönes Forum und Nette Community ;)

      Ich Programmiere ja auch etwas C# und habe mich dann mal etwas eingelesen in die Daten von The Forest und habe dann Dateien wie CarGUI.cs und CarUserControl.cs gefunden was vermuten lässt das man Fahrzeuge bekommen kann. Ob gecraftet oder gebaut weiß ich noch nicht.

      CarUserControl.cs:
      Spoiler anzeigen

      Quellcode

      1. using UnityEngine;
      2. [RequireComponent(typeof (CarController))]
      3. public class CarUserControl : MonoBehaviour
      4. {
      5. private CarController car;
      6. private void Awake()
      7. {
      8. this.car = this.GetComponent<CarController>();
      9. }
      10. private void FixedUpdate()
      11. {
      12. this.car.Move(CrossPlatformInput.GetAxis("Horizontal"), CrossPlatformInput.GetAxis("Vertical"));
      13. }
      14. }


      CarGUI.cs:
      Spoiler anzeigen

      Quellcode

      1. using System;
      2. using UnityEngine;
      3. [RequireComponent(typeof (GUIText))]
      4. public class CarGUI : MonoBehaviour
      5. {
      6. private string display = "{0:0} mph \nGear: {1:0}/{2:0}\nRevs {3:0%}\nThrottle: {4:0%}\n";
      7. private const float MphtoMps = 2.237f;
      8. public CarController car;
      9. private void Update()
      10. {
      11. object[] objArray = new object[5];
      12. int index1 = 0;
      13. // ISSUE: variable of a boxed type
      14. __Boxed<float> local1 = (ValueType) (float) ((double) this.car.CurrentSpeed * 2.23699998855591);
      15. objArray[index1] = (object) local1;
      16. int index2 = 1;
      17. // ISSUE: variable of a boxed type
      18. __Boxed<int> local2 = (ValueType) (this.car.GearNum + 1);
      19. objArray[index2] = (object) local2;
      20. int index3 = 2;
      21. // ISSUE: variable of a boxed type
      22. __Boxed<int> local3 = (ValueType) this.car.NumGears;
      23. objArray[index3] = (object) local3;
      24. int index4 = 3;
      25. // ISSUE: variable of a boxed type
      26. __Boxed<float> local4 = (ValueType) this.car.RevsFactor;
      27. objArray[index4] = (object) local4;
      28. int index5 = 4;
      29. // ISSUE: variable of a boxed type
      30. __Boxed<float> local5 = (ValueType) this.car.AccelInput;
      31. objArray[index5] = (object) local5;
      32. this.guiText.text = string.Format(this.display, objArray);
      33. }
      34. }



      Ebenfalls ist auch der Chat und das beklettern der Bäume eingebaut aber nicht aktiviert... Ich werde noch etwas weiter suchen und mal gucken ob man diese Features manuell aktivieren kann.


      Das man später selber auf Bäume klettern kann, ist bereits bekannt. Allerdings würde ein Auto nicht zum Flair des Spiels passen, meiner Meinung nach. Ist aber auch davon abhängig wie groß die Map später werden soll. Man darf also weiterhin gespannt bleiben. ^^
      Also wenn ich das mit meinem gefährlichen Halbwissen mal durchgehe, ist im angezeigten Code durchaus von einem Fahrzeug, das auch die dementsprechend erwartete Funktion bietet, die Rede. Nicht nur der CarController als Runtime type wird hier direkt angesprochen (Werte aus der Type auslesen vermute ich mal), sondern auch hat das "Fahrzeug" hier bereits klare Definitionen erhalten wie es auch sonst üblich wäre: Acceleration (Beschleunigung), die Geschwindigkeit (Speed), mit der sich das Fahrzeug bewegt, dass es eine Schaltung mit Rückwärtsgang geben soll und auch eine klare Definition von float Variablen für zB die Geschwindigkeitsanzeige am Fahrzeug-HUD "angecoded/anprogrammiert" seh ich da mal raus, ist also soweit schon da.

      Inwieweit der Code aber fertig ist, kann ich mit meinem Wissensstand nicht sagen (natürlich auch weil das nur Codeausschnitte sind) und irgendwie find ich die Prozeduraufruf ganz interessant, der mit FixedUpdate benannt ist. Meine persönliche (Achtung: rein subjektive Schlussfolgerung) Annahme wäre, dass das Codebereiche erst mit bestimmten Updates erst aktiv werden - grob ausgedrückt.

      Vielleicht sagt dem Sascha der Code mehr als mir ^^
      Von mir verfasste Beiträge befinden sich unter der Creative Commons Lizenz 3.0
      •[ Profil im The Forest Forum & Profil im Stranded Deep Forum ]•