Jump to content

[TUTORIAL] PVE Arena using Events and Quests System


Peaverin

Recommended Posts

PVE Arena Using Events and Quest System

Posted: 31/01/2018

Written during Beta 4.7

 

First of all sorry for my English, I know it's not the best but I think you can understand me.

I was testing functionalities of the engine and its potential and I managed to create a PVE Arena so I decided to share this here.

  • You talk to a NPC and he gives you the quest to enter the Arena. If you already had the quest taken he asks you if you want to enter. Then you're teleported to the arena.
  • Only one player is allowed to be in the arena at the same time. 
  • There are 3 possibilites to exit the arena: 1. Be killed 2. Kill the monster 3.Run out of time(so you can't stay forever and block other player's entrances).
  • Uses events and the quest system. When the monster is killed the task is finished and therefore you can run an event and do anything.
  • There are two known bugs because of the limitations of the event system (or maybe my own limitations, if anybody knows how to fix them without editing source code just say it):
    Spoiler

    1. If a player enters the arena and exits the game, there's no way for the system to know it and the arena keeps blocked for everyone until the player relogs and exits the arena. This could be fixed by a. Adding the possibility to run common events on Player Exit. b. Adding the condition "No Players on map X" c. Adding the possibility to copy the value of a variable into an other variable. This way if a player was in the lobby it can by checked by events if the Variable "Arena Timer" is changing its value or not. If not, then it means no player is in the arena and we can restart it.

    2. The condition "No NPCs on the map" doesn't check for NPCs spawned through events (ithe command only detects NPCs spawned by map attrbiutes) (refer to this post

     

    ) so I had to simply make the monster spawn by putting a Spawn attribute with the NPC spawn time being of 1. But if some player enters the arena, damages the monster and then dies, the next player will fight against the monster with not full hp. A "Despawn NPCs on X map" option would also be useful for this so we can despawn the creature and spawn it again with full hp.

     

Video:

The player in the left had already entered the arena before (that's why you see the quest in the quest log is already yellow). The player in the right hadn't. You can see that no player is able to enter the arena if there's already someone in and the 3 ways to exit the arena (die, kill the monster or run out of time). When monster is killed the player gets out of the arena and can enter the reward room.

Spoiler

 

 

Tutorial:

  • For this tutorial I have two separate maps. The first one is the Lobby and the second one is the Arena itself.
  • First of all we're going to use the following: A Player Switch called "Player in Arena", a Global Switch called "Arena", initially False (will be True if a player is in the arena), and a Global Variable called "Arena Timer". This last one variable doesn't need to be a Global Variable and can be a Player Variable instead but if its Global it could be used for letting other players know how long they will have to wait.
  • Now let's go to make the Quest for this: Follow the image: Green is for optional, Red is for mandatory, Yellow is for anotations.
    Spoiler

    Quest.thumb.png.bbe5cafb2ab5abb84c64b01c6773c96a.png

    As you can see you can't quit the quest because if some player quitted the quest while inside the arena, then he wouldn't be able to exit by killing the monster (he would still exit the arena when the time goes down so you can actually mark the option but it would be extrange). Then you have to choose the task of killing the monster you want to be in the arena. Then, on task completion event you have to warp the player outside of the arena and set the "Player in Arena" and "Arena" switches to false so other players can enter the arena. Then you can choose to finish or not the quest and reward the player.

  • Now let's go to the Lobby and create the NPC that will teleport you to the arena: Everything is explained in the image

    Spoiler

    WDIYNfe.png

    "Arena False" and "Arena True" condition list are only formed by "Global Switch Arena is False" and "Global Switch Arena is True".The second page of the event is what will appear when there's a player inside the arena. Note that in this example I've done it this way, with a NPC, but it could be done in a lot of different ways.

  • Last but not least, you might be asking why is the Player Switch "Player in Arena" for. This switch is used now! This is used for when a player dies in the arena, the arena gets reset so other players can enter. Create a Common Event and follow the image:

    Spoiler

    3YXBIJY.png

     

  • In my case now I have a NPC called "Guard" that after you've completed the quests lets you pass to the rewards room, but you can make it different. The best thing, if the quest can be repeated, is to give the reward at the event that is called on task finished. You can do almost anything you want to! That's the power of Intersect.

Your PVE Arena should by ready by now! Let me know If I missed something, if you have any problem/suggestion or if you know how to fix any of the bugs I mentioned above! Thank you!

 

Link to comment
Share on other sites

  • 2 weeks later...
On 31/01/2018 at 6:59 PM, Peaverin said:

1. If a player enters the arena and exits the game, there's no way for the system to know it and the arena keeps blocked for everyone until the player relogs and exits the arena.

 

For this bug, you can set a common event to run when a player logs into the game and have that common event check if the player was in the arena using a switch that will only be true if the player was in the arena and logged off. For when a player logs out, it is a hastle, but some kind of global event that tracks a time variable that counts down every second would work to at least reduce the problem.

 

Link to comment
Share on other sites

14 hours ago, MiniGrief said:

 

For this bug, you can set a common event to run when a player logs into the game and have that common event check if the player was in the arena using a switch that will only be true if the player was in the arena and logged off. For when a player logs out, it is a hastle, but some kind of global event that tracks a time variable that counts down every second would work to at least reduce the problem.

 

The first one you said, when the player logs in the arena again there's no problem because the timer will continue and he will exit it anyways, but yes, the main problem is if the player logs out and don't log in again. As I already said in my post I have already though in ways of solving it but it would require extra event commands which we don't have. But if you come up with a solution with the ones we have just post it.

Link to comment
Share on other sites

5 hours ago, Peaverin said:

The first one you said, when the player logs in the arena again there's no problem because the timer will continue and he will exit it anyways, but yes, the main problem is if the player logs out and don't log in again. As I already said in my post I have already though in ways of solving it but it would require extra event commands which we don't have. But if you come up with a solution with the ones we have just post it.

 Actually there is one way to fix that(not a good way, but a way). You need an 24/7 online character. You have to add him any kind of switch or variable that only this character would have on a certain value. Then, when creating the timer event, you call it to be attached to that character by using a conditional branch. This way, timer event will run on that control character instead of the players, so it doesn't matter if all players disconnect and never connect again, the timer will run until time is over(or until you stop it with other events).

 

 This is a mess because you have to look out that account, because if it gets disconnected you're basically f*cked until you relogin, but well, it should solve that problem.

Link to comment
Share on other sites

2 hours ago, Khaikaa said:

 Actually there is one way to fix that(not a good way, but a way). You need an 24/7 online character. You have to add him any kind of switch or variable that only this character would have on a certain value. Then, when creating the timer event, you call it to be attached to that character by using a conditional branch. This way, timer event will run on that control character instead of the players, so it doesn't matter if all players disconnect and never connect again, the timer will run until time is over(or until you stop it with other events).

 

 This is a mess because you have to look out that account, because if it gets disconnected you're basically f*cked until you relogin, but well, it should solve that problem.

That's actually an original idea :), but as you said it isn't not stable.

I think the best for now is to take this "system" as an example of what events can do and wait until they add the features I proposed or just wait for open source.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...