DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • September 05, 2010, 08:11:44 PM
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: Problem with Seth  (Read 1674 times)
0 Members and 1 Guest are viewing this topic.
Zach
Guest
« on: February 03, 2005, 01:16:58 PM »

I started the conversion of Seth's songs into a module, was just about done with it and started getting an errror. The error says that there is an unexpected string on line 67 (the one that says
If($session['user']['seenbard']) ). I've got no idea why. Any help would be good.

Here's the link:
http://dragonprime.net/users/Zach/seth.txt
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: February 03, 2005, 02:15:39 PM »

Well, somethings to point out.

1) Since this is a module, and wouldn't be core code anymore, you might wish to set all of the inn part, into the run for the module, and the inn dohook, just provides a link to said run.

2) You do provide the link for it, but having all of the inn commands in the dohook, is just bad coding. Since it doesn't direct anywhere.

3) Line 217, that belongs in the run part of the module, thus refer to point 1.

All in all, this module needs to be COMPLETELY worked around. Use the points I provided, and you should be fine.
« Last Edit: February 03, 2005, 02:17:41 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Zach
Guest
« Reply #2 on: February 03, 2005, 06:25:43 PM »

Yeah that was bad. That's what I get for trying to code at 5 in the morning after running Deimos' stupid self to the ER with a sprained ankle. Fixed that stuff, but it still doesn't fix my original problem. I loaded the new one, same link.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #3 on: February 03, 2005, 06:57:42 PM »

Found your problem.

In the top, you have:
Code:
require_once('lib/http.php");
Which should be:
Code:
require_once("lib/http.php");

If you open with ', close with '. Same for "
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Zach
Guest
« Reply #4 on: February 03, 2005, 06:58:12 PM »

Yeah that's why I put it up on here. I tried everything I could think of and still get nothing.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #5 on: February 03, 2005, 07:00:37 PM »

Yeah that's why I put it up on here. I tried everything I could think of and still get nothing.

I took the liberty of doing some things with the settings. Feel free to change them if you like.

Here ya go, a nice working mod. ^_^ http://dragonprime.net/users/Sichae/seth.txt
« Last Edit: February 03, 2005, 07:01:27 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Zach
Guest
« Reply #6 on: February 03, 2005, 08:12:24 PM »

Wow. How'd I manage that? I guess it was that whole 5 am thing. Thanks Sichae.

Note: Having fixed the problem, I've removed the module until it is finished.
« Last Edit: February 03, 2005, 09:00:46 PM by Zach » Logged
Azrael
Guest
« Reply #7 on: February 03, 2005, 09:20:55 PM »

Wow. How'd I manage that? I guess it was that whole 5 am thing. Thanks Sichae.

Note: Having fixed the problem, I've removed the module until it is finished.

Greetings,

I really suck at coding so I might have missed something, but your case statement
for 18, is it actually removing the charm point?

Regards,

Azrael
LoTGD.CA
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #8 on: February 04, 2005, 04:44:58 AM »

Yes, ++ and -- work as increment and decrement by one.

You could also do:
Code:
$session['user']['charm']-=1;
And it would still have the same effect as --.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Azrael
Guest
« Reply #9 on: February 04, 2005, 09:13:19 AM »

Yes, ++ and -- work as increment and decrement by one.

You could also do:
Code:
$session['user']['charm']-=1;
And it would still have the same effect as --.

Sorry,

What I should have been saying, I am trying to understand the scripting engine behind this.  Do you not make a user loose a charm point if even they have a negative charm value?  I thought the decrement was before the if clause.

Regards,

Azrael
LoTGD.CA
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #10 on: February 04, 2005, 09:36:14 AM »

PHP runs in order that it is put in. So, since it goes:
Code:
case 18:
            output("`0Seth stares at you thoughtfully, obviously rapidly composing an epic poem...`n`n`^U-G-L-Y, You ain't got no alibi -- you ugly, yeah yeah, you ugly!");
            $session['user']['charm']--;
            if ($session['user']['charm']<0){
               output("`n`n`0If you had any charm, you'd have been offended, instead, Seth breaks a lute string.");
            }else{
               output("`n`n`0Depressed, you lose a charm point.");
            }
            break;
It runs the take away, after how it gets taken. Then, it checks if it is below 0, if so, then it states that.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Booger
Captain of the Guard
***
Offline Offline

Posts: 126


I'm a llama!


View Profile
« Reply #11 on: February 04, 2005, 11:28:05 AM »

yeah, but you lose the charm point anyway.. it should probably be like this:

Code:
case 18:
            output("`0Seth stares at you thoughtfully, obviously rapidly composing an epic poem...`n`n`^U-G-L-Y, You ain't got no alibi -- you ugly, yeah yeah, you ugly!");
            if ($session['user']['charm']<=0){
               output("`n`n`0If you had any charm, you'd have been offended, instead, Seth breaks a lute string.");
            }else{
               $session['user']['charm']--;
               output("`n`n`0Depressed, you lose a charm point.");
            }
            break;
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5223



View Profile WWW
« Reply #12 on: February 04, 2005, 11:40:11 AM »

I believe it's possible to go into negative charm.  Seth checks for -3 to 0 charm, from what I can recall.
Logged

Play the latest beta version here on DragonPrime
Azrael
Guest
« Reply #13 on: February 04, 2005, 11:58:57 AM »

yeah, but you lose the charm point anyway.. it should probably be like this:

Code:
case 18:
            output("`0Seth stares at you thoughtfully, obviously rapidly composing an epic poem...`n`n`^U-G-L-Y, You ain't got no alibi -- you ugly, yeah yeah, you ugly!");
            if ($session['user']['charm']<=0){
               output("`n`n`0If you had any charm, you'd have been offended, instead, Seth breaks a lute string.");
            }else{
               $session['user']['charm']--;
               output("`n`n`0Depressed, you lose a charm point.");
            }
            break;

Greetings,

That was my thought exactly Smiley

Regards,

Azrael
LoTGD.CA
Logged
Zach
Guest
« Reply #14 on: February 04, 2005, 12:10:53 PM »

For exactly why it's coded that way you'll have to ask MightyE himself. The only part of the code that I actually changed was to add settings. Everything else was Eric.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

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