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-11-2005, 12:19 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
join problems

I have some serverside local NPCs using a class on the server for house furniture where you can drag it with your mouse to move it. The dragging part is done, but I'm having a problem with 1 little thing...The join part. As of now, the local npcs set the string thiso.obj_archetype (also tried this.) to the type of furniture it is (bed, chair, etc...).

I don't think its possible to do join #s(string); But here's what I have now:
PHP Code:
if (created || initialized) {
  
// Object Archetypes
  
if (strequals(#s(thiso.obj_archetype),chair)) setimg amz_chair.png;
  
if (strequals(#s(thiso.obj_archetype),bed)) setimg element_bed1.png;
  
join ph_#s(thiso.obj_archetype);

Heres something else I tried...
PHP Code:
if (created || initialized) {
  
// Object Archetypes
  
if (strequals(#s(thiso.obj_archetype),chair)) {
    
setimg amz_chair.png;
    
join ph_chair;
  }
  if (
strequals(#s(thiso.obj_archetype),bed)) {
    
setimg element_bed1.png;
    
join ph_bed;
  }

That just makes it only join the bed script...

Can anyone help?
Reply With Quote
  #2  
Old 01-11-2005, 12:31 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
First of all, as you should know, thiso.string is only used when using the "with" command. Also, make suyre the script is serversided, you cant use this.string clentsided. I would use the bottom script, and just change the string names to this.whatever.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #3  
Old 01-11-2005, 12:34 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Try diong a sendtorc or such to verify that it's actually going into that bracket and verifying it, if not, it's not joining simply because your code is faulty. Make sure it works and let me know, I would be willing to bet that is your problem.
__________________
Who has time for life these days?
Reply With Quote
  #4  
Old 01-11-2005, 12:36 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by falco10291029
First of all, as you should know, thiso.string is only used when using the "with" command. Also, make suyre the script is serversided, you cant use this.string clentsided. I would use the bottom script, and just change the string names to this.whatever.
Tried it. Wasn't working. I said above that its all serverside.

Quote:
Originally Posted by Projectshifter
Try diong a sendtorc or such to verify that it's actually going into that bracket and verifying it, if not, it's not joining simply because your code is faulty. Make sure it works and let me know, I would be willing to bet that is your problem.
I verified it was doing the right join stuff with showimg @@@. I had 3 NPCs and all of them showed the right data. It's all a problem with the join command.
Reply With Quote
  #5  
Old 01-11-2005, 12:44 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
it probably is joining them both when the NPC is created

i dont think join acts like a normal command
__________________

Reply With Quote
  #6  
Old 01-11-2005, 12:48 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Evil_Trunks
it probably is joining them both when the NPC is created

i dont think join acts like a normal command
Thats what I was thinking.

PHP Code:
if (created || initialized) {
  
// Object Archetypes
  
if (strequals(#s(this.obj_archetype),chair)) {
    
setimg amz_chair.png;
    
join ph_chair;
  }
  if (
strequals(#s(this.obj_archetype),bed)) {
    
setimg element_bed1.png;
    
join ph_bed;
  }

That's what I'm using right now. It only joins the bed. I guess join isn't a normal command...
Reply With Quote
  #7  
Old 01-11-2005, 12:48 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Tried it. Wasn't working.
Well using the wrong string name definitely won't help
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #8  
Old 01-11-2005, 12:50 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by falco10291029
Well using the wrong string name definitely won't help
The string name is correct. The script works (up until the join command) fine with this. or thiso. string prefixes.
Reply With Quote
  #9  
Old 01-11-2005, 02:17 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Slash-P2P
That's what I'm using right now. It only joins the bed. I guess join isn't a normal command...
I think that it is joining both, but whatever commands are in the bed class are overriding those of the chair class. The join command will execute, regardless of if the if statement it is nested in is true. I think the joins are executed before the rest of the script is run. Therefore, the string is nothing, and it is looking for a class ph_ (in your case).

NPC Code:
if (playerchats){
if (strequals(#c,join)){
join someclass;
}
}


This should join before you say anything.
Reply With Quote
  #10  
Old 01-11-2005, 01:42 PM
JudgeDurst JudgeDurst is offline
Malorian
JudgeDurst's Avatar
Join Date: Jan 2002
Posts: 145
JudgeDurst is on a distinguished road
Is this a class joining classes?
When i was experimenting i found the class itself becomes part of the class it joins, rather than the individual instance of the class.
__________________
MrWorry, Lover of Maloria
Reply With Quote
  #11  
Old 01-11-2005, 09:52 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Its a class joining a class. Anyways. The ph_ scripts are basically some image stuff and setshape stuff (maybe other functions later). Right now I made the stuff clientsided...I don't have a problem with the NPC anymore, but I think this should be fixed.

Make the join command work correctly so it obeys iff (conditions) it is placed under.
Reply With Quote
  #12  
Old 01-12-2005, 01:01 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Join is a static directive, dawg. It's not a command per se.

Also, read KSI-GS.
__________________
Reply With Quote
  #13  
Old 01-12-2005, 06:15 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
as kaimetsu said its a static directive it doesnt matter where you put it if its there it will join that class IE the script of the class will be added to the npc it cannot fall into if statements so you will need to do something different.
An example being use putnpc2 inside the if statements and inside of the putnpc 2 script have it join the appropriate class eh?
__________________

To the sun of your age, I arise
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 08:48 AM.


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