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 01-29-2012, 05:30 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Problem sending variable

So, kind of going off of my last post about gui images and such, I am now needing to send one of the temp/this variables I have to another weapon's function to continue my process and system. I have this:

I used both temp and this variables attempting to get it to work, as well as this and thiso, because I don't really get what they are and was desperate.

I tried posting code but incapsula kept stopping me for some reason.

Basically i have tempvars creating the gui image, then using a catchevent to catch right mouse click, then setting the obj.var to a this.var, and using GuiControl.onSelect in a pop up that shows up when right clicking to switch the 2 selections and either drop the item or send to a shop. Dropping the item works fine and so does everything else, but sending to shop (which is a public function in a different weapon, the shop weapon) results in null.

I'm thinking that the var has just been passed to much, or however you put it, but I don't really know, and if it has been, I don't know another way to make this work.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 01-29-2012, 06:16 AM
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
Put the code on pastebin.graalcenter.org and post a link.
__________________
Reply With Quote
  #3  
Old 01-30-2012, 12:37 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
http://pastebin.graalcenter.org/read...d=329451868910

Note the last function, where it sends to -Player/Shop. Every other single thing works fine with how it is, and even to that last function, obj.wep has the correct value to send to -Player/Shop. It's just when it sends its 0.

Also I forgot to change temp.sendtosell to this.clickedright, it doesn't work as this.clickedright. :/
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #4  
Old 01-30-2012, 03:06 AM
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
Temporary variables don't transcend functions, you'll need to find some other way to store it. Probably store it as a variable of the weapon or the GUI object.
__________________
Reply With Quote
  #5  
Old 01-30-2012, 03:32 AM
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
Looked through your code and made my changes, and what I think could fix your logic issues.

http://pastebin.graalcenter.org/read.php?id=53670813760
__________________
Quote:
Reply With Quote
  #6  
Old 01-30-2012, 03:56 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
With that, everything still works, even drop, and temp.wep in player chat is correct, but its still 0 value when it pulls to -Player/Shop.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #7  
Old 01-30-2012, 04:00 AM
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
Quote:
Originally Posted by sssssssssss View Post
With that, everything still works, even drop, and temp.wep in player chat is correct, but its still 0 value when it pulls to -Player/Shop.
Post -Player/Shop's code then.
__________________
Quote:
Reply With Quote
  #8  
Old 01-30-2012, 04:28 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
PHP Code:
public function bringInSell(temp.item) {
  
PLShopSell_Window.destroy();
  
//player.chat = item;
  
new GuiWindowCtrl("PLShopSell_Window") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "178,104";

    
canmove true;
    
canclose true;
    
destroyonhide canresize canmaximize closequery false;
    
text "Sell Item";
    
319;
    
165;

    new 
GuiTextCtrl("PLShopSell_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Please enter price to sell ";
      
width 143;
      
14;
      
3;
    }
    new 
GuiTextCtrl("PLShopSell_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text item;
      
width 143;
      
14;
      
15;
    }
    new 
GuiTextEditCtrl("PLShopSell_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 91;
      
18;
      
37;
    }
    new 
GuiTextCtrl("PLShopSell_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Rupees";
      
width 37;
      
109;
      
42;
    }
    new 
GuiButtonCtrl("PLShopSell_Button2") {
      
profile GuiBlueButtonProfile;
      
text "Sell";
      
width 63;
      
12;
      
66;
    }
    new 
GuiButtonCtrl("PLShopSell_Button3") {
      
profile GuiBlueButtonProfile;
      
text "Cancel";
      
width 64;
      
85;
      
66;
    }
  }


This worked just fine with our old inventory system using images with showimg. :/
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #9  
Old 01-30-2012, 06:00 AM
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
Try: temp.item and echo(temp.item);

Instead of just using item.
__________________
Quote:
Reply With Quote
  #10  
Old 01-30-2012, 06:28 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
nothing, no chat at all that time, no echo, and changed the text =temp.item as well and still comes up null.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #11  
Old 01-30-2012, 06:35 AM
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
Try changing the variable from temp.item to something else like temp.selling_item.

If you: echo(params); does anything show up?
__________________
Quote:
Reply With Quote
  #12  
Old 01-30-2012, 07:00 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Changed, and still not working. Player chat is 0/null, no echo in rc or scripts (for player/shop), and the gui still shows 0/null for the text. tried with and without temp. in it as well.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #13  
Old 01-30-2012, 07:17 AM
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
If you change:

findweapon("-Player/Shop").bringInSell(temp.wep);

to:

findweapon("-Player/Shop").trigger("TestSellItem", temp.wep);

and add:

PHP Code:
// To the bottom of -Player/Shop
function onTestSellItem(temp.selling) {
  echo(
temp.selling);

does the weapon name show up in F2?
__________________
Quote:
Reply With Quote
  #14  
Old 02-01-2012, 03:16 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Yep, but I tried referring it to the other function bringInSell in -Player/Shop from the trigger in player shop and it still didnt show up, echoes 0. :/
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #15  
Old 02-01-2012, 03:31 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by sssssssssss View Post
Yep, but I tried referring it to the other function bringInSell in -Player/Shop from the trigger in player shop and it still didnt show up, echoes 0. :/
While using .trigger make sure that the function looks like
PHP Code:
function onFoo() 
instead of
PHP Code:
function Foo() 
So you will have to name it
PHP Code:
function onbringInSell() 
__________________
MEEP!
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 12:35 PM.


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