[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Converting ROM snipper to FUSS
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Converting ROM snipper to FUSS

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 3  

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #15 on Fri 16 Dec 2005 07:28 PM (UTC)  quote  ]
Message
|| is a logical or. && is a logical and.

I'm not just talking about that part. Any part in the code, pretty much before it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #16 on Fri 16 Dec 2005 08:22 PM (UTC)  quote  ]
Message
Well I didnt edit anything before It, Im really crappy with the looking for this stuff cause I dont know very much about it.


    /* Do the character know how to handle a gun ? */
    for(number = 0 ; number < shots ; number = number + 1)
        {
        if( can_use_skill( ch, number_percent( ), gsn_clip ) && IS_OBJ_STAT(gun,GUN_CLIP)
        ||( can_use_skill( ch, number_percent( ), gsn_energy ) && IS_OBJ_STAT(gun,GUN_ENERGY)
        ||( can_use_skill( ch, number_percent( ), gsn_shell ) && IS_OBJ_STAT(gun,GUN_SHELL)
        ||( can_use_skill( ch, number_percent( ), gsn_fuel ) && IS_OBJ_STAT(gun,GUN_FUEL)
        ||( can_use_skill( ch, number_percent( ), gsn_rocket ) && IS_OBJ_STAT(gun,GUN_ROCKET)
        }
            obj_cast_spell( gun->value[3], gun->value[0], ch, victim, obj );

You see any error in this?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #17 on Fri 16 Dec 2005 08:31 PM (UTC)  quote  ]
Message
You're missing a lot of closing parenthesis. As I said, make sure they're all closed off. Every ( after the or isn't closed.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #18 on Fri 16 Dec 2005 08:40 PM (UTC)  quote  ]
Message
LoL could you give me an example, I kept trying to close it off, but it would compile parse errors. x_x;;;
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #19 on Fri 16 Dec 2005 08:58 PM (UTC)  quote  ]
Message
This should fix that part:
    /* Do the character know how to handle a gun ? */
    for(number = 0 ; number < shots ; number = number + 1)
        {
        if( can_use_skill( ch, number_percent( ), gsn_clip ) && IS_OBJ_STAT(gun,GUN_CLIP)
        ||( can_use_skill( ch, number_percent( ), gsn_energy ) && IS_OBJ_STAT(gun,GUN_ENERGY))
        ||( can_use_skill( ch, number_percent( ), gsn_shell ) && IS_OBJ_STAT(gun,GUN_SHELL))
        ||( can_use_skill( ch, number_percent( ), gsn_fuel ) && IS_OBJ_STAT(gun,GUN_FUEL))
        ||( can_use_skill( ch, number_percent( ), gsn_rocket ) && IS_OBJ_STAT(gun,GUN_ROCKET)))
        }
            obj_cast_spell( gun->value[3], gun->value[0], ch, victim, obj );


Do you see why/how?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #20 on Fri 16 Dec 2005 08:59 PM (UTC)  quote  ]
Message
Oh! at the end... lol

if( can_use_skill( ch, number_percent( ), gsn_clip
I was only looking here...I thought the && was independant from the rest.
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #21 on Fri 16 Dec 2005 09:48 PM (UTC)  quote  ]
Message
act_obj.c:3350: warning: suggest parentheses around && within ||
act_obj.c:3378: warning: implicit declaration of function `check_improve'

What does the implicit declaration mean?

victim->fighting;
It also says this statement has no effect?
[Go to top] top

Posted by Nick Gammon   Australia  (19,670 posts)  [Biography] bio   Forum Administrator
Date Reply #22 on Fri 16 Dec 2005 09:51 PM (UTC)  quote  ]

Amended on Fri 16 Dec 2005 09:52 PM (UTC) by Nick Gammon

Message

If you paste the problem piece of code into the inbuilt notepad in MUSHclient, you can put the cursor on a bracket, and then do Edit -> Select to Matching Brace. This highlights up to the matching brace (skipping nested ones), like this:

example

Now if you move back to just after the "if" and do it, nothing is selected, which shows there is a bracket missing somewhere.

Other editors do this too.

Now you count left/right bracket pairs to see why it can't find the closing bracket.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #23 on Fri 16 Dec 2005 09:51 PM (UTC)  quote  ]
Message
Do you have the function check_improve somewhere in the code?

And yes, victim->fighting does nothing.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #24 on Fri 16 Dec 2005 10:13 PM (UTC)  quote  ]
Message
I assume check_improve is roms version of
learn_from_failure( ch, sn );

also what would be better to use than victim->fighting?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #25 on Fri 16 Dec 2005 10:16 PM (UTC)  quote  ]
Message
Better than victim->fighting? What exactly do you intend to be doing..?

If check_improve is the learn_from, make sure you have a check for both success and failure.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #26 on Fri 16 Dec 2005 10:48 PM (UTC)  quote  ]
Message
obj = NULL;
if ( arg2[0] == '\0' )
{
if ( ch->fighting != NULL )
{
victim->fighting;
}
else
{
send_to_char( "Shoot whom or what?\n\r", ch );
return;
}

Thats the whole code, I dont know why its checking to see if someone is fighting?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #27 on Fri 16 Dec 2005 10:53 PM (UTC)  quote  ]
Message
That makes no sense. From what I've seen, this is a really bad snippet... If they wanted to do a null statement, they could have just used ;

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #28 on Fri 16 Dec 2005 11:10 PM (UTC)  quote  ]
Message
LoL Its the best I could find =( im not even sure why you need to check to see if someone is fighting for that...
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #29 on Fri 16 Dec 2005 11:12 PM (UTC)  quote  ]
Message
It looks to me like it is suppose to set your target to who you're fighting. But that's not what it does.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,485 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]