Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Some help could be pleasant at-least

Discussion in 'Unity 3D' started by Screamernail, Apr 12, 2017.

  1. (This forum really need to come back really)

    I need quick help with my project. I made some super basic scripts and now i want them to be more advanced. Can anyone help here?

    I'll send forth the project's file over here but first comment on this thread so i know that i'm not wasting my time.
     
  2. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,952
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    How is it not wasting your (and ours) time when you give exactly zero details?
     
  3. LordDz

    LordDz

    Joined:
    May 11, 2007
    Messages:
    4,303
    Resources:
    0
    Resources:
    0
    function basic()
    {
    return 1 + 1;
    }

    function sayHello()
    {
    console.WriteLine("Hello and howdy!");
    }
     
  4. Hotwer

    Hotwer

    Joined:
    Mar 10, 2013
    Messages:
    370
    Resources:
    0
    Resources:
    0
    He was probably checking out if the forum was dead or not.
     
  5. Okay then the forum seemed not to be dead(I hope) and i admit i don't know how to exactly send the ENTIRE file through here so i'll give you the scripts.

    using UnityEngine;
    using System.Collections;

    public class PlayerControls : MonoBehaviour {

    public bool Active;
    public float Speed;

    void Start () {
    Active = true;
    }

    void Update () {

    if (Input.GetKey (KeyCode.LeftArrow) && Active == true)
    {
    transform.Translate (new Vector3 (-Speed, 0, 0));
    }
    if (Input.GetKey (KeyCode.RightArrow) && Active == true)
    {
    transform.Translate (new Vector3 (Speed, 0, 0));
    }

    if (Input.GetKey (KeyCode.UpArrow) && Active == true)
    {
    transform.Translate (new Vector3 (0, Speed, 0));
    }
    if (Input.GetKey (KeyCode.DownArrow) && Active == true)
    {
    transform.Translate (new Vector3 (0, -Speed, 0));
    }

    }
    }

    This next one is meant to be different than how other RTS controls works. (Because it's easier for someone like me)
    using UnityEngine;
    using System.Collections;

    public class UnitControls : MonoBehaviour {

    public int MaxTurnPoints = 3;
    public int TurnPoints;
    public float TPfloat = 0.1f;
    float TPGone;
    public bool Active;
    public float Speed;
    public PlayerControls player;
    Rigidbody2D Rigy;

    void Start(){
    Rigy = gameObject.GetComponent<Rigidbody2D> ();
    TurnPoints = MaxTurnPoints;
    }

    void OnMouseUp () {
    if (player.Active == true) {
    Active = true;
    player.Active = false;
    Rigy.isKinematic = false;
    }
    }

    void Update () {

    if (Input.GetKey (KeyCode.LeftArrow) && Active == true && TurnPoints != 0)
    {
    transform.Translate (new Vector3 (-Speed, 0, 0));
    TPGone += Time.deltaTime;
    }
    if (Input.GetKey (KeyCode.RightArrow) && Active == true && TurnPoints != 0)
    {
    transform.Translate (new Vector3 (Speed, 0, 0));
    TPGone += Time.deltaTime;
    }

    if (Input.GetKey (KeyCode.UpArrow) && Active == true && TurnPoints != 0)
    {
    transform.Translate (new Vector3 (0, Speed, 0));
    TPGone += Time.deltaTime;
    }
    if (Input.GetKey (KeyCode.DownArrow) && Active == true && TurnPoints != 0)
    {
    transform.Translate (new Vector3 (0, -Speed, 0));
    TPGone += Time.deltaTime;
    }
    if (Input.GetKeyDown (KeyCode.Escape) && Active == true) {
    Active = false;
    player.Active = true;
    Rigy.isKinematic = true;
    }

    TPfloat += Time.deltaTime;
    if (TPfloat >= 5f) {
    TPfloat = 0f;
    TurnPoints += 1;
    }
    if (TurnPoints >= MaxTurnPoints) {
    TurnPoints = MaxTurnPoints;
    }
    if (TPGone >= 1f) {
    TPGone = 0f;
    TurnPoints -= 1;
    }
    }
    }

    This one is unfinished.
    using UnityEngine;
    using System.Collections;

    public class UnitStats : MonoBehaviour {

    public int Health = 20;
    public int Armor;

    public bool Mechanical;

    public int MaxDamage = 4;
    public int MinDamage = 6;
    public float AttackDuration = 0.1f;
    public float AttackSpeed = 0.3f;
    public float AttackTime = 1.5f;
    public GameObject Projectile;

    void Start () {

    }


    void Update () {

    }
    }

    I'm a really basic programmer so some help can be of need here.
     
  6. Hotwer

    Hotwer

    Joined:
    Mar 10, 2013
    Messages:
    370
    Resources:
    0
    Resources:
    0
    We're not going to teach how to develop.

    Maybe you can point out what's the problem you're having.
     
  7. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,952
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Again, you didn't give any details, just some arbitrary code. What are you having problems with?

    If you have a specific question, shoot. If it's a generic "how do I make code for X type of game", search for tutorials, there are plenty of them.

    Use the [code] tag.
    E.g. [code=cs]stuff[/code]
     
  8. I just wanted to know how to advance the codes. Might just look up Youtube.


    And aren't this and the main forum "Game Development" made for teaching?
     
  9. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,952
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    There are countless of tutorials, more and less specific, for Unity, and pretty much anything else. If you want to learn C#, or Unity development, it will be much faster for you to simply look for them. In addition, if you have a question, you can most definitely be assured that someone had it before you, asked it somewhere on the internet, and got the answer. If it's a programming question, this will most likely be on stackoverflow.
    The skill you will most need in your life as a programmer of any kind is searching for information.
    While you can ask questions here, and you will likely get an answer if they are not generic, it will simply save you a lot of time to search them on a search engine.

    Now, the issue with your questions in this thread, is that they aren't questions.
    You simply posted some arbitrary code, not saying what it is, what you want, and what you're having trouble with.

    As an example - if you have a specific problem, like "why is this code that's supposed to do X not working and I get error Y", you will probably get an answer.
    If you ask "how do I make all of the code for a game of type X", you won't, but searching for relevant tutorials might help you.
     
  10. LordDz

    LordDz

    Joined:
    May 11, 2007
    Messages:
    4,303
    Resources:
    0
    Resources:
    0
    Answered in the quote on things you can do to make it better.
     
  11. Thanks i'll see what i can do.

    You guys want to know what the project is?

    Reufo2D:
    It where first going to be a 3D Real Time Strategy game, but alas i am weak when it goes to 3D.

    As you people would notice by the code it was going to be a unique slow game instead of real-time. This takes place in a world which has Morna as the magic (Morna like in my Xillu world) and i decided to put the Uothi (Mellia's specie) in the game. It's very similar to Warcraft 3 except the controls are different.

    I planed it to be a 3DS game because it got a touch screen.
    You first control the camera, moving it around and click on things. When you select a unit the camera controls are disabled and you can move, attack and cast abilities with the unit. However any of these actions will remove a unit's turn-points. If all of them depletes then you must wait for the unit to regain point after point. (Meanwhile you'll command the other units)

    I need to think for more game-play mechanics but in the meanwhile, is it worth doing this game?