Drops code (this could potentially get messy)

Submit code for osProse project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Re: Drops code (this could potentially get messy)

Postby Drakia on Sat May 31, 2008 7:58 pm

Hey, Purple, I was just messing around on a test server (Working on some quest stuff, break from skills) and I noticed that Choropy's are dropping 4 choropy summons at a time... is that normal? o.O
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Drops code (this could potentially get messy)

Postby PurpleYouko on Sun Jun 01, 2008 3:27 pm

Pet drops are currently treated just like any regular type 10 items.
They get a random number from 1 to 6 which is then modified by a factor based on your charm.
In some cases such as skill books, i have built in a limit to make the drop amount 1.
We probably need to apply a similar limit to pets. Should be very easy to add.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Drops code (this could potentially get messy)

Postby Drakia on Sun Jun 01, 2008 7:04 pm

Ah, ok that makes sense, it was just weird that the two times I got the pet drop, I got 4 at a time.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Drops code (this could potentially get messy)

Postby Blah4 on Sun Jun 01, 2008 7:47 pm

Shouldn't food drop one at the time as well?
Blah4
ospRose dev team
ospRose dev team
 
Posts: 199
Joined: Sun Jan 06, 2008 12:05 pm
Location: The Netherlands

Re: Drops code (this could potentially get messy)

Postby PurpleYouko on Sun Jun 01, 2008 8:09 pm

I'm pretty sure food items used to drop in larger quantities than 1 but i could be wrong i guess.
If they don't then it would really mean limiting all type 10 items to 1
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Drops code (this could potentially get messy)

Postby Axirc on Tue Jul 01, 2008 10:58 am

Hey i have done everything on this tutorial but i seem to be getting a SIGSEGV from worldserver? What could be causing this?
Axirc
Jelly Bean
Jelly Bean
 
Posts: 10
Joined: Sat Jun 21, 2008 10:14 pm

Re: Drops code (this could potentially get messy)

Postby PurpleYouko on Tue Jul 01, 2008 2:26 pm

SIGSEGVs are a pain.
They are usually (but not always) associated with arrays or vector lists. very similar to the old "Subscript out of range" error that you can get with most BASIC languages.
Basically, something you are doing is attempting to read or write a non existent memory location.

As for the cause? It depends a lot on when the error occurs. is it at the startup? or when an item is dropped.
The best way to figure out what is going on is to add debug outputs at various places to see where the code is really going.
Debug mode in the server is not always helpful so I prefer to do it with output code.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Drops code (this could potentially get messy)

Postby Axirc on Tue Jul 01, 2008 2:51 pm

It at startup. As i click Login, Char, World server it comes up. Iv had a look around and still can't find the problem. What do you think? Is there anyway to sort it or shall i just leave the code out for now? I'm rev 80 and v193 Rose with the latest CSV's which did work before i placed the code.
Axirc
Jelly Bean
Jelly Bean
 
Posts: 10
Joined: Sat Jun 21, 2008 10:14 pm

Re: Drops code (this could potentially get messy)

Postby PurpleYouko on Tue Jul 01, 2008 3:07 pm

So it happens when you log in?
That's not what i consider at "startup"
What i meant by that was whether the worldserver actually started up correctly. By the sounds of it, it does.
That means the error is being caused by something related to your character data and not directly to the drops data.

None of the drops code should be initiated unless you kill something so i wonder if you have broken something else while putting the drops stuff in place.

There must be a way to sort it out. It is just a case of finding where the error is happening.
What i like to do is add code such as this
  1. Log( MSG_DEBUG, "Player Data Loaded Correctly" );

I would put this line right at the end of function "loaddata()" in Playerdata.cpp, just before the return;
This will output the message to your server so that when it crashes, you can take a look at your server console before acknowledging the error. If the output is there then you know it got at least that far. Now you step through to the next bit of code and put a new debug line in.
If not then backtrack a bit. Add a debug line somewhere else and try again.
It can be a long process trying to find this kind of error.
If you feel up to it, give it a try. If not then just back the code out and use the normal drops.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Drops code (this could potentially get messy)

Postby Axirc on Tue Jul 01, 2008 3:11 pm

I ment to say was it comes up in the worldserver black box window, Then the sever closes down. I can't actually get the game up or nothing. As the server won't loads.

I shall redo the entire code as i have backed up my Server files, I'll try it again and see if it says the same if so i shall just leave it for now.
Axirc
Jelly Bean
Jelly Bean
 
Posts: 10
Joined: Sat Jun 21, 2008 10:14 pm

PreviousNext

Return to Submit Code

Who is online

Users browsing this forum: No registered users and 3 guests