Gametype: Last Man Standing
Moderator: PPS-Leaders
Re: Gametype: Last Man Standing
looks like I'm in a posting spree, but I just remembered what I did when the game crashed: I added some bots (addbots x), then removed them again (killbots x) - the game crashed because the removed bots are still in the map timeToAct_. you need to erase leaving players from all your maps in LastManStanding::playerLeft().
Fabian 'x3n' Landau, Orxonox developer
Re: Gametype: Last Man Standing
About the last commit:
Done:
-all maps are erased correctly
-camper alert message vanish immediately
-respawn delay message counts down
-new players get the minimum of all lives available, but always more than 0.
Next:
-HUD: Shouldn't be very difficult, but I still have to figure out how to do it.
-punishment function which deals damage to the pawn: That suggestion was very helpful for me, since I didn't really understand how the pawn class worked. Although I learned something essential about orxonox, my first implementation caused crashes, so I commented it out.
-wrong placed part in the ring: That bug is weird: Whenever I reload the level the double pillars are located differently. (Or more exact the second pillar doesn't seem to be located always on the same possition.)
P.S: Thanks a lot x3n! Your review had been really helpful.
Done:
-all maps are erased correctly
-camper alert message vanish immediately
-respawn delay message counts down
-new players get the minimum of all lives available, but always more than 0.
Next:
-HUD: Shouldn't be very difficult, but I still have to figure out how to do it.
-punishment function which deals damage to the pawn: That suggestion was very helpful for me, since I didn't really understand how the pawn class worked. Although I learned something essential about orxonox, my first implementation caused crashes, so I commented it out.
-wrong placed part in the ring: That bug is weird: Whenever I reload the level the double pillars are located differently. (Or more exact the second pillar doesn't seem to be located always on the same possition.)
P.S: Thanks a lot x3n! Your review had been really helpful.
Fail. Fail again. Fail better.
Re: Gametype: Last Man Standing
cool, I just tested it and the new features seem to work well
It's a little tricky to get the players lives though. The hud-element belongs to the player (PlayerInfo) - so in the hud element, you can use something like this:
Pawn* pawn = dynamic_cast<Pawn*>(this->getOwner()->getControllableEntity());
LastManStanding* lms = dynamic_cast<LastManStanding*>(this->getOwner()->getGametype());
int lives = lms->getRemainingLives(pawn);
Note that getRemainingLives() would be a function in LastManStanding and has to be implemented first. You should also add a few if-statements in this code, because all getXYZ() functions and dynamic_casts could potentially return a NULL pointer.
Feel free to ask if something is unclear - or just create the new files for the hud element and do as much as you can, then cry for help
1) the hole exists because your first for-loop doesn't start with 0. I tested this and it worked for me:
2) The flickering happens because you have a 2nd for-loop that creates 16 nested pillars with different size at the same position
you can safely remove the second for-loop and set j = 1 or maybe j = math.random() * 0.2 + 0.8 if you want some randomness.
You have to create a new overlay element. Have a look at Pong or TeamBaseMatch, both gametypes have a custom HUD element that displays some text (score, players, bases, ...). You can create a new element that inherits from OverlayText and implements a tick() function. In each tick the overlay element checks the number of remaining lives of the player and sets the displayed text accordingly. Have a look at src/modules/overlays/hud/TeamBaseMatchScore.cc as an example.-HUD: Shouldn't be very difficult, but I still have to figure out how to do it.
It's a little tricky to get the players lives though. The hud-element belongs to the player (PlayerInfo) - so in the hud element, you can use something like this:
Pawn* pawn = dynamic_cast<Pawn*>(this->getOwner()->getControllableEntity());
LastManStanding* lms = dynamic_cast<LastManStanding*>(this->getOwner()->getGametype());
int lives = lms->getRemainingLives(pawn);
Note that getRemainingLives() would be a function in LastManStanding and has to be implemented first. You should also add a few if-statements in this code, because all getXYZ() functions and dynamic_casts could potentially return a NULL pointer.
Feel free to ask if something is unclear - or just create the new files for the hud element and do as much as you can, then cry for help
Really? I just commented it in and it works fine for me-punishment function which deals damage to the pawn: That suggestion was very helpful for me, since I didn't really understand how the pawn class worked. Although I learned something essential about orxonox, my first implementation caused crashes, so I commented it out.
I had a look at it and there are actually 2 problems:-wrong placed part in the ring: That bug is weird: Whenever I reload the level the double pillars are located differently. (Or more exact the second pillar doesn't seem to be located always on the same possition.)
1) the hole exists because your first for-loop doesn't start with 0. I tested this and it worked for me:
Code: Select all
<?lua
max = 16
for i = 0, max, 1
do
y = math.sin(i/max*6)*750
z = math.cos(i/max*6)*750
?>
you can safely remove the second for-loop and set j = 1 or maybe j = math.random() * 0.2 + 0.8 if you want some randomness.
Fabian 'x3n' Landau, Orxonox developer
Who is online
Users browsing this forum: No registered users and 5 guests