DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 02, 2010, 09:42:42 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Cartographer  (Read 3412 times)
0 Members and 1 Guest are viewing this topic.
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« on: March 18, 2005, 08:44:02 AM »

http://dragonprime.net/users/sixf00t4/cartographer.zip

A small file for the cartographer, and a template file for maps.  fairly simple, just uses blocknav() to where you want players to have a map to access.
Logged

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #1 on: March 21, 2005, 06:42:49 PM »

forgot a .php on a nav in the template.  all you have to do is replace all instances of TEMPLATE.
Logged

ShadowRaven
Mod God
*****
Offline Offline

Posts: 761

Silence is a virtue...


View Profile WWW
« Reply #2 on: April 09, 2005, 10:15:15 PM »

umm can you be a little more specific on how this works? I tried it, but can't figure out how to use the map. *has the distinct feeling that she's about to feel really stupid...* lol
Logged

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #3 on: April 09, 2005, 10:19:14 PM »

all you have to do is replace all instances of TEMPLATE.
with the place the map is for.  which means *shocker* you actually have to edit files for this module Smiley  like, my players have to get a may to go to lonny's castle.  so i took out template, and put in lonnycastle.php or lonny's castle, which ever made sense;)
Logged

ShadowRaven
Mod God
*****
Offline Offline

Posts: 761

Silence is a virtue...


View Profile WWW
« Reply #4 on: April 09, 2005, 10:27:37 PM »

ahh ok gotcha *proceeds to feel stupid now* lol
Logged

heywood
Guest
« Reply #5 on: October 23, 2005, 09:46:54 PM »

hey Six I finally had some time to set this up and got the map working but the blocknav doesnt seem to be working. I set it up for Poseidon Pool but if I dont have the map I can still see the nav to the pool.

Nevermind, my bad. I put in pool.php for the module instead of pool. It works if you code it right Smiley
« Last Edit: October 23, 2005, 10:02:06 PM by Merlin » Logged
heywood
Guest
« Reply #6 on: October 23, 2005, 11:07:03 PM »

One more question, can this be modified to make a city require a map? I tried it with a city that has a race and changed the case from "village" to "travel" and it didnt work.
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #7 on: October 24, 2005, 06:21:25 AM »

you'll need to change the hook as well.
Logged

heywood
Guest
« Reply #8 on: October 25, 2005, 06:42:07 PM »

Do you mean this on line 32?



Code:
module_addhook("village");
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #9 on: October 26, 2005, 04:39:01 AM »

yep, hook into travel, change the case to travel, and you're going to have to block the nav to the city name, so something like...
Code:
$city=getsetting("villagename", "racedwarf");
blocknav(runmodule.php?module=cities&op=travel&city=".urlencode($city));
« Last Edit: October 26, 2005, 04:39:23 AM by sixf00t4 » Logged

heywood
Guest
« Reply #10 on: October 30, 2005, 06:58:32 AM »

Thanks Six, Im starting to get the hang of it. That was my problem I didnt block the city name just the module.
Logged
Chewie
Captain of the Guard
***
Offline Offline

Posts: 152

Ignore this.


View Profile WWW
« Reply #11 on: April 05, 2006, 09:55:36 PM »

yep, hook into travel, change the case to travel, and you're going to have to block the nav to the city name, so something like...
Code:
$city=getsetting("villagename", "racedwarf");
blocknav(runmodule.php?module=cities&op=travel&city=".urlencode($city));

Could you please show this code in a somewhat larger context so it's clear exactly where to add the new lines?
Logged
Chewie
Captain of the Guard
***
Offline Offline

Posts: 152

Ignore this.


View Profile WWW
« Reply #12 on: April 22, 2006, 03:38:31 PM »

Also, if you limit access to a city with this module, is there some code that needs to be added somewhere to keep it compatible with CortalUX dragon place mod (or vice versa)?
Logged
Kaylee
Guest
« Reply #13 on: June 30, 2006, 06:21:11 PM »

I don't really code, I just dabble, so I hesitate to post this. Maybe a real coder will see why this could cause problems. But I was intrigued by the idea of making a whole city invisible unless you have a map. Anyway, after some trial and error, this is what I found works for me:

Substitute the codename for the map wherever you find the word "template." In this case, I used deus, the cityname being Deus Nocturnum. So the file is named deusmap.php. I never had to use the ".php" suffiix anywhere in my edits. "Templateplace" became simply Deus Nocturnum.

Then, blocking the nav. As I say, I don't really know php, but this worked. This is how lines 45 to 55 look in my file deusmap.php:

switch($hookname){
         case "travel":
            if (get_module_pref('hasmap','deusmap')==0) blocknav('runmodule.php?module=cities&op=travel&city=Deus Nocturnem&d=1');
         if (get_module_pref('hasmap','deusmap')==0) blocknav('runmodule.php?module=cities&op=travel&city=Deus Nocturnem');
        break;
       
        case "maps-cartographer":
            if($session['user']['dragonkills'] >= (get_module_setting("dksneeded","deusmap"))){
            addnav("Deus Nocturnem","runmodule.php?module=deusmap");
            }
        break;
     
Then, I changed the hook on line 32 to read:
module_addhook("travel");

It seems to work.

Now..... any suggestions how to automatically give a map to any player who selects race vampire?
Also, is this method acceptable, or am I asking for trouble?
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #14 on: June 30, 2006, 07:32:20 PM »

instead of hard coding "deus noturnem" into the url, do as in the example in the above posts to save the city name as a variable.

and instead of actually giving maps to vampires, you can just add a check to allow them navigation if they are vampires.  that way, they'll still need the map if they change their race.

Code:
if(get_module_pref('hasmap','deusmap')==0 && $session['user']['race']!="vampire")
Logged

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


*
DragonPrime Notices
Play LoGD on Dragonprime

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