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
➜ More SWR Planets
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Miked
USA (30 posts) Bio
|
Date
| Mon 04 Jul 2005 09:38 PM (UTC) |
Message
| How do I add more than three planets to a starsystem in SWR 1.0? | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #1 on Tue 05 Jul 2005 12:06 AM (UTC) |
Message
| You have to do one of two things: add a fourth(or fifth, sixth, etc) variable to the SYSTEM_DATA structure, or you can change the structure to use linked lists instead of predefined sections. I did this last option myself so that I can infinite amount of celestial bodies in a system. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Miked
USA (30 posts) Bio
|
Date
| Reply #2 on Tue 05 Jul 2005 12:12 AM (UTC) |
Message
| How do I do the latter? | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #3 on Tue 05 Jul 2005 01:06 AM (UTC) |
Message
| I actually made a new structure for celestial bodies with coordinates, type, name, etc, and made a linked list of them in SYSTEM_DATA. in do_radar for example, just cycle through the list printing the ones you want out. How familiar are you with c? It's probably a little much for a beginner, but it could be done. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Miked
USA (30 posts) Bio
|
Date
| Reply #4 on Wed 06 Jul 2005 11:52 PM (UTC) |
Message
| It seems like the first one would be alot more difficult that you make it sound. Wouldn't I have to add all kinds of stuff to space.c to handle all the new planets? | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #5 on Thu 07 Jul 2005 02:22 AM (UTC) |
Message
| The second is the more difficult of the 2 options, as you are redoing a good portion of the code, where the first options, adding planet4, planet5, etc, is adding more variables to use the current system. This method is basically search for the existing one and add on to it. if you make it so planets use linked lists, you have to make new loading functions, new commands to set all the variables, to create the planets, and modify where planets are used to access "for( planet = system->first_planet; planet; planet = planet->next)" instead of "planet1; planet2; etc". The advantage to the second method of redoing how its done is that it allows massive expansion by builders rather than having a coder at a 6th, 7th, 8th, 9th, etc. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Miked
USA (30 posts) Bio
|
Date
| Reply #6 on Thu 07 Jul 2005 02:29 AM (UTC) |
Message
| I guess I am going to use the first method as I only need nine, because I am not going to use hyperspace and need my planets in one system. Thanks for the help. I now have some serious coding to due.I assume I have increase the "doc"s and locations in space.c to match up with the new planets, right? | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #7 on Thu 07 Jul 2005 02:36 AM (UTC) |
Message
| Yes, if your going to go that method you would need to have additional docs for all the planets as well.
As a side note, I'm assuming your making it our solar system, and therefore the names and such would not change? If thats the case, you could even hard code that information to improve the speed of the program. If your ever planning on expanding it past that though, keep with your current plans. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | 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.
21,033 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top