Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Instance/Dimension question + loadlines bug ?! (https://forums.graalonline.com/forums/showthread.php?t=87228)

FireHunter 08-02-2009 11:04 AM

Instance/Dimension question + loadlines bug ?!
 
Well is there a way to set an Object/Player into another Dimension/Instance ?
So for example 3 Players with different Instances/Dimension numbers wont share any information between each other ?
Or to just let the Player5 been visible / datasharing to Player1+Player2 while Player3+Player4 are in another Instance and only share Information / are visible to each other ?
And another Player6+Player7 are in another Instance/Dimension and can only see themselfes.
While all Players (1-7) are on the same level.
If there would be a simple way this could save me tons of long scripting alternatives :o


And now the second thing -> loadlines doesnt work anymore ?!
Weeks(Months ?) ago everything worked fine but currently it doesnt work anymore o.O
Anyone with the same problem ?

xXziroXx 08-02-2009 12:20 PM

I have no idea what you're asking. :oo:

Mark Sir Link 08-02-2009 12:29 PM

as far as phasing goes you'd need to make custom GANIs, nick, and chat system to get something like that working.

Other option is to have the base levels stored somewhere and make new copies with some sort of suffix to the level name ("baselevel_leaderaccount" maybe) and send players to the new copies of levels individually.

The second option is probably superior to the first as NPC interaction for the first would be a pain to manage.


PHP Code:

function newInstancepobj)
{
   
copylevel("baselevel""instances/baselevel_" pobj.account);


not on RC or I'd test if you need a file type at the end.

FireHunter 08-02-2009 12:38 PM

well for example a level with 10 players on it...
player 1 is in dimension/instance/phasingzone 2
player 2 is in dimension/instance/phasingzone 3
player 3 is in dimension/instance/phasingzone 2
player 4 is in dimension/instance/phasingzone 5
player 5 is in dimension/instance/phasingzone 6
player 6 is in dimension/instance/phasingzone 6
player 7 is in dimension/instance/phasingzone 5
player 8 is in dimension/instance/phasingzone 1
player 9 is in dimension/instance/phasingzone 2
player 10 is in dimension/instance/phasingzone 4

But only Players in the same dimension/instance recieve datas or can see each other
for example
Player 1 + 3 + 9 are in the same instance and they can only see themselves
Player 4 + 7 are in the same instance and they can only see themselves
Player 5 + 6 are in the same instance and they can only see themselves
and Player 2 + 8 + 10 are in different instances with different dimension numbers so they would see the level if it would be empty and if there wouldn't be any players at the level

The Game "World of Warcraft" uses this System for their "Phasing Zones" and theire "Player Instances" (Dungeons where every Group is in another Instance of the Level)

(For the ones who still dont understand what im talking about)


@Mark Sir Link
Just a full level copy is what I want to avoid - well then I think I must pick the long script alternative with a full custom System
Lets say the huge gmap would be a Phasing Zone - ouch a gmap copy for every player at the same time

Edit:
- hmm I think it could be worth a stress test try :D well brb letting the server copy 100/250/500 levels at once and telling you what happened xD -

Edit: Result
100-250:
needed 5 seconds - couldn't figure out how much the server slowed down :o
but I can't test test more:
"Flood Alert: The script commands addguildmember,copylevel etc were called too often, fix the scripts please"
returned in the RC chat and now I can't use that command anymore o.O
well even a "/global servercontrol restart" doesnt work anymore: "Attempt to restart developer97: Error" O.O

Edit:
15 mins later:
The "copylevel" command works again but seriously I still cant use "/global servercontrol restart" anymore
1000:
Hmm a huge freeze for ~10 seconds but it works =)

Well finaly this is a possible way - and works very well
But I still prefer a scripting alternative

Draenin 08-02-2009 01:29 PM

1 Attachment(s)
When the first player enters an instance, you should set a temporary variable on other players in their party based on who enters the instance first. Let me make an example.


First, let's say we have 5 players.

Player 1 is partied with Player 3
Player 2 is partied with Player 4
Player 3 is partied with Player 1
Player 4 is partied with Player 2
Player 5 is going into the instance by himself.

Now, they all enter the dungeon through the same portal. But when the first person enters, there should first be a condition that checks for whether or not they have a temporary 'map ####' attached to them. If there isn't, they are transported to a new map, and that map's ID is assigned to that temporary variable.

At the same time, if other players in the same party do not have that ID assigned, it gets assigned to them. That way, when they enter the instance, they can be sent to the map based on the #### the first person received.

So:

Player 1 goes to Map 1. Map 1's number is simultaneously assigned to Player 3.
Player 2 goes to Map 2. Map 1's number is simultaneously assigned to Player 4.
Player 3 goes to Map 1, based on the number assigned upon Player 1's entry.
Player 4 goes to Map 2, based on the number assigned upon Player 2's entry.
Player 5 goes to Map 3. Since he is not partied, nobody else is assigned the map number.

This essentially sets up an automatic routing system that will always transport other players to the same map that the first party member entered.

But, there's something else that needs to be done. Should the player log off, get kicked from the party, or get into any situation that should prohibit them from re-entering the instance their party is currently in, the 'map ####' variable should be reset to 0, so that when they try to re-enter the instance, a new 'map ####' is assigned to them. This prevents them from re-entering the same instance over and over.


If you look below, I've got a diagram that shows what you are trying to do. If you notice, players in the party are sent to the same map. It doesn't matter who enters the instance first, because the ID number of that instance or map is 'given' to other players when the first person enters. Then it's cleared when they exit or complete the map so that it may be re-assigned later.

Pelikano 08-02-2009 01:40 PM

WoW? ;)

FireHunter 08-02-2009 01:48 PM

@Draenin - I've got a bit confused from your text but I think you mean the "copyed level and warp players in there"-alternative where there would be a level copy with "copylevel" and you are going to get warped with your party in that "copy"

But I want to find a way seperating the different Player Groups in the same level :)

Crow 08-02-2009 02:37 PM

Quote:

Originally Posted by Pelikano (Post 1512505)
WoW? ;)

You know, instances of a certain area are nothing new, and instanced dungeons are something specific, and dungeons are the only part of WoW where instances are used.

xXziroXx 08-02-2009 03:09 PM

Quote:

Originally Posted by Crow (Post 1512513)
You know, instances of a certain area are nothing new, and instanced dungeons are something specific, and dungeons are the only part of WoW where instances are used.

He wants to replicate WoW's phasing technique that was introduced in the latest expansion, to be able to display one area differently depending on what part of a quest you are. I doubt you can replicate it in Graal.

And for the record, instances - or even instanced dungeons - is a concept that's been around well before WoW released. Do feel free to google it.

FireHunter 08-02-2009 03:16 PM

Quote:

Originally Posted by Crow (Post 1512513)
...and dungeons are the only part of WoW where instances are used.

not really because in the newest addon "Wrath of the lich king" the whole new continent called "Northrend" is in fact an instanced zone (Phasing Zone)

For example in fact there are a lot of NPC's standing in the same position - but you can only see them when you have the right "quest flag" - for example...
You have to build up a base...
First you have to clear up an area by killing an ammount of monsters in it - but when you are done and complete the quest by the npc who gave you the quest then you get another flag that you are now in another phasing zone and every monster npc hides from that area for you - then for example you get another quest to collect wood (for example) when you do it you get another flag and then you can see worker npcs building a base there.

Well in WoW for example everyone is on the same level and it is managed over a script

In some other Online Games there are functions for it to easily change the dimension/instance/phasingzone of an Player/NPC/etc.

Well if there isnt any yet then we can only hope that Stefan will add that in the Graal Script Engine anytime - I think it could be very usefull =)


Quote:

Originally Posted by xXziroXx (Post 1512515)
And for the record, instances - or even instanced dungeons - is a concept that's been around well before WoW released. Do feel free to google it.

Thats the reason why I've didn't used the word "World of Warcraft" in the beginnig - World of Warcraft just take a bigger use of it but in fact
the most Online Games are useing it aswell (even if you dont know it) - thats why im missing it in the Graal Script Engine :-(


Edit:
http://en.wikipedia.org/wiki/Instance_dungeon

Edit:
http://forums.graalonline.com/forums....php?p=1512523

Pelikano 08-02-2009 03:57 PM

Whatever, WoW has the most players ;)

Crow 08-02-2009 03:58 PM

Quote:

Originally Posted by FireHunter (Post 1512516)
not really because in the newest addon "Wrath of the lich king" the whole new continent called "Northrend" is in fact an instanced zone (Phasing Zone)

If you want to go that way, every "map" of WoW is an instance, but the biggest only exist once per realm :oo:

Pelikano 08-02-2009 04:01 PM

Quote:

Originally Posted by Crow (Post 1512526)
If you want to go that way, every "map" of WoW is an instance, but the biggest only exist once per realm :oo:

Maybe they also just simply do somethign like .hide(), xD

fowlplay4 08-02-2009 04:06 PM

Clientside hide(), alpha, and some flags are the closest you're going to get to this phasing you want.

FireHunter 08-02-2009 06:39 PM

Quote:

Originally Posted by fowlplay4 (Post 1512529)
Clientside hide(), alpha, and some flags are the closest you're going to get to this phasing you want.

Hmm can you explain exactly what you mean with "Clientside hide() and alpha" ?

Crow 08-02-2009 06:52 PM

Quote:

Originally Posted by FireHunter (Post 1512546)
Hmm can you explain exactly what you mean with "Clientside hide() and alpha" ?

Use hide() and/or the alpha value of npcs/images clientside, depending on flags.

fowlplay4 08-02-2009 06:55 PM

Have bunch of these in your NPCs, so they aren't visible.

PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  if (
client.questprogress >= 2hide();
  else 
show();


Then you can hide players with some attr usage depending on quest progress as well. I.e: player.alpha = 0;

Switch 08-02-2009 08:43 PM

Quote:

Originally Posted by fowlplay4 (Post 1512550)
Have bunch of these in your NPCs, so they aren't visible.

PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  if (
client.questprogress >= 2hide();
  else 
show();


Then you can hide players with some attr usage depending on quest progress as well. I.e: player.alpha = 0;

player.alpha could get a little weird since they're still actually there, just invisible, and chat still displays. If you have a unique nick system that if you mouse-over players it displays their nickname, it could look weird, make sure that the nick system's alpha replicates their player alpha so it's hidden as well. Also try making the player profile (right click) not display if their alpha is 0 or whatever you use.

fowlplay4 08-02-2009 08:53 PM

Quote:

Originally Posted by Switch (Post 1512556)
player.alpha could get a little weird since they're still actually there, just invisible, and chat still displays. If you have a unique nick system that if you mouse-over players it displays their nickname, it could look weird, make sure that the nick system's alpha replicates their player alpha so it's hidden as well. Also try making the player profile (right click) not display if their alpha is 0 or whatever you use.

Yes, lots would have to be done. It's just easier to plan for the assumption that players will be around.

Instead of player.alpha they could just be warped off your screen as well, but meh.

FireHunter 08-02-2009 10:37 PM

@Every reply between my last reply
-> Going back to the beginning of the Thread <-
My discussion is about the player-to-player instancing
NPCs arent problems at all
I haven't found out how you got from Players to NPCs o.O

-> The Question thing in WoW was only for an example to the guys who
didnt understand what im talking about
- so forget everything about Quests and NPCs

So to answer the replys:
hide() -> im talking about Players not NPCs
player.alpha -> still doesnt really make it easier since
I was looking forward to a simple way if there would be any

Quote:

Originally Posted by FireHunter (Post 1512484)
If there would be a simple way this could save me tons of long scripting alternatives :o

And since there isnt any - my Question is solved

fowlplay4 08-03-2009 12:11 AM

Okay then, No.

But the script isn't that long or complicated, is this what you're trying to accomplish?

PHP Code:

//#CLIENTSIDE

function onCreated() {
  
// Player Attr Position to store Dimension in
  
this.attrpos 30;
  
// Initialize Dimension
  
setDim(0);
  
// Begin Looping
  
setTimer(0.05);
}

// Test Command for Changing Dimensions
// /dim dimension

function onPlayerChats() {
  if (
player.chat.starts("/dim")) {
    
setDim(player.chat.substring("/dim ".length()));
  }
}

// Dimension Accessor / Mutator

public function setDim(newdim) {
  
this.dim newdim;
  
player.attr[this.attrpos] = newdim;
}

public function 
getDim() return this.dim;

// Loop to find and hide players in other dimensions..

function onTimeout() {
  for (
temp.pplayers) {
    
// Ignore yourself
    
if (temp.== player) continue;
    
// Determine Dimension
    
temp.dimz temp.p.attr[this.attrpos];
    
// Check Dimension
    
if (dimz != getDim()) {
      if (
temp.p.!= -3) {
        
// Record Old Position
        
this.("pos_" temp.p.account) = {temp.p.xtemp.p.y};
      }
      
// Hide Player
      
temp.p.temp.p.= -3;
    } else {
      
// Player Offscreen?
      
if (temp.p.== -3) {
        
// Restore them on the screen
        
temp.oldpos this.("pos_" temp.p.account);
        
temp.p.temp.oldpos[0];
        
temp.p.temp.oldpos[1];
      }
    }
  }
  
setTimer(0.05);


It's actually pretty cool, might even use it to hide from players while on Zodiac lol.

The only issue is that sometimes player's don't reappear in gmap environments because they are in a different level or something.

FireHunter 08-03-2009 10:15 PM

Well it was kinda bit too late - Since im altering the full Graal System I've already started scripting a longer one xD
But good idea to just switch the player out of the screen o.O
I've didnt even thought about that - good job =)

Well I think I will still use it my way to keep the player on the position but remove everything visible for a better compatibility to a few other scripts

But yeah just switching the player out of the screen :megaeek: *banging head on his table* its so simple - why didnt it came up by myself >_<


And for your script:

PHP Code:

...
    
// Check Dimension
    
if (dimz != getDim()) {
      if (
temp.p.!= -3) {
... 

into

PHP Code:

...
    
// Check Dimension
    
if (dimz != getDim()) {
      if (
temp.p.!= -|| temp.p.!= -3) {
... 

Since the Player could have walked on the Y Coordinate while beeing in X at -3 (for example with something like Staff Boots)
-> When he gets back with the script later his Y Coordinate could be wrong until he walks a step
(Well it would be unimportant since he must still stay on X -3 and invisible on the screen of other players - but there are a few scripts from me which would need it for compability reasons)

fowlplay4 08-04-2009 12:40 AM

If you just make them invisible and such, and don't actually put them off the screen like I did there will be invisible players blocking if you use default movement and it's in a PK Zone.

Anyway, glad we could come to a conclusion :D

FireHunter 08-04-2009 09:42 AM

Oh and thx @ everyone for their ideas / help =)

FireHunter 08-17-2009 01:46 PM

Oh and I found out why loadlines() didnt worked >.<
I forgot to give the "(npcserver)" rights to the file zomfg *headbang*

Mark Sir Link 08-17-2009 07:44 PM

Don't want to hijack this thread but what did you come up with as far as NPC management goes?


All times are GMT +2. The time now is 11:05 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.