Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Converting ROM snipper to FUSS
|
Converting ROM snipper to FUSS
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2 3
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #15 on Fri 16 Dec 2005 07:28 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #16 on Fri 16 Dec 2005 08:22 PM (UTC) |
| 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? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #17 on Fri 16 Dec 2005 08:31 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #18 on Fri 16 Dec 2005 08:40 PM (UTC) |
| Message
| | LoL could you give me an example, I kept trying to close it off, but it would compile parse errors. x_x;;; | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #19 on Fri 16 Dec 2005 08:58 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #20 on Fri 16 Dec 2005 08:59 PM (UTC) |
| 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. | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #21 on Fri 16 Dec 2005 09:48 PM (UTC) |
| 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? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #22 on Fri 16 Dec 2005 09:51 PM (UTC) 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:

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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #23 on Fri 16 Dec 2005 09:51 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #24 on Fri 16 Dec 2005 10:13 PM (UTC) |
| Message
| I assume check_improve is roms version of
learn_from_failure( ch, sn );
also what would be better to use than victim->fighting? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #25 on Fri 16 Dec 2005 10:16 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #26 on Fri 16 Dec 2005 10:48 PM (UTC) |
| 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? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #27 on Fri 16 Dec 2005 10:53 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Mopop
(115 posts) Bio
|
| Date
| Reply #28 on Fri 16 Dec 2005 11:10 PM (UTC) |
| 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... | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #29 on Fri 16 Dec 2005 11:12 PM (UTC) |
| 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 | | 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.
119,453 views.
This is page 2, subject is 3 pages long:
1
2 3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top