Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-06-2006, 05:17 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
selectedweapon

Does selected weapon weapon-id; still work in GS2?

If so - how? I can't get it to work.

If not - what's the GS2 equilivant?
__________________



Reply With Quote
  #2  
Old 06-06-2006, 05:27 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
This should be in the gscript2 section.

The weapon the player currently has selected is assigned to the 'player.weapon' object, I believe.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 06-06-2006, 05:33 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
I wasn't sure if it was to go in the GS2 section or not, since it's also sort of in relation to GS1.

So it'll be player.weapon = "WEAPON";? Does it have to be serverside?
__________________



Reply With Quote
  #4  
Old 06-06-2006, 05:34 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Uh, I think player.weapon is readonly, not sure though.
Also, I said it's an object, not a string. ie: player.weapon.name, player.weapon.image, etc.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 06-06-2006, 05:36 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 ApothiX
Uh, I think player.weapon is readonly, not sure though.
Also, I said it's an object, not a string. ie: player.weapon.name, player.weapon.image, etc.
Correct.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 06-06-2006, 05:37 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Then how am I meant to change the players current weapon?
__________________



Reply With Quote
  #7  
Old 06-06-2006, 05:48 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
I belive you cant do that with script.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 06-06-2006, 05:52 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Well you were able to in GS1, so why remove that capability in GS2?
__________________



Reply With Quote
  #9  
Old 06-06-2006, 07:12 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
selectedweapon will still work...
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #10  
Old 06-06-2006, 07:15 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 Omini
Well you were able to in GS1, so why remove that capability in GS2?
You were? Then I suppose it would work in GS2 aswell..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 06-06-2006, 07:38 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Quote:
Originally Posted by napo_p2p
selectedweapon will still work...
Alright but I'm unsure how to get it done... it seems a bit different now.

PHP Code:
for (this.i=0;this.i<weaponscount;this.i++) {
      if (
strequals(#w(this.i),#I(clientr.hotkey1,0))) {
        
addstring clientr.hotkey1,#v(this.i);
        
break;
      }
    } 
That's GS1 version, of course. I'm not sure the GS2 version of #w(this.i)

I tried

PHP Code:
for (this.i=0;this.i<weaponscount;this.i++) {
      if (
this.== clientr.hotkey1[0]) {
        
clientr.hotkey1.insert(2,this.i);
        break;
      }
    } 
It doesn't seem to pick up if the this.i is the weapon name (clientr.hotkey1[0] is the name of the weapon)

Any suggestions? Like

PHP Code:
if (this.== clientr.hotkey1[0].id) { 
Or something.
__________________



Reply With Quote
  #12  
Old 06-06-2006, 07:48 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
You can do:

PHP Code:
for (temp.wweapons) {
  if (
temp.w.name == "whatever") {

  }

That's a special for loop that will go through each of the weapons, while making temp.w a reference to each weapon object.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 06-06-2006, 07:56 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
PHP Code:
clientr.hotkey1.replace(0,params[1]);
    
clientr.hotkey1.replace(1,params[2]);
    for (
temp.wweapons) {
      if (
temp.w.name == clientr.hotkey1[0]) {
        
clientr.hotkey1.replace(2,temp.w);
      }
    } 
That isn't working. Can you see where it's going wrong?
__________________



Reply With Quote
  #14  
Old 06-07-2006, 01:12 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Omini
PHP Code:
clientr.hotkey1.replace(0,params[1]);
    
clientr.hotkey1.replace(1,params[2]);
    for (
temp.wweapons) {
      if (
temp.w.name == clientr.hotkey1[0]) {
        
clientr.hotkey1.replace(2,temp.w);
      }
    } 
That isn't working.
Might help if you gave more information.

Have you tried doing: player.weapon = findWeapon("WeaponName"); ?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #15  
Old 06-07-2006, 01:46 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
I never bothered till now, and it pretty much broke it. Anymore suggestions?
__________________



Reply With Quote
  #16  
Old 06-07-2006, 04:08 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Omini
I never bothered till now, and it pretty much broke it. Anymore suggestions?
Did you bother to read the first half of my response?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #17  
Old 06-07-2006, 06:27 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Lol is this a serverside script or clientside? Because clientside it wouldnt work..
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #18  
Old 06-07-2006, 06:54 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Quote:
Originally Posted by ApothiX
Did you bother to read the first half of my response?
Yes, and I decided to not give you more information.

Quote:
Originally Posted by contiga
Lol is this a serverside script or clientside? Because clientside it wouldnt work..
The finding of weapon ID or setting the players weapon? Finding the ID is serverside, I was trying to set the players weapon clientside.
__________________



Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:30 PM.


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