A little question

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

A little question

Post by Guerro323 »

Hello all, I want to know how to force a team or a player to capture a checkpoint then they can capture a gate then they can capture a goal.
Cordially, guerro :yes:
C'est Grandiose!
Image
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: A little question

Post by Eole »

You're question is quite broad. You're almost asking us to write the whole game mode script in your stead. ^^
You should try to write your mode and divide the big question into smaller problems. Then see what you can do and what you can't. You can check the script of Siege to see how it works, the logic behind the unlocking of the gates is quite similar to what you want to do. You'll also probably have to create a custom map type.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: A little question

Post by Guerro323 »

I don't want that anyone write the script for me, I just want to know how to manage the capture between the goal or checkpoint or gate.
Because when I use this :

Code: Select all

foreach(Pole in BlockPoles) {
    foreach(PlayerId in Pole.Sector.PlayersIds) {
        declare Player <=> Players[PlayerId];
        if(Player == Null) {
            continue;
        } else {
            Pole.Gauge.Speed = 1;
            Pole.Gauge.Max = 3000;
            Pole.Captured = True;

            if (Pole.Gauge.Value == Pole.Gauge.Max) {
                Player.Score.Points += 1;

                MB_StopRound = True;
                Message::SendBigMessage(TextLib::Compose("$<%1$> has loaded the Pole!", Player.Name), 4000, 10);
                break;
            }
        }
    }
    if (Pole.Sector.PlayersIds.count == 0) {
        Pole.Gauge.Speed = 0;
        Pole.Gauge.Value = 0;
        Pole.Captured = False;
    }
}
( That I found on the documentation ), I just want to know how to obligate for player to capture a checkpoint for exemple and not a pole. :?:
C'est Grandiose!
Image
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: A little question

Post by djhubertus »

Create global variable that will store state number, for example:
0 - no captures
1 - Captured checkpoint
2 - Captured gate
3 - Captured Pole

and then, check, is next goal should be active by comparing variable to specific state.

EDIT: Checkpoint is also a pole so you need to check objects via name tags.
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: A little question

Post by Guerro323 »

djhubertus wrote:Create global variable that will store state number, for example:
0 - no captures
1 - Captured checkpoint
2 - Captured gate
3 - Captured Pole

and then, check, is next goal should be active by comparing variable to specific state.

EDIT: Checkpoint is also a pole so you need to check objects via name tags.
The tag is "Checkpoint"?
C'est Grandiose!
Image
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: A little question

Post by djhubertus »

Yep, checkpoint is default.
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 3 guests