Register forum user name Search FAQ

Gammon Forum

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 ➜ Sticks and stones

Sticks and stones

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Garaelb   (54 posts)  Bio
Date Sun 20 Jul 2003 09:57 PM (UTC)
Message
will break my bones but bows and arrows are better.

So here I am trying to figure out how to make missile weapons that actually work.

using the Area Editor(tm) - can someone walk me thru it in a step by step process. A ranger without a bow is like a dog without teeth. And what am I to do with all my goblin archers who right now just slap the characters with their bows instead of shooting them with arrows.

And then also how to use a bow as a player and as a mob.

garaelb
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #1 on Sun 20 Jul 2003 11:03 PM (UTC)
Message
Unless SMAUG has code support for ranged combat (I'm pretty sure it doesn't) the closest you will be able to get is either writing a new damage noun into the combat routine to simulate the use of arrows, (far more complicated) writing a combat subroutine to handle bow-type weapons and have it use its own set of damage nouns, or (more complicated still) actually code in range weapon support for combat across multiple rooms. The last option is going to be very involved and very complicated and is usually disregarded due to the returns for the effort involved. The only mud I've personally seen with functional ranged combat is a highly modified circle mud but I'm pretty sure they won't give ya their code since it's still a moderately viable site.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #2 on Sun 20 Jul 2003 11:38 PM (UTC)
Message
according to the help file in the stock game -
Quote:
help fire
FIRE
Syntax: fire <direction> target

This command is for use with bows and arrows. You must have the weapon
type missileweapons, a bow wielded and a quiver or arrows in your inventory.
**This will damage another player and should be used with caution **
*** For smaug release.. use wooden bow and flint from newdark***


and

Quote:
help missile
MISSILE
Missile weapons have the unique ability to fire at one's opponent
from a distance. In order to be successful, the attacker must have a
weapon missile wielded (Only certain weapons are able to be missile wielded)
and must have an appropriate ammunition in inventory.

Example: To use a bow and arrow, one must have a bow missile wielded and
have an arrow in inventory.

See help fire and help fletch


but nothing to tell you how to make them (bows and arrows) in the Area Editor
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Sun 20 Jul 2003 11:43 PM (UTC)
Message
Well, given that info, I'd check the code behind the fire function, I'd guess its do_fire but you may have to check the command table to get the proper function. In that function will be the itemtype and other info necessary to make whatever code there is for ranged combat actually work.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #4 on Sun 20 Jul 2003 11:49 PM (UTC)
Message
well I don't use a version of SMAUG that I can re-compile so code modifications are kinda mute. Just need to know how to make them and use them in conjunction with the AREA EDITOR
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #5 on Mon 21 Jul 2003 12:09 AM (UTC)
Message
You dont have to be able to compile the code to have it for reference. I personally don't use smaug or the area editor Nick offers so I cant really help ya there, but if ya download the smaug source, do a search on the directory you unzip it to for "fire" and do_fire you should find the files in which the code behind the fire mechanic is written. Check the specific function for which item type it checks for then flag your newly created obj as such in the area editor, assuming it supports the flags in the first place.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #6 on Mon 21 Jul 2003 04:50 AM (UTC)
Message
Quote:

Just need to know how to make them and use them in conjunction with the AREA EDITOR


This is really an Area Editor question, right? It really belongs in the Area Editor section to get the maximum response, otherwise people think you are asking a general question about SMAUG.

Anyway, what is the problem exactly? I am looking at newdark.are in the Area Editor, by searching for "arrow" I see an example arrow, type "projectile", flags "Take Hold Missile". That seems a good start.

I also see "a wooden bow", type "crossbow", flags "Take Missile".

You could duplicate those, or make similar ones from scratch. So what is the question exactly? How to duplicate one? How to make one? You have made one and it doesn't work?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #7 on Mon 21 Jul 2003 06:32 AM (UTC)
Message
My appologies Nick for the misplaced topic.

Well I made a bow and I made an arrow and I made a quiver but I can't seem to get mobs to use the bow and arrows correctly nor can I use them as a player. All I seem to be able to do with the bow is use it as a club, and the arrows are worthless. LOL

Also can there be 'thrown' missle weapons or only launched ones? I just get a little confused with it sometimes. I vewy vewy swow sometimes. eheheheeh...

garaelb
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #8 on Mon 21 Jul 2003 07:27 AM (UTC)
Message
You are taking me out of my area a bit here. :)

The Area Editor will set flags and object types, however I'm not always sure how the server will interpret those.

I haven't done arrows or throwing weapons, perhaps someone else here can help.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #9 on Mon 21 Jul 2003 09:29 AM (UTC)
Message
Ya know, it really is amazing how useful a reference source code can be sometimes. After a very quick search thru the 1.4a source available here I found this comment in the middle of the ranged combat system:


/*
 * letsee, if they're high enough.. attack back with fireballs
 * long distance or maybe some minions... go herne! heh..
 *
 * For now, just always miss if not in same room  -Thoric
 */


In essence as cool as the idea behind ranged combat might be, they never got past the "take a shot at someone in the same room and turn yer bow into an overpriced club" stage with it, kinda what I suspected all along. Meanwhile, if anyone wants to do any work on that particular feature for their mud, the functions are in skills.c and that particular comment is in the ranged_got_target function.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #10 on Mon 21 Jul 2003 12:54 PM (UTC)

Amended on Mon 21 Jul 2003 02:47 PM (UTC) by David Haley

Message
If I may be so bold, you forgot the following, Meerclar:


    if ( IS_NPC(victim) && xIS_SET(victim->act, ACT_SENTINEL)
    &&   ch->in_room != victim->in_room )
    {
	/*
	 * letsee, if they're high enough.. attack back with fireballs
	 * long distance or maybe some minions... go herne! heh..
	 *
	 * For now, just always miss if not in same room  -Thoric
	 */


So, actually, you always miss if you're attacking a sentinel mob not in your room. That makes sense, since the sentinel will never move, and it would be unfair to let players whack away without danger... In fact, right after the sentinel check:


    if ( number_percent() > 50 || (projectile && weapon
    &&   can_use_skill(ch, number_percent(), gsn_missile_weapons)) )
    {
	if ( projectile )
	    global_retcode = projectile_hit(ch, victim, weapon, projectile, dist );
	else
	    global_retcode = spell_attack( dt, ch->level, ch, victim );
    }


... which is where you actually roll to see if you hit the target. Also notice that if there is no projectile, it does a spell_attack - which implies that there is probably support for ranged spells.

I'm pretty sure that pseudo-ranged combat is completely implemented. It's kind of funky, sure, but it's there.


Getting mobs to use ranged weapons correctly is going to be a toughie, since you need to manually enter a fire command. You need to say: fire east fred. From skills.c:

/*
 * Fire <direction> <target>
 *
 * Fire a projectile from a missile weapon (bow, crossbow, etc)
 *
 * Design by Thoric, coding by Thoric and Tricops.
 *
 * Support code (see projectile_hit(), quiver support, other changes to
 * fight.c, etc by Thoric.
 */


So, a mob would have to know how to "type in" that command. That's the tricky part.

As for doing it as a player, I'm not sure why it doesn't work. If you're in "normal fighting", yes, you'll be whacking with your bow like it was a club, but if you use the fire command there's no reason why it shouldn't work.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #11 on Mon 21 Jul 2003 02:21 PM (UTC)
Message
thanks gang - this will certainly help in the understanding of missile weapons as they relate to SMAUG.

So as a final recap -
Bows on mobs are as useless as screen doors on submarines.

players with missile weapons can use the ranged attacks but only on mobs that are not SENTINALS

esentially after a shot with the bow and arrow the bow becomes a poormans club - possibly to counteract that the game host might consider making the bow with club damage in addition to its missile damage - and make the arrow more lethal on its one shot by giving it high damage points.

lastly - some hotshot codemaster could really gain a lot of brownie points if they designed a code snippit that made ranged weapons work and serve a functional purpose in the game LOTS OF BROWNIE POINTS. :-)

Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #12 on Mon 21 Jul 2003 05:10 PM (UTC)
Message
See, thats what I get for trying to read someone elses code at 330 in the blazin mornin when Im gettin ready to go to bed. At least I left the file ref so it was easy to find :) Anyway, there's also the consideration of room crowding when dealing with missile combat.... too many ppl/mobs in the room and ya can't fire. As for mobs, there was a subsection dealing with em somewhere in that routine but for the moment I'm just too lazy to go find it again. I would think archer mobs could be brutally effective with a creative mprog though.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Wifidi   (14 posts)  Bio
Date Reply #13 on Sun 13 Feb 2011 12:17 PM (UTC)
Message
Code projectiles as mobiles speedwalking to a mobile and magic arrows as mobiles tracking a mobile, except the problem David Haley points out of having the projectile have to enter the command "kill <target>". Also some players players might stylistically object to seeing the message: "<projectile> has arrived. <projectile> leaves <direction>."
Top

Posted by Wifidi   (14 posts)  Bio
Date Reply #14 on Sun 13 Feb 2011 12:25 PM (UTC)
Message
Wifidi said:

Code projectiles as mobiles speedwalking to a mobile and magic arrows as mobiles tracking a mobile, except the problem David Haley points out of having the projectile have to enter the command "kill <target>". Also some players players might stylistically object to seeing the message: "<projectile> has arrived. <projectile> leaves <direction>."

Sorry for the typo's. Causing a 1 or low hitpoint projectile-name mobile to speedwalk and attack, or track and attack, might be achievable via non-echo'ed charm orders, though I have no idea how to code something like that. The thought of being able to get out of the way in time is exciting and the thought of being tracked is terrifying. Another problem is not making the target appear to be fighting against a normal projectile, while fighting against a magic or poisoned projectile might come off appropriately.
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.


61,954 views.

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

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.