1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Deathmatch

Discussion in 'Gamemodes' started by nkChehov, Sep 12, 2013.

  1. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    Last edited: Nov 6, 2013
    Tsilliev, NinjaCell, NKking and 4 others like this.
  2. sinnertie

    sinnertie Ministry of Hatred Forum Moderator Donator Tester
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    252
    How did you solve respawn ? Is it in random places ?
     
  3. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    Ofc random: have 10 points at map, for example, and algorithm just take one of them
     
  4. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Can you please explain how the random code works?
    from DM.as the random is:
    Code:
    u8 spawn_point = Random(respawnPos.length);
                while(spawn_point == last_spawn_point) spawn_point = Random(respawnPos.length);
    So where is this "Random" located at?
     
    Asu likes this.
  5. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
  6. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Thanks!
     
    Asu likes this.
  7. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    Code:
    Vec2f getSpawnLocation(PlayerInfo@ p_info)
        {
            CMap@ map = getMap();
    
            if (map !is null)
            {
                Vec2f[] respawnPos;
    
                if (!map.getMarkers("blue main spawn", respawnPos )) // here it just take all the coordinates of markers at the map (open one of them to understand what i mean)
                {
                    return Vec2f(0,0);
                }
           
                u8 spawn_point = XORRandom(respawnPos.length); // and just take one of this points
                while(spawn_point == last_spawn_point) spawn_point = XORRandom(respawnPos.length); // this need just to be sure to not take 2 similar spawn points for 2 ppl
                last_spawn_point = spawn_point;
                return respawnPos[spawn_point];
            }
            return Vec2f(0,0);
        }
     
    Last edited: Oct 8, 2013
    Tsilliev likes this.
  8. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Nope, it doesn't respawn me at start, its like it doesn't give me a spawn.
    @Geti
    About the fish, I got the idea i need to use:
    Code:
    while(i ++< 3)
                    {
                        Vec2f pos = Vec2f(x,y-i*map.tilesize);
                                  }
    
    But where do I put that, surely I can put it at setup bases, but the spawn will be static.
    I am thinking of isSpawning and change the pos to the above, or use xorrandom, on a second thought, at AddPlayertoSpawn there is spawn_point.
     
    Last edited: Oct 18, 2013
    Asu likes this.
  9. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    whoa, that indentation is terrible.

    It sounds to me like you're not really understanding what the code you're writing/copypasting is doing.
    You don't need to put that into anywhere, that code doesn't do anything without a declaration of i
    Code:
    (presumably int i = 0;)
    and it only defines a position _inside_ those brackets, so it will have no effect.

    You need to explicitly say what you want to do if you want help with this. What do you want to achieve?

    fix'd your post so code looks like code and not a smiley
     
    Last edited by a moderator: Oct 19, 2013
  10. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    I would like every player to randomly spawn around the map and not in the air, I have removed the setupbases, and players spawn on the edge.

    I am trying to make RP colonization, ie, you spawn somewhere, explore and choose a place to settle, but at the moment everyone spawns at the left side.

    I tried to run the current mod even with xorrandom, but it doesnt let me spawn on start up.
    Thanks for replying.
     
    Last edited: Oct 19, 2013
    Asu likes this.
  11. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    soon ill update all my mods and you may try a 100% working version
     
  12. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Thank you :)
     
    Asu likes this.
  13. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    Update
    • Update to build B932
    • Added bombs =)
     
  14. Tsilliev

    Tsilliev Haxor

    Messages:
    414
    Thanks "D
     
    Asu likes this.