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
➜ Help with how to go about doing this.
Help with how to go about doing this.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Gtr
(38 posts) Bio
|
Date
| Mon 21 Jun 2004 08:20 AM (UTC) |
Message
| I'v been racking my brains over this one, hope someone can help. How would you go about adding in somthing to check to see if the person in your argument is within a certin number of rooms away in any direction. Like say you wanted a person to follow somone but they were 4 rooms away north and the person had whatever stat it took to see four rooms away, it would check around just within a given number in this case 4.
Thanks.
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Mon 21 Jun 2004 04:17 PM (UTC) |
Message
| Hmm, check over how the arrow/bow functions are done. I think the command is do_shoot or do_fire. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #2 on Mon 21 Jun 2004 05:49 PM (UTC) |
Message
| Well, if you're just going straight it's pretty simple. You keep taking the north exit, keeping a counter (as Zeno said look at the ranged code) until you find your target or until you go past maximum distance.
The problem comes when you need to check non-straight lines, e.g. two north, one west. Is that something you need to do? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #3 on Mon 21 Jun 2004 07:52 PM (UTC) |
Message
| That was the first place I looked, but the problem is it only checks one direction that way, thou all I want is it to check in straight lines, but I want it to check in every direction around the charecter. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #4 on Mon 21 Jun 2004 09:13 PM (UTC) |
Message
| Then do it in a loop of all directions of the ch->in_room |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #5 on Mon 21 Jun 2004 09:29 PM (UTC) |
Message
| Hrmm and if I wanted it to depend on a number set to the charecter of how many rooms it would check...how do you think that would work I have ideas but more wouldnt hurt. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #6 on Mon 21 Jun 2004 10:06 PM (UTC) |
Message
| Define "a number set to the charecter". |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #7 on Mon 21 Jun 2004 11:54 PM (UTC) |
Message
| Ok say the charecters sight range was 5 it would check 5 rooms away in all directions when the command is executed to look for the victim. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #8 on Mon 21 Jun 2004 11:55 PM (UTC) |
Message
| What's the catch here? How is this different from what the ranged weapons do? Just make a variable e.g. sight in CHAR_DATA and take the data from there. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #9 on Tue 22 Jun 2004 12:12 AM (UTC) |
Message
| Scan already does this, checks how many rooms in a direction based on the % skill you have, with the ranged combat do_fire it gets the rooms limit from the weapon from V4 or V5 if i remember right (sorry no at the game right now), i think that between those 2 bits of code you should be able to come up with what your looking for. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #10 on Tue 22 Jun 2004 09:20 AM (UTC) |
Message
| Thnks guys I should have looked at the code better, I have somthing in the works, | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #11 on Tue 22 Jun 2004 01:02 PM (UTC) |
Message
| OK...well I ran into another problem with this. Scan works by checking the direction you specify, I manged to have it check 1 room away in all directions via. "for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )"
That checks all the exits around the charecter but yeah...only one room away in each direction. What I was refering to was this same thing. But more then one room away (the amount based on a value) the same way without needing to specify a direction. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #12 on Tue 22 Jun 2004 08:58 PM (UTC) |
Message
| Why can you not do what we suggested, which was to do just that but continue going in the direction until your value hits 0? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Gtr
(38 posts) Bio
|
Date
| Reply #13 on Tue 22 Jun 2004 09:50 PM (UTC) |
Message
| To be honest, I'm not exactly sure how to go about doing that. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #14 on Tue 22 Jun 2004 10:13 PM (UTC) |
Message
| Did you look at the ranged weapon code? That there shows you how to go in the same direction until you run out of distance. You need to do that same process but in a loop over the exits of the room. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.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.
44,679 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top