Jump to content

'Private' Dungeon (Lock a map when people are in it)


Beefy Kasplant

Recommended Posts

I've seen a couple of people asking about this, and since there isn't going to be an instancing system in Intersect any time soon I decided to show you guys how to lock a map when there are people in it already. 

 

First you want to think about what the system needs to do: 

 

1. Lock a map when a person is in it

2. Open up the map when a person leaves

 

We're working with global variables here because the map needs to be closed for everyone. 

 

So the base system is simple: 

 

In our example we have a door leading into a private dungeon and the dungeon has an exit door for the player to leave through.

 

Variables needed: 

Global Boolean Variable: RoomLocked

Player Boolean Variable: IsInRoom

 

Event to enter: 

If RoomLocked = 0

Set IsInRoom = 1

Warp Player to map

Else

Text: There is someone in the room. 

 

Event to leave: 

Set RoomLocked = 0

Set IsInRoom = 0

Warp player

 

Add to Player Login Event:

If IsInRoom = 1

Warp Player

 

 

Yes, I can already hear you moaning and whining: What about when players log off, or die? What then huh? Your system will break. 

I have only one thing to say about that: Fuck you. 

 

There's actually a super easy trickster way that requires just a little bit of 'out of the box' thinking and I'll tell you for 5m OSRS GP. So please send me after you read this:

 

Autorun Event in the Map:

Run condition: Roomlocked = 0

Set RoomLocked = 1

 

The trick is that this event will only run when people are in the map. A map event won't be loaded otherwise. It will also only run if something sets RoomLocked = 0. So it won't be constantly running and putting strain on the server.

 

Now, we have to change our first event slightly to make use of this system: 

 

Event to enter: 

Set RoomLocked = 0

Show chatbox text: Checking the Room

Wait 3000ms (This will give more than enough time for players inside the room to trigger the map event and set the RoomLocked = 1.)

If RoomLocked = 0

Warp Player to map

Else

Text: There is someone in the room. 

 

 

 

Enjoy, and remember to give credit and OSRS GP!

 

NOTE: I wrote this off the top of my head, so please test or let me know about any bugs.

 

 

Link to comment
Share on other sites

Yeah, true, I forgot about the login trigger, let me add that since that's a pretty vital part.

 

The timer is an easy add but that's up to the user, this is really about the system of locking a room while people are in it. Normally you'd have a bossfight or something and people would either die or beat the boss. 

Link to comment
Share on other sites

10 hours ago, Beefy Kasplant said:

Yes, I can already hear you moaning and whining: What about when players log off, or die? What then huh? Your system will break. 

I have only one thing to say about that: Fuck you.

 

I made a logout common event system and shared it somewhere here, but it's hard as fuck and needs a 24/7 client working as a controller. Better hire some programmer instead doing what I said before source was released.

Link to comment
Share on other sites

5 hours ago, Khaikaa said:

 

I made a logout common event system and shared it somewhere here, but it's hard as fuck and needs a 24/7 client working as a controller. Better hire some programmer instead doing what I said before source was released.

 

In this case you don't need a logout common event system.

Link to comment
Share on other sites

4 hours ago, Beefy Kasplant said:

 

In this case you don't need a logout common event system.

How do you unlock the dungeon then if the player inside logs out after blocking it?

Link to comment
Share on other sites

How to make a dungeon for passing through time?
 Suppose a player comes in - it closes, the countdown starts 5 minutes
 after 5 minutes the player throws back and the dungeon opens again

Link to comment
Share on other sites

16 minutes ago, Khaikaa said:

How do you unlock the dungeon then if the player inside logs out after blocking it?

 

Not sure if you read the whole post but:

 

Event to enter: 

Set RoomLocked = 0

 

4 minutes ago, Jackson said:

How to make a dungeon for passing through time?
 Suppose a player comes in - it closes, the countdown starts 5 minutes
 after 5 minutes the player throws back and the dungeon opens again

 

 

You'd need an event that starts a timer, sets the room to unlocked state after that time and warps the players out. I'm sure you can figure it out

Link to comment
Share on other sites

  • 5 months later...

 

On 7/10/2020 at 4:17 AM, Khaikaa said:

 

I made a logout common event system and shared it somewhere here, but it's hard as fuck and needs a 24/7 client working as a controller. Better hire some programmer instead doing what I said before source was released.

 

It was for Khaikaa, but thanks anyway ! :108_metal:

Link to comment
Share on other sites

This type of event system has a lot of flaws and it will break when your server restarts/crashes.

I had a system that worked well for single and group instances. Though the event system will not hold up through any server restarts and you'd have to manually refresh the variables. As well the event tick timer has some odd logic to it that makes it 'random' when running too many conditional branches.

I'd be happy to see a real working one.

EDIT: you can see it being done here:

 

 

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...