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 03-05-2007, 01:22 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Question sword power?

I want a door to open only if a person with a level 2 sword touches it.
ive try stuff like:
PHP Code:
if (playertouchsme && player.swordpower 2) {
hide;

and ive tryed other stuff like:
PHP Code:
if (playertouchsme && player.swordpower = >100) {
hide;

just to test but i think im useing the wrong scripts x.x
can someone help me?
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 03-05-2007, 02:44 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Yeah also I noticed you did "= >100" not sure exactly what you were going for, but that arrangement isn't going to work either. They don't really show this in commands.rtf but it goes like:

A == B would be A is equal to B
A > B would be A is greater than B
A < B would be A is less than B
A >= B would be A is greater than or equal to B
A <= B would be A is less than or equal to B

You can't do it this way =< or =>
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #3  
Old 03-05-2007, 05:44 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by konidias View Post
Yeah also I noticed you did "= >100" not sure exactly what you were going for, but that arrangement isn't going to work either. They don't really show this in commands.rtf but it goes like:

A == B would be A is equal to B
A > B would be A is greater than B
A < B would be A is less than B
A >= B would be A is greater than or equal to B
A <= B would be A is less than or equal to B

You can't do it this way =< or =>
I've done => and I think it worked
Reply With Quote
  #4  
Old 03-05-2007, 06:21 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Twinny View Post
I've done => and I think it worked
same, worked fine. :P I think he has a space between his so maybe thats why it didnt work.
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 03-05-2007, 07:50 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by Twinny View Post
I've done => and I think it worked
Oh my god who cares if that works or not, for the love of god please do not do it!
__________________
Reply With Quote
  #6  
Old 03-05-2007, 10:58 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Kristi View Post
Oh my god who cares if that works or not, for the love of god please do not do it!
I also do == to set variables

just kidding
Reply With Quote
  #7  
Old 03-05-2007, 11:03 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
Quote:
Originally Posted by Kristi View Post
Oh my god who cares if that works or not, for the love of god please do not do it!
Yes, this is one of the reasons why UN is so difficult to convert to GS2. Just because something works, it doesn't mean that it is the right way to do it (it might even just come back to bite you ... or someone else >:O).

I have scars.
__________________
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
  #8  
Old 03-05-2007, 11:20 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by napo_p2p View Post
Yes, this is one of the reasons why UN is so difficult to convert to GS2. Just because something works, it doesn't mean that it is the right way to do it (it might even just come back to bite you ... or someone else >:O).

I have scars.


No one's forcing you to do it. You should have known what you were getting into, I mean, we are talking about UN here.
Reply With Quote
  #9  
Old 03-05-2007, 11:22 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
I don't know if either of you are trying to be funny, but have some respect.
I don't complain about how ugly either of you two script, so what in hell gives you the right to do it?
Reply With Quote
  #10  
Old 03-06-2007, 12:38 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by Chandler View Post
I don't know if either of you are trying to be funny, but have some respect.
I don't complain about how ugly either of you two script, so what in hell gives you the right to do it?
My post production scripts are pretty >:o

It is not an astethics issue either. => would break in most languages, it is a habit you want to break out of asap.
__________________
Reply With Quote
  #11  
Old 03-05-2007, 01:43 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Well first, Your syntax is wrong (You used = in the If operation instead of ==) -- Try this:

PHP Code:
if (playertouchsme && player.swordpower == 2)
{
hide;

This is hybridized though, I suggest you do:

PHP Code:
function onPlayerTouchsMe()
{
     if (
player.swordpower == 2)
     {
          
hide();
     }

__________________
What signature? I see no signature?

Last edited by godofwarares; 03-05-2007 at 01:44 AM.. Reason: Forgot to point out the error
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 07:30 PM.


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