Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-12-2009, 07:48 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
help with openexternalpm()

ok, so I'm just working with some stuff and I try to get a pm window open when a player just double clicks another, here's what I got:

PHP Code:
//#CLIENTSIDE

//...script...

function onMouseDown()
{

  if ( 
params0] == "double")
  {

    
this.pID getPlayerIDmousexmousey);
    
    if ( 
this.pID != -&& this.pID != player.id)
    {

        
playersthis.pID].openexternalpmfalse);

    }
  }
}

function 
getPlayerIDtemp.mxtemp.my)
{

  for ( 
temp.0allplayerscount++)
  {
  
    if ( 
mx in playersp].xplayersp].2|  &&
         
my in playersp].yplayersp].3|)
      return 
playersp].id;

  }
  
  return -
1;

From what I can tell it should work, but when I double click nothing happens at all. What am I doing wrong?
__________________
Deep into the Darkness peering...
Reply With Quote
  #2  
Old 07-12-2009, 07:56 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
PHP Code:
//#CLIENTSIDE
function onMouseDown() {
  if (
leftmousebutton) {
    (
"-Playerlist").openexternalpm({findplayerbyid(testplayer(mousex,mousey))},false);
  }

Should work, though I didn't test it. Though I just realized testplayer doesn't work in nopk zones(do to testplayer works by checking for where players block), but I'm sure you get the idea.
Reply With Quote
  #3  
Old 07-12-2009, 08:24 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
No dice, still nothing happens
__________________
Deep into the Darkness peering...
Reply With Quote
  #4  
Old 07-12-2009, 08:27 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Try this, have someone PM you and chat "checkpms"...
PHP Code:
//#CLIENTSIDE
function onPlayerchats() {
  
temp.checkacc "DustyPorViva"replace this with the account of the person PMing you
  
if (player.chat == "checkpms") ("-Playerlist").openexternalpm({findplayer(checkacc)},false);

If that doesn't work I dunno, because that's the syntax I use in my map script.
Reply With Quote
  #5  
Old 07-12-2009, 12:07 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
I have made the ("-Playerlist").anypmswaiting() a public function so that should return if there are any unread PMs.

The correct format is to use ("-Playerlist").openPMWindow({array of player objects}, bool ismasspm); (note the ismasspm value is ignored if reading a received PM). On the current client this may not always produce an external PM window as currently shown on the Windows client, but the TServerPlayer.openexternalPM(bool display PM) function doesn't work properly on Mac or Linux I don't think (where the scripted playerlist is used already).

In the next client the scripted playerlist windows are all external by default anyway. Tig has also made some changes to the scripted playerlist in an attempt to make it more like the Windows one (which is currently uploaded on Login 2).
__________________
Skyld
Reply With Quote
  #6  
Old 07-12-2009, 12:40 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Skyld View Post
In the next client the scripted playerlist windows are all external by default anyway. Tig has also made some changes to the scripted playerlist in an attempt to make it more like the Windows one (which is currently uploaded on Login 2).
I hope we can still use the current docking one?
__________________
Reply With Quote
  #7  
Old 07-12-2009, 10:07 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by cbk1994 View Post
I hope we can still use the current docking one?
In the new client the Delphi external windows are gone. Every client will use the same scripted playerlist with the same external windows support. It would be possible to make the scripted windows dockable which would produce the same effect.
__________________
Skyld
Reply With Quote
  #8  
Old 07-12-2009, 10:17 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Skyld View Post
In the new client the Delphi external windows are gone. Every client will use the same scripted playerlist with the same external windows support. It would be possible to make the scripted windows dockable which would produce the same effect.


The scripted one is glitchy, clumsy, and ugly. Something tells me a lot of people aren't going to be happy using it, including me.
__________________
Reply With Quote
  #9  
Old 07-13-2009, 12:10 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by cbk1994 View Post
The scripted one is glitchy, clumsy, and ugly. Something tells me a lot of people aren't going to be happy using it, including me.
I have been using the scripted playerlist for years and have not found it to be "glitchy". The design, however, could be improved and that's what Tig's been working on addressing. As for ugly, well, it follows whatever theme you have the rest of the client using. If you want to change the theme, you are at liberty to do so.

It doesn't make sense to have a Delphi playerlist on the Windows client and not on the Mac and Linux clients though because then we have to implement a Gtk and a Cocoa playerlist separately in addition, and that makes code portability a nightmare and updating the playerlist logic even more of a nightmare.
__________________
Skyld
Reply With Quote
  #10  
Old 07-13-2009, 12:16 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Skyld View Post
I have been using the scripted playerlist for years and have not found it to be "glitchy". The design, however, could be improved and that's what Tig's been working on addressing. As for ugly, well, it follows whatever theme you have the rest of the client using. If you want to change the theme, you are at liberty to do so.
I can't change the theme of it without changing the theme of everything else apparently.

I find it quite glitchy, especially on Mac, though that's probably mostly the external windows - mainly focus problems, clicking doesn't select, you have to click once to select the window, then click again to select.

Quote:
It doesn't make sense to have a Delphi playerlist on the Windows client and not on the Mac and Linux clients though because then we have to implement a Gtk and a Cocoa playerlist separately in addition, and that makes code portability a nightmare and updating the playerlist logic even more of a nightmare.
It may not make sense if you think about it like that. However, think about it like a player. You don't care if something makes sense or not to the developer, you just want it to work well and look nice. I have a feeling it's going to definitely be a downgrade going from the Graal v5 playerlist to the in-game one.
__________________
Reply With Quote
  #11  
Old 07-13-2009, 12:33 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by cbk1994 View Post
I can't change the theme of it without changing the theme of everything else apparently.
That is something we can look into if there is enough demand for the ability to change the theme of the playerlist separately.
Quote:
Originally Posted by cbk1994
I find it quite glitchy, especially on Mac, though that's probably mostly the external windows - mainly focus problems, clicking doesn't select, you have to click once to select the window, then click again to select.
The external windows in the most recent Mac client are working very well for me. The controls do not select at the same time as the windows focus because that is default behaviour in OS X for control-less windows (since the external window contents are essentially bitmap framebuffers). Stefan can make that optional I guess (since a click event could be passed as well as a window focus event).
Quote:
Originally Posted by cbk1994
It may not make sense if you think about it like that. However, think about it like a player. You don't care if something makes sense or not to the developer, you just want it to work well and look nice. I have a feeling it's going to definitely be a downgrade going from the Graal v5 playerlist to the in-game one.
Matching the functionality of the external playerlist is the aim of the improved script on Login 2 so that when the new client is released, people should not have to relearn anything to use the playerlist just as they always have.
__________________
Skyld
Reply With Quote
  #12  
Old 07-13-2009, 12:40 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Scripted things like the playerlist wouldn't be so bad if the GUI's were more responsive like the real OS counterparts. They always feel like they're scripted rather than being part of the 'real' interface, if that makes sense.
Reply With Quote
  #13  
Old 07-13-2009, 01:24 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Selecting also doesn't work in the scripted playerlist. Holding shift while selecting players just "adds" more to the selection, while holding ctrl should do that job, and shift should select a range between click one and click two. Ctrl does nothing. That's my main concern.
__________________
Reply With Quote
  #14  
Old 07-13-2009, 03:00 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
I'm not a fan of the scripted playerlist, and the login 2 one doesn't look much different. Also, there's an 'Options' button on the login 2 playerlist but it opens up a Mass PM when you click it, might want to look into that.

As for the removal of the dockability, that's a rather huge downgrade considering the amount of positive feedback that came from it when it was first released. Personally, I always have my playerlist docked to the side when I'm on.
Reply With Quote
  #15  
Old 07-14-2009, 03:19 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Crow View Post
Selecting also doesn't work in the scripted playerlist. Holding shift while selecting players just "adds" more to the selection, while holding ctrl should do that job, and shift should select a range between click one and click two. Ctrl does nothing. That's my main concern.
That's fixed on the new version.

Quote:
Originally Posted by Gambet View Post
I'm not a fan of the scripted playerlist, and the login 2 one doesn't look much different. Also, there's an 'Options' button on the login 2 playerlist but it opens up a Mass PM when you click it, might want to look into that.

As for the removal of the dockability, that's a rather huge downgrade considering the amount of positive feedback that came from it when it was first released. Personally, I always have my playerlist docked to the side when I'm on.
The options window is only available if you're using the new client.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:54 AM.


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