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
  #91  
Old 05-03-2009, 04:32 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
visible doesn't work with images.

you could do something like..

PHP Code:
function onKeyPressed(codekeychar) {
  if (
key == "i") {
    if (
findImg(209).image != NULL) {
      
hideimg(209);
    }
  }

__________________
Quote:
Reply With Quote
  #92  
Old 05-03-2009, 04:34 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by Raelyn View Post
Is there a way in GS1 to do this?

PHP Code:
if (keypressed) {
   if (
strequals(#p(1),I)){
      
if (img 209 is visible){
         
hideimg 209;
      } else {
         
showimg 209,file,x,y;
      }
   }

Solved myself with

PHP Code:


this
.inv_shown 1;

if (
keypressed) {
   if (
strequals(#p(1),I)){
      
Inventory();
   }


function 
Inventory(){

  if (
this.inv_shown == 0){

    
// inventory pane
    
showimg 209;
    
this.inv_shown 1;

  } else {

    
hideimg 209;
    
this.inv_shown 0;
  }

I have another question though, I am trying to change profilevars in server options, and I have

PHP Code:
profilevars=Level:=#v(clientr.level), 
Yet it is not picking up the clientr.level off my NPC...?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #93  
Old 05-03-2009, 04:56 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
visible doesn't work with images.

you could do something like..

PHP Code:
function onKeyPressed(codekeychar) {
  if (
key == "i") {
    if (
findImg(209).image != NULL) {
      
hideimg(209);
    }
  }

Mmm, ok thanks. I was just having someone test me script, and I have it calling replaceani in clientside, so his client is not downloading the ganis from the server. But if I put the replaceani in serverside, the RC reports an error that the server doesn't know that command... So, what command does it understand to get new ganis for the player?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #94  
Old 05-03-2009, 06:22 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 Raelyn View Post
Solved myself with

PHP Code:


this
.inv_shown 1;

if (
keypressed) {
   if (
strequals(#p(1),I)){
      
Inventory();
   }


function 
Inventory(){

  if (
this.inv_shown == 0){

    
// inventory pane
    
showimg 209;
    
this.inv_shown 1;

  } else {

    
hideimg 209;
    
this.inv_shown 0;
  }

Be sure to convert that to GS2...
Quote:
I have another question though, I am trying to change profilevars in server options, and I have

PHP Code:
profilevars=Level:=#v(clientr.level), 
You don't need #v, just (for example):
PHP Code:
profilevars=Level:=clientr.level,HP:=clientr.hp 
Quote:
Originally Posted by Raelyn View Post
Mmm, ok thanks. I was just having someone test me script, and I have it calling replaceani in clientside, so his client is not downloading the ganis from the server. But if I put the replaceani in serverside, the RC reports an error that the server doesn't know that command... So, what command does it understand to get new ganis for the player?
What do you mean, like download them? Just displaying the animations will download them, but if you really want you can use update packages.
__________________
Reply With Quote
  #95  
Old 05-03-2009, 06:48 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Make sure you have the following the folder config.

PHP Code:
file  ganis/*.gani 
So people can download the ganis from the the levels/ganis folder.

Then in a clientside script you can just use

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
replaceani("idle""someotheridleani");
  
replaceani("walk""someotherwalkani");

__________________
Quote:
Reply With Quote
  #96  
Old 05-03-2009, 07:08 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Be sure to convert that to GS2...

You don't need #v, just (for example):
PHP Code:
profilevars=Level:=clientr.level,HP:=clientr.hp 

What do you mean, like download them? Just displaying the animations will download them, but if you really want you can use update packages.
Ok, well, my script is clientside, so that means the server can't GET my clientr.level, right? I need to find some way for for the server to read my clientside variables..

If I join a class to a clientside script, does everything in that class become clientside as if it waste pasted into the class? I am trying to think of another way to split this script so I can maintain my clientside timeouts but have my variables accessible by the server...

Also, I have another problem that is whenever more than one person is on my server, (having the -Player weapon), ONE part of my interface is duplicated in the center of the screen... it's only the one part, and everything else works as intended..
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #97  
Old 05-03-2009, 07:17 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
Make sure you have the following the folder config.

PHP Code:
file  ganis/*.gani 
So people can download the ganis from the the levels/ganis folder.

Then in a clientside script you can just use

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
replaceani("idle""someotheridleani");
  
replaceani("walk""someotherwalkani");

Thanks, that was the problem.
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #98  
Old 05-04-2009, 02:48 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by Raelyn View Post
Ok, well, my script is clientside, so that means the server can't GET my clientr.level, right? I need to find some way for for the server to read my clientside variables..
Pass them to the server with
PHP Code:
//#CLIENTSIDE
function onEvent() {
triggerServer("gui","WeaponName","Equal",this.bar,temp.foo);

then on the serverside u could do something like this:
PHP Code:
function onActionServerSide(){
  if (
params[0] == "Equal") {
    
this.thing params[1];
    
this.var = params[2];
  }

then u can use this.bar and temp.foo at serverside.
but they will be named this.thing and this.var ofc
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you

Last edited by Deas_Voice; 05-04-2009 at 02:49 PM.. Reason: forgot a ; :O
Reply With Quote
  #99  
Old 05-04-2009, 02:51 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by fowlplay4 View Post
Make sure you have the following the folder config.

PHP Code:
file  ganis/ *.gani 
So people can download the ganis from the the levels/ganis folder.
fixed, the forum didn't show it
(no space between the / and the *)
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #100  
Old 05-04-2009, 05:09 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
I am trying to do a script for something like:

PHP Code:
if (playerchats){
  if (
strequals(#c,/summon "otherplayeraccountname")){
    
otherplayeracctname newxnewy;
  }

What would I use to get the account name of the said player, and what would I use to set the x/y of ANOTHER player other than the player triggering?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #101  
Old 05-04-2009, 05:21 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Here's a simple summon weapon script, however since you probably deal with community names you may have to modify the findplayer to findplayerbycommunityname, or whatever it is.

PHP Code:
function onActionServerSide() {
  
// Summons Player to You
  
if (params[0] == "summon") {
    
// Adjusts the Players Level, X, Y
    
findplayer(params[1]).setlevel2(player.levelplayer.xplayer.y);
    
// Adjusts Players Chat 
    
findplayer(params[1]).chat "Summoned by" SPC player.account;
  } 
}

//#CLIENTSIDE

function onPlayerChats() {
  if (
player.chat.starts("/summon")) {
    
// Gets acct from "/summon acct"
    
temp.toSummon player.chat.substring("/summon ".length());
    
// Sends Trigger to Server
    
triggerserver("gui"this.name"summon"toSummon);
  }

__________________
Quote:
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 01:49 PM.


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