DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 18, 2018, 06:15:08 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3   Go Down
  Print  
Author Topic: Streets Plus (Forest and City with hooks +) and example add-on  (Read 12142 times)
0 Members and 1 Guest are viewing this topic.
Sig
Guest
« on: October 19, 2005, 03:07:20 PM »

Streets Plus

This module was originally based off of my forest streets and, in turn, Radioactivebloke's Streets module.  It installs up to 5 streets in both the forest and the city.

Features:
- 5 streets in the village, 5 in the forest, 10 in total
- Up to 10 links for each street (although add-on modules can be used to add more)
- All streets can have seperate descriptions
- All streets have their own chat (which can be disabled by add-ons)
- The links can be easily toggled off by an add-on
- Global module hook and individual module hooks
- Replaces practically any current streets module
- Fully customizable through settings (or on occasion, module add-ons)

To Come:
- Some way to decrease the size of the settings, any ideas?

http://dragonprime.net/users/Sig/streetsplus.txt


Arcadian District

Based on Dhampir Khampf's Arcadia Village, albeit 95% original.  Sample module add-on for my Streets Plus module.  Hides links in the fifth forest street to all players under 31 DKs (configurable).  Has it's own module hook for adding something in to the Arcadian District itself.

Features:
- Reserves the fifth forest street from the Streets Plus Module for only those with a certain number of dks
- Supports banning of players and allowing of players beneath the requirement
- Module hook in order to have some content only for higher DK players
- Features chat only viewable by these higher dk players
- Serves as a basis for any add-on modules for the Streets Plus

http://dragonprime.net/users/Sig/arcadiadist.txt
Logged
MyLotGD
Captain of the Guard
***
Offline Offline

Posts: 136


View Profile WWW
« Reply #1 on: October 19, 2005, 10:10:12 PM »

You should add the path to the file to the download key of the $info = array();

"download"=>"http://dragonprime.net/users/Sig/streetsplus.txt",

It isn't "required" but if you "are" to publicly release it by posting here you may want to include the path to the file.  

As for decreasing the size of the settings, no way to do it that I can think of that wouldn't increase the file size of the module. If you use a table in MySQL you'll be forced to add the table structure into the install() or require the person making use of the module to manually create the table in their database via the SQL you provide.

Afterward you'll most likely want to create a editor to edit that table from within the Superuser Grotto. (For those who can not use or simply login to a Database Management tool like PHPMyAdmin to edit the tables values.) Though there are other options if you don't want to use a table in MySQL you could easily use a flat file. Although some hosts may not allow you to write a flat file or write to a flat file database.

Also I don't believe the original was created taking into consideration multiple cities but I could be wrong. (Haven't checked.) You might want to incorporate settings to separate where each street is located. Otherwise you may end up with repetitive city streets throughout the game in each city.
« Last Edit: October 19, 2005, 10:12:13 PM by Twisted » Logged

Sig
Guest
« Reply #2 on: October 20, 2005, 11:48:51 AM »

Yeah I couldn't think of any real way to cut down on size...I guess I'll have to keep it this way.  As for the multiple cities, this isn't something I've really worked on much, although if you had the same streets in different cities, an add-on module could do it easily.  The thought didn't cross my mind because the city I usually play on does not use the multiple cities module.
Logged
brina
Guest
« Reply #3 on: November 16, 2005, 01:01:46 AM »

Hello Sig,
yesterday i have downloadet you mod for the streets and i think it is a good work. I have just one problem.

If i am in a street from streets plus, i go back to the village.php and there starts a villageevent, i dont get the villagenav. Just the nav from streets plus. What should i do?

Greets
Brina
Logged
ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #4 on: December 24, 2005, 11:41:36 AM »

found a problem with this and using village specials. when you get a village special, the street links still show in the special.
Logged

rbest320
Guest
« Reply #5 on: February 18, 2006, 08:19:14 AM »

I'm having a problem with getting the links to actually work. I have all the coding in and everything shows up as it is supposed to, but when you click a link you get a message "Page cannot be found"

what am I doing wrong? lol
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5479



View Profile WWW
« Reply #6 on: February 18, 2006, 08:38:04 AM »

We don't know...you haven't shown us what you're entering.
Logged

Play the latest beta version here on DragonPrime
rbest320
Guest
« Reply #7 on: February 18, 2006, 08:45:24 AM »

*blushes* Yeah, that might help. lol Here's an what I did for the second street.
Code:
"City 2 Text,title",
"c2text1"=>"Second Street Addnav 1 Text,text|MightyE's Weaponry",
"c2text2"=>"Second Street Addnav 2 Text,text|Pegasus Armor",
"c2text3"=>"Second Street Addnav 3 Text,text|Dycedarg's Academy",
"c2text4"=>"Second Street Addnav 4 Text,text|Battle Arena",
"c2text5"=>"Second Street Addnav 5 Text,text|The Gauntlet",
"c2text6"=>"Second Street Addnav 6 Text,text|Tynan's Gym",
"c2text7"=>"Second Street Addnav 7 Text,text|JCP's Hunter Lodge",
"c2text8"=>"Second Street Addnav 8 Text,text|",
"c2text9"=>"Second Street Addnav 9 Text,text|",
"c2text10"=>"Second Street Addnav 10 Text,text|",
"c2description"=>"Description of the Second City Street,textarea}",

"City 2 Links,title",
"c2link1"=>"Second Street Addnav 1 Link,text|weapons.php",
"c2link2"=>"Second Street Addnav 2 Link,text|armor.php",
"c2link3"=>"Second Street Addnav 3 Link,text|academy.php",
"c2link4"=>"Second Street Addnav 4 Link,text|battlearena.php",
"c2link5"=>"Second Street Addnav 5 Link,text|gauntlet.php",
"c2link6"=>"Second Street Addnav 6 Link,text|tynan.php",
"c2link7"=>"Second Street Addnav 7 Link,text|lodge.php",
"c2link8"=>"Second Street Addnav 8 Link,text|",
"c2link9"=>"Second Street Addnav 9 Link,text|",
"c2link10"=>"Second Street Addnav 10 Link,text|",

and this is the last section of the code
Code:
);
return $info;
}
function streetsplus_install(){module_addhook("header-village");module_addhook("header-forest");module_addhook("superuser");return true;}
function streetsplus_uninstall(){return true;}
function streetsplus_dohook($hookname, $args){
global $session;
switch($hookname){
case "header-forest";addnav('Heal');addnav('Fight');streetsplus_link(f);break;
case "header-village":
for($n = 1; $n <= 5; $n++){streetsplus_block('c'.$n);streetsplus_block('f'.$n);}
addnav('City Gates');
streetsplus_link(c);
break;
case "superuser":
if($session['user']['superuser'] & SU_EDIT_CONFIG){
addnav("Mechanics");
addnav("Streets Plus Configuration", "configuration.php?op=modulesettings&module=streetsplus");
}
break;
}
return $args;
}
function streetsplus_run(){
$op = httpget('op');
$num = httpget('num');
set_module_pref("seechat",1);
set_module_pref("seedesc",1);
set_module_pref("seelinks",1);
page_header(get_module_setting($op."name"));
rawoutput("<center><b>");
output("`3".get_module_setting($op.$num.'name')."`n");
rawoutput("</b></center>");
modulehook('streetsplusall');
modulehook($op.$num."street");
if(get_module_pref("seedesc"))output(get_module_setting($op.$num.'description')."`n`n");
if(get_module_pref("seelinks")){addnav(get_module_setting($op.$num."name"));streetsplus_add($op.$num);}
if(get_module_pref("seechat")) {
addcommentary();
commentdisplay("",$op."street$num","Speak",25,"says");
}
addnav("Return");
if($op == f) {addnav("F?Return to the Forest","forest.php");}else{addnav("V?Return to the Village","village.php");}
page_footer();
}
function streetsplus_link($abrv){
addnav(get_module_setting($abrv.'name'));
for($s = 1; $s <= 5; $s++){
if(get_module_setting($abrv.$s."bool") == 1){
addnav(get_module_setting($abrv.$s.'name'),"runmodule.php?module=streetsplus&op=".$abrv."&num=".$s);
}
}
}
function streetsplus_add($abrv){
for($d = 1; $d <= 10; $d++){
addnav(get_module_setting($abrv."text".$d),get_module_setting($abrv."link".$d));
}
}
function streetsplus_block($abrv){
if(get_module_setting($abrv."bool") == 1){
for($b = 1; $b <= 10; $b++){
if(get_module_setting($abrv."link".$b)!=null) blocknav(get_module_setting($abrv."link".$b));
}
}
}
?>
Logged
shadowblack
Guest
« Reply #8 on: February 18, 2006, 11:04:52 AM »

weapons.php, armor.php, and lodge.php are in the main game dir, but academy.php, battlearena.php, gauntlet.php and tynan.php are modules, and so are located in the modules dir. Could that be the source of your problem? I could be wrong, but I think the game is looking for them in the wrong palce, hense the "Page cannot be found".

If I remember correctly something I read somewhere (it was about Arcadia and a similar problem with links), instead of "academy.php" it should be "runmodule.php?module=academy".
« Last Edit: February 18, 2006, 11:12:29 AM by shadowblack » Logged
rbest320
Guest
« Reply #9 on: February 18, 2006, 02:29:54 PM »

ok, I tried that, and now this is the error message I am getting: Missing function (streetsplus_getmoduleinf o) 0.0
This is the revised code that I used

Code:
"c2link3"=>"Second Street Addnav 3 Link,text|"runmodule.php?module=academy",


Logged
DoomHound
Guest
« Reply #10 on: May 03, 2006, 05:07:21 PM »

I still got to learn PHP (I'm a real noob yet..)

What to put for the link? Do you have to use a part of the PHP file or something?
Logged
ShadowRaven
Mod God
*****
Offline Offline

Posts: 805


Silence is a virtue...


View Profile WWW
« Reply #11 on: May 03, 2006, 05:48:24 PM »

this tells you what you need to use:

http://dragonprime.net/index.php?topic=3092.msg33722#msg33722
Logged

DoomHound
Guest
« Reply #12 on: May 04, 2006, 04:02:00 AM »

I use this text: Dycedargs Academy
and this code: c2link3"=>"Second Street Addnav 3 Link,text|runmodule.php?module=academy

Same as for rbest, it showed me the ''not found'' page. When I use ''runmodule.php?module=academy'' as a link only, it at least shows me a game page (which is empty though). Could it be that there is something wrong in the first part? If you don't know, could anyone please take a look at his/her own code link and eventually copy/paste it here?
Logged
duena
Militia
**
Offline Offline

Posts: 85

Not knowing what shes doing


View Profile WWW
« Reply #13 on: May 04, 2006, 07:32:24 AM »

You would have to enter the whole link. You will see that if you just hold your mouse over the link given.

I guess in this case it would be " runmodule.php?module=academy&op=hall " otherwise it doesnt know where to lead you.
Logged

Der Kaffee muss heiss sein wie die Ksse eines Mdchens am ersten Tag, sss wie die Nchte in ihren Armen und schwarz wie die Flche ihrer Mutter, wenn sie es erfhrt.
DoomHound
Guest
« Reply #14 on: May 04, 2006, 10:24:06 AM »

Finally found the right code, thanks for the suggestion duena ^^

runmodule.php?module=academy&op=enter

This is the complete code.
« Last Edit: May 04, 2006, 10:30:27 AM by DoomHound » Logged
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

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