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 06-16-2007, 07:18 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
And Now Triggerclient not working?

This basically has to do the same thing with my last thread, in which I got a working answer too. Almost everything inside the system I'm making is serverside. The only Clientsided part needed triggeraction refuses to work inside the class apparently. And so I'm forced to use triggerclient.

Weapon:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
Main this;
}

function 
onPlayerChats() {
  if (
player.chat.trim() == "/reconnect") {
    
serverwarp("Maloria");
  }
}

public function 
onActionClientside() {
  echo (
"Hey I've been found!");
}

public function 
setAni2(planianiparam1aniparam2aniparam3) {
  echo (
"rock me");

Class:
PHP Code:
public function execute(caster) {
  
temp.plyr 0;
  
this.account caster;
  
  
plyr findPlayer(this.account);
  echo (
plyr.account);
  
plyr.triggerclient("weapon""systemMain""");

Calling Weapon:
PHP Code:
function onCreated() {
  
pl findPlayer("Chandler");
  
pl.mud.spelllist[0].execute(pl.account);


I know for a fact, the player has the weapon and the proper account is being echoed to RC before the trigger. What's the dealio bro? :O
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #2  
Old 06-16-2007, 07:43 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Only problem I see is:

PHP Code:
  plyr.triggerclient("weapon""systemMain"""); 
should be

PHP Code:
with plyr )
{
  
triggerclient("weapon""systemMain"""); 

Reply With Quote
  #3  
Old 06-16-2007, 08:18 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Novo, those should do exactly the same.

What if you use "gui" instead of "weapon".

I can't remember what the difference is.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #4  
Old 06-16-2007, 08:43 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by JkWhoSaysNi View Post
I can't remember what the difference is.
Probably cause there isn't one, or so Stefan says. Try using at least one parameter for triggerClient(), for all we know (lack of documentation) it could only work if you have a parameter.
__________________
Reply With Quote
  #5  
Old 06-16-2007, 09:25 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by JkWhoSaysNi View Post
Novo, those should do exactly the same.

What if you use "gui" instead of "weapon".

I can't remember what the difference is.
The should do the same thing but I never seem to be able to get obj.triggerclient(); to work. I always have to do with (obj) triggerclient(); instead.
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 06-16-2007, 10:37 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Well, Chompy actually figured the problem out. The echo clientside wasn't working therefore leading me to believe the triggerclient wasn't working even using with() (which we ended up using ).

So it works now, thanks anyway guys.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #7  
Old 06-16-2007, 11:22 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Using with on a player is kinda different because it changes the calling player rather than change object scope, thats how I think of it. Leftovers from GS1 or so. I always use with for changing the calling player.
__________________
Reply With Quote
  #8  
Old 06-17-2007, 01:14 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Novo View Post
should be

PHP Code:
with plyr )
{
  
triggerclient("weapon""systemMain"""); 


Quote:
Originally Posted by zokemon View Post
The should do the same thing but I never seem to be able to get obj.triggerclient(); to work. I always have to do with (obj) triggerclient(); instead.

You use with() only when you're trying to call a function to a player that is not a player function. For player functions, you do obj.function, which in this case plyr.triggerclient() would be correct.
Reply With Quote
  #9  
Old 06-17-2007, 02:22 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I've always done plyr.triggerclient(). Works in for (pl : players) as well on the pl object.
Reply With Quote
  #10  
Old 06-17-2007, 02:42 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Gambet View Post
You use with() only when you're trying to call a function to a player that is not a player function. For player functions, you do obj.function, which in this case plyr.triggerclient() would be correct.
triggerclient() is not a function of the player object, it just requires a calling player.

I believe Graal considers the dot no different than with, it works different ways depending on what you use with it.
__________________
Reply With Quote
  #11  
Old 06-17-2007, 03:12 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Indeed. The only trigger functions within a player object is trigger()
Reply With Quote
  #12  
Old 06-17-2007, 04:29 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Twinny View Post
Indeed. The only trigger functions within a player object is trigger()
I think thats because its in TGraalVar, right?
__________________
Reply With Quote
  #13  
Old 06-17-2007, 05:15 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I'm not sure..the only inheritance for Tserverplayer that I can find ont he wiki is tganiobject :x. I could only find the clientside reference though...
Reply With Quote
  #14  
Old 06-17-2007, 05:41 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
It all roots down to TGraalVar though.
__________________
Do it with a DON!
Reply With Quote
  #15  
Old 06-17-2007, 02:44 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
triggerclient() is both a function of the player and a global function (the global function is automatically redirecting to player.triggerclient()). There are a few other functions like setlevel2() which are the same.
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 09:30 PM.


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