DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • October 22, 2017, 03:32:02 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: map-like function  (Read 2812 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« on: October 07, 2005, 12:26:26 AM »

I wanted to code a module which makes travelling a bit more reallistic than the cities-module by itself but not that reallistic as the worldmap-module...

Now a trip from each city to any other city consumes 1 travel  - so it seems like all cities have the same distance to each other city...

Now, there a two possibilities: the first one: I can block all navs to cities which are not directly accessible, e.G.
Code:
Glorfindal                  Romar           Degolbourg
     X                         Y                  Z

From Romar I could travel to Degolbourg or Glorfindal, But from both other towns I could only travel to Romar...

That can be done quite easily...

But if I want to make a trip from Glorfindal to Degolbourg cost 2 travels, it becomes more tricky than I can think of now... Any ideas?
Logged

Running for more than three years now:
Nightborn
Guest
« Reply #1 on: October 07, 2005, 02:52:30 AM »

You might calculate the costs of travel in a n-times-n Matrix.
Code:
From:              X                  Y                 Z
To:

X                      0                  1                 2


Y                      1                  0                 3


Z                      2                  4                 0

Note: if the Matrix isn't symmetric, the way between to cities is different... it takes you 3 travels to go from Z  to  Y ... but from Y to Z 4 ...

All you have to do in the prefs is to get the names of all cities and develep this form for the admin to enter. of course, the trace of this Matrix is 0 ... because if you travel from Z to Z there is no time Tongue


Note: if a city is not acessible, make the entry -1 Wink Upon this, you can calculate freely. I had a "proseminar" last semester about these problems... Eulerian circles and the like Wink
« Last Edit: October 07, 2005, 02:53:59 AM by Nightborn » Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #2 on: October 07, 2005, 03:07:41 AM »

That's not that problem... My problem is: How do I charge 2 travels for a trip instead of one and without replacing the whole cities-module... Nowhere it is saved, where the travel started, when you reach your destination... Sad
Logged

Running for more than three years now:
Nightborn
Guest
« Reply #3 on: October 07, 2005, 03:34:00 AM »

Oh, sorry...

Hm.
Didn't played with it yet... but I guess I can't come up with a good answer.
A hook to the travel module to collect the start and the destination... I don't know Sad sorry
Logged
Dannic
Guest
« Reply #4 on: October 07, 2005, 04:16:34 AM »

Let me know if you solve this one Xchrisx.  This is the reason for my city module that I wrote.  I just don't have time to look at it.

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
27 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search