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-10-2008, 01:58 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
having trouble.

PHP Code:
with(putnpc2(this.xthis.y"join newgas-" this.bombtype ";"))
{
  
this.time random(3050);
  
this.owner2 thiso.gasowner;

if I try to view what this.gasowner is outside of with(putnpc2()) it's fine. but when I try to set a different string to it so it will transfer to the other class, it's not working. how can I fix this ?
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #2  
Old 06-10-2008, 02:02 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Frankie View Post
PHP Code:
with(putnpc2(this.xthis.y"join newgas-" this.bombtype ";"))
{
  
this.time random(3050);
  
this.owner2 thiso.gasowner;

if I try to view what this.gasowner is outside of with(putnpc2()) it's fine. but when I try to set a different string to it so it will transfer to the other class, it's not working. how can I fix this ?
Personally, I think that way of doing it is ugly like hell. Try this, see if it works:

PHP Code:
temp.npc putnpc2(this.xthis.y"join(\"newgas-" this.bombtype "\");");
temp.npc.time random(3050);
temp.npc.owner2 this.gasowner
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 06-10-2008, 02:06 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
I'm doing that, and it's still not working -.- damnit.

I see the problem

this.owner2 is trying to be read on the clientside. when I read it on the serverside it works fine.. I need to read it on clientside though in order to do what I'm trying to.
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #4  
Old 06-10-2008, 03:56 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
Since you already have it set up in temp.npc, just do this:

PHP Code:
temp.npc putnpcdxdy"" );
npc.join"myclasslol" ); 
EDIT: I take that back, you don't have it setup like that, but you should ;o
__________________
Reply With Quote
  #5  
Old 06-10-2008, 02:08 PM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
well, I just need to know how I can read the string clientside if it was set serverside
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #6  
Old 06-10-2008, 02:50 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Rough script.

PHP Code:
function onActionServerSide()
{
  if (
params[0] == "putNPC") {
    
temp.npc putnpc2(this.xthis.y"join(\"newgas-" this.bombtype "\");");
    
temp.npc.time random(3050);
    
temp.npc.owner this.gasowner;
    
temp.npc.attr[25] = this.gasowner;
  }

Then in the class...

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
chat "My owner [" SPC attr[25SPC "]";

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 06-10-2008, 05:29 PM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
ahh. it worked. thank you
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #8  
Old 06-10-2008, 05:53 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Frankie View Post
ahh. it worked. thank you


I'd probably do something like this though:

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
this.owner attr[25]; // string > attr, 4sho
  
chat "My owner [" SPC this.owner SPC "]";

__________________
Follow my work on social media post-Graal:Updated august 2025.
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 04:56 PM.


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