Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Parkour Addon) Custom Parkour Events dont have check/victory points #306

Open
bozott opened this issue Dec 17, 2014 · 7 comments
Open

(Parkour Addon) Custom Parkour Events dont have check/victory points #306

bozott opened this issue Dec 17, 2014 · 7 comments

Comments

@bozott
Copy link

bozott commented Dec 17, 2014

-----What is the issue?------
When I am creating custom events that use the parkour plugin (e.g. like how the superpaintball uses the paintball default http://wiki.battleplugins.org/BattleArena/Custom_Games) I am unable to set checkpoints or victory points for the event.

I can set victory points and checkpoints in the "arenas.yml" config, but when I play the game it dosen't recognize them.

The victory condition in both the default parkour config and my custom one are both set to "CUSTOM"

Thanks in advance
~bozott

@Europia79
Copy link

Can you link your custom config ?

@bozott
Copy link
Author

bozott commented Dec 20, 2014

heres one:
BoatRace:
name: BoatRace
command: BR
prefix: '&6[Boat]&e'
tracking:
database: BoatRace
rated: true
useTrackerMessages: false
arenaType: Parkour
arenaClass: ParkourArena

Heres the other:
FastPlace:
enabled: true
rated: true
joinType: Queue
name: FastPlace
command: FP
prefix: '&6[Parkour]&e'
gameSize:
nTeams: 1+
teamSize: '1'
nLives: infinite
victoryCondition: CUSTOM
times:
matchTime: 120
tracking:
database: FastPlace
rated: true
useTrackerMessages: false
arenaType: Parkour
arenaClass: ParkourArena
onEnter:
options:
- STOREALL
onLeave:
options:
- RESTOREALL
onStart:
options:
- teleportIn
- pvpOn
onComplete:
options:
- teleportOut
- clearInventory
onSpawn:
giveItems:
- WATER_BUCKET 1
options:
- health=20.0
- hunger=20

onDeath:
options:
- respawn
winners:
options:
- health=20.0
- hunger=20

@Europia79
Copy link

i'll investigate... but i won't have time to look into it until next week.

@bozott
Copy link
Author

bozott commented Dec 21, 2014

Alright, Thanks.

@bozott
Copy link
Author

bozott commented Jan 4, 2015

any new information?

Europia79 added a commit to BattlePlugins/BattleArena that referenced this issue Jan 22, 2015
alkarinv#306

CommandController modified line 38:
You will need to disable the security manager to use dynamic commands

APIRegistrationController added line 103:
"[BattleArena] Now registering command " + wantedCommand + " dynamically
with Bukkit commandMap."

Basically, users are creating custom competitions via *Config.yml files.
And their commands are not being registered.

The fact is that dynamic command registration via the Bukkit commandMap is
working.

It appears that BattleArena is loading SOME of these custom competitions,
but not loading others... So I have to look into WHY it's loading some,
but not all.

I suspect the problem will most likely be a mis-configuration.
@Europia79
Copy link

BattlePlugins@81b83e9

I have thoroughly investigated it... This appears to be a mis-configuration issue.

BattleArena will allow you to have whatever *.yml files you want in your /BattleArena/competitions/ and /ArenaParkour/ folders... BattleArena will only load custom competitions from *Config.yml

BoatRaceConfig.yml

BoatRace:
  name: BoatRace
  command: race
  prefix: '&6[BoatRace]&e'
  displayName: BoatRace
  gameSize:
    nTeams: '1+'
    teamSize: '1'
  nLives: infinite
  victoryCondition: Custom
  times:
    matchTime: 120
  tracking:
    database: Parkour
    rated: true
    useTrackerMessages: false
  arenaType: ParkourArena
  arenaClass: ParkourArena

This is half the file (without all the onSpawn, onJoin, onCompete extra options) and it works.

For BoatRaceConfig.yml you will need the first yaml node as BoatRace and value the name: node will also be BoatRace. A file named BoatRace.yml will NOT work.

The command: race node is tested & working, however, you're right, that you cannot add checkpoints or victorypoints.

@Europia79
Copy link

I am unable to set checkpoints or victory points for the event.

Whoops, I got the /race command working for BoatRace... but yeah, you're right, you can't use /race or /pk to add checkpoints or victorypoints.

From a player's perspective, alls they're gonna be doing is
/boatrace join, /br join, or /race join

So I see two options here: Either

  1. Open up ArenaParkour.jar and edit the plugin.yml to add your command aliases:
name: ArenaParkour
version: 0.8.4

main: mc.arena.parkour.Parkour
authors: [MCForger, alkarin]
description: Parkour plugin for BattleArena.
depend: [BattleArena]

commands:
    parkour:
        aliases: [pa,pk,boatrace,br,race]

Or
2. Change the command: node in ArenaParkourConfig.yml

Parkour:
  name: Parkour
  command: boatrace
  prefix: '&6[Parkour]&e'
  displayName: Parkour
  gameSize:
    nTeams: 1+
    teamSize: '1'
  nLives: infinite
  victoryCondition: Custom
  times:
    matchTime: 120

Eventho you change pk to boatrace or br here, you will still be able to use /pk cmd.

For the prefix: & displayName: nodes, you can set those per arena in arenas.yml or via BattleArena commands.

However, if you're not even going to have arenas of type Parkour (and you're only going to have arenas of type BoatRace), then you could simply change them in the ArenaParkourConfig.yml

If you're curious what the cause of this is

@MCCommand(cmds={"addCheckPoint", "acp"}, admin=true)
  public boolean addCheckPoint(Player sender, Arena arena, int index)
  {
    if (!(arena instanceof ParkourArena)) {
      return sendMessage(sender, "&eArena " + arena.getName() + " is not a Parkour arena!");
    }

That's the ParkourExecutor. As you can see, it appears that BattleArena is not instantiating an instanceof ParkourArena... eventho you clearly specify in your config arenaClass: ParkourArena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants