Register for your free account! | Forgot your password?

You last visited: Today at 03:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[FAQ] HellmouthSource

Discussion on [FAQ] HellmouthSource within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old   #1
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
[FAQ] HellmouthSource

So I'm posting this preemptively cause I just know I'm going to be slammed with questions.

Where do I get the source? I WANT MONK!!!!

A: If you haven't already downloaded the source, you can get it from

I'm confused! I've never set up a source before!!!!

A: Angelius was nice enough to post a video of how to set up the source. You can find the video in the spoiler below

NOTE: To edit the source you MUST open the project file using visual studio 2010. Yes, you can configure the database just from the settings file like he did but anything past that you NEED visual studio/other C# compiler installed.


I get an error when I try to run the database backup

A: The backup works perfectly fine, simply ensure you have innodb activated (IF YOU USE APPSERVER AND GET THIS, RE INSTALL IT AND THIS TIME TICK THE BOX THAT SAYS ENABLE INNODB!). I'd suggest xampp or the official mysql server from the mysql website.

I need a client!

Download one from the official conquer website... or someone who played my server uploaded this one to megaupload... I assume it works.



Mobs aren't working! How do I add monsters?!?!?!?!?!?!?

The monster system IS NOT CODED IN THIS SOURCE. I've gotten so many msgs about this... I try to explain it and they go "so can I copy from lotf???" or something along those lines or just try to get me to add it for them.

To put it bluntly... Monsters (done correctly) can be the most complex system of your server to do right! Handling monster ai/movements/death/re spawning/drops and such is something you have to handle CAREFULLY or else you will run into all sorts of issues.

I will NOT code the system for you...

I do NOT recommend trying to use lotf's mob system... not good.

-Info on the monster system/what is loaded

Npcs aren't working! Help!
A: Most are not coded. I was leaving that for other people to do. There are two ways to edit/add npcs!

-Expand for more information on npc scripting.



How do I Create an account!?

A: By default the source creates accounts when you first try to log in with an unknown username. Alternatively open up navicat or your favorite sql management program and open the accounts table and enter a username/password. Everything else should work all by itself. Now simply log in.

-Expand for information on removing the auto account creation

Once that is done users MUST have an account already made to log in.

How do I make Gm/Pm?

A: Permission field in the accounts table (255 = banned, 1 = normal user. I was using like 6 as full permission but just look at the commands file to find what permission you really want to assign people.


Guilds/Mentor/friends/etc is not working!! HELP

A: They are not coded... log packets and write it yourself. Most of it is quite simple so shouldn't be too hard to add.

Skill X doesn't work!

A: many skills are not coded... Mostly lazyness on my part but they are not too hard to add. The only targeting method not added currently is arc attacks I think... Line, LineW/Target, AOE and single attacks are all added.

-Expand for information on where spell type stuff is stored!

What are the cmds/How do I make items/Etc

A: Commands are all located in Handler/Commands.cs

They are sorted into permission type (I never bothered writing out a full system but w/e!)

You can find all the stuff you need there including how to structure things like item cmd

/item ID + - Enchant Gem1 Gem2

There's a decrypted itemtype in the bin folder (items.txt)


How do I change starting items/make non bound

A: By default the source is using the "public void ChangeProff(byte Proff)" method in the client class to handle all starting items/statistics. It's using the "public void StartingItem(uint ID, byte Gem1 = 0, byte Gem2 = 0, byte Location = 0)" method to handle awarding the starting items. If you look in the startingitem code, by default the items have a bless value of 3, are bound and have +5. You can change that however you want quite easily.

Items gained from npcs and from the /item cmd are NOT bound. It was only the starting items cause I didn't want people trying to farm them for composition or w/e.

Console keeps saying general Data 76!

A: Split up the request skills/request proff general datas... I thought I'd done this before but apparently not.

pro4never is offline  
Thanks
32 Users
Old 03/07/2011, 19:46   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
#RESERVED


I plan on expanding on things as I go... this one post may look short but expand things and you'll realize it doesn't have much room left. Simplest way is just me reserving another post right now to help where I can.


If you have any questions, please post them here and I'll add them to the faq as soon as possible including any possible examples and code snippets.


I still don't understand npcs!!!

A:

This will serve as a full guide to coding npcs in EXTERNAL NPC SCRIPTS!!

Step 1: Add the npc to the server!

You can do this from the database itself but there's a simpler way! COMMANDS!

For those of you who actually bothered to read the commands in the source you would have noticed there is an /addnpc command. You MUST be a gm to use these commands (open the accounts table and set permission to like 5 or something.)

Reading through this command we see we have 3 values to enter...

The Npc ID (script number)
The Npc Mesh (the look of the npc)
The Npc Name (the name of it! *duh*)

So we can do /addnpc ID Mesh Name

But what if we don't know mesh numbers?

Well. There's a command for that too!

/npc Mesh

Will spawn a npc of mesh of our choice where we are located.

NOTE: for those who don't know.. the last digit = direction (IE: 10-19 are same npc... they just change direction)


For this example we'll do... /addnpc 1337 2697 ElitePVPers

So now that we have our npc placed via our cmd we need to create a script! (Notice it shows instantly and is instantly usable but has no script. There is no need to ever restart server in this example!)



(yes... I enabled mobs on mine, deal with it :P)

So... lets go to our debug/npcs folder!

You should see lots of different external scripts in here (notepad works fine for editing, they are plain text). Try opening one and look around if you want.

Lets create our own 1337.npc file using notepad or by copy/pasting an existing npc and renaming the ID.

Lets now paste this text into it for our first simple test.

Code:
def npc(Client, Option):
    if(Option == 0):
        Text("This is a blank npc which we can now code any way we like!")
        Link("Cool", 255)
        Finish()
    return 0
Save the file and click the npc again



OOH MY GOD IT TALKS!

There's no reason to need to re-compile the server or anything like that. They work instantly which lets you keep your server running while you fix any bugs in the npc and you still have full access to your character attributes.


So lets go over some main differences in python...

Instead of brackets we will be using tabs to indicate what goes with what (keep sections of code together essentially)

Instead of && / || or w/e we will be using actual words so like...

if (Client.Level > 120 and Client.Level < 130):

Further note that... if statements are different. After the if you MUST place a colon (':')

The statements instead of flowing as

if
else if
else

are now

if
elif
else

It's simple changes but could save you some problems with debugging.


Now, lets write our npc to be a bit more advanced... how about we have it tell us our level and then if over level 120 ask us if we want a free dragon ball?

Here's the full code I'd use personally... Try to break it down and learn from it

Code:
def npc(Client, Option):
    if(Option == 0):
        Text("Hey there " + Client.Name + " you are level " + str(Client.Level)+" ")
        if(Client.Level > 120):
            Text("This makes you able to get free db's! Would you like one?")
            Link("Yes Please", 1)
            Link("No thanks", 255)
        else:
            Text("Come back when over 120 to get free dragonballs!")
            Link("I'll be back", 255)
        Finish()
    if(Option == 1):
        if(Client.Inventory.Count < 40):
            Client.AddItem(1088000)
            Text("Check your inventory! You have your free db!")
        else:  
            Text("You do not have enough inventory space!")
        Link("Thanks", 255)
        Finish()
    return 0

[GIANT WARNING]

These python scripts are picky with a few different things you may not be used to!

YOU MUST DO ALL SPACING USING ACTUAL SPACES! 5 SPACES PER INDENTATION. IF YOU DO NOT LIKE THIS THEN USE A PYTHON EDITOR SUCH AS IDLE WHICH DOES IT FOR YOU

YOU MUST CAST ALL NON STRINGS TO STRINGS WHEN PRINTING OUT IN TEXT!

Eg: if you tried to use...
Text("you are level " + Client.Level)

you will get an error.

You must use

Text("you are level " + str(Client.Level))

This is because python, unlike C# does not immediately consider it a string so in this case it's trying to do a mathematical addition vs a string addition. This will obviously cause a problem (think about it... if I said "add 'yes' and 1 and give me the answer", chances are you'd ask me what yes was... is it a number? am I just saying 'yes1', etc.

Yes, python scripts will take a bit of getting used to but they are really cool once you get the hang of them.

*cough* IDLE can be downloaded from the python website... there is also some AWESOME documentation/guides on there.



Mini guide to using Idle:

pro4never is offline  
Thanks
12 Users
Old 03/07/2011, 20:13   #3
 
elite*gold: 0
Join Date: Dec 2010
Posts: 85
Received Thanks: 0
is it possible to make something like a NPCDialog.cs because Im used to that >< and I dont know how to implent it :P
your way of adding NPC's is kinda diffrent than im used to.


thanks
HackProvider is offline  
Old 03/07/2011, 20:24   #4
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
there is a npctalk.cs that you can code npcs using c# in the handler folder
BioHazarxPaul is offline  
Old 03/07/2011, 20:25   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by HackProvider View Post
is it possible to make something like a NPCDialog.cs because Im used to that >< and I dont know how to implent it :P
your way of adding NPC's is kinda diffrent than im used to.


thanks
I suggest you read the section of the thread on npcs... You can already do it both ways.
pro4never is offline  
Old 03/07/2011, 20:29   #6
 
elite*gold: 0
Join Date: Dec 2010
Posts: 85
Received Thanks: 0
and how much do you want for some features ??

But I mean I can't add my old NPC coded in that newestcoserver NPCDialog right?

with # alex
case 23423:
additem blabla

#endregion
HackProvider is offline  
Old 03/07/2011, 20:41   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by HackProvider View Post
But I mean I can't add my old NPC coded in that newestcoserver NPCDialog right?

with # alex
case 23423:
additem blabla

#endregion
Depends what feature it is.

Yes, yes you can.

Example npc from npctalk.cs


Code:
 case 50023:
                        {
                            switch (LinkBack)
                            {
                                case 0:
                                    if (Program.CTF == null || Program.CTF.Red.Members.Count > 0)
                                    {
                                        Text("Capture the flag is not currently running. Check back soon", Client);
                                        Link("Awww", 255, Client);
                                        Finish(Client);

                                    }
                                    else
                                    {
                                        Text("Capture the flag is about to start! would you like to enter the waiting area?", Client);
                                        Link("Yes Please", 9, Client);
                                        Link("No Thanks", 255, Client);
                                        Finish(Client);
                                    }
                                    return;
                                case 9:
                                    if (Program.CTF != null)
                                    {
                                        Teleport(Client, 53, 64, 1616);
                                    }
                                    return;
                            }
                        }
                        return;
pro4never is offline  
Thanks
1 User
Old 03/07/2011, 20:48   #8
 
elite*gold: 0
Join Date: Dec 2010
Posts: 85
Received Thanks: 0
2 more questions, Why did you release it? and why did you quit your p-server

and you said you would sell features,( create ) could you gimme an example how much you want..

thanks
HackProvider is offline  
Old 03/07/2011, 21:12   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
I released it to try to move people away from lotf.


The project is not quit. We are simply writing a newer/far better source that we can code things properly from the start. Me and saint were working on the base lastnight actually.


As for selling features it really depends on how much time it takes me.

For example if you wanted a few skills added... maybe broadcast... IE: fairly basic stuff like 25-50 bux but if it was some large system like the new guild system, full monsters system then it would be quite a bit cause it would take a good chunk of my time to do properly. In the case of very large features I'd probably just refuse cause I don't have quite that level of free time.
pro4never is offline  
Old 03/07/2011, 21:16   #10
 
elite*gold: 0
Join Date: Dec 2010
Posts: 85
Received Thanks: 0
But this source is stable right? so I could use it , and expand it :P do you guys need more members in your team?

thanks
HackProvider is offline  
Old 03/07/2011, 21:37   #11
 
elite*gold: 0
Join Date: Feb 2011
Posts: 14
Received Thanks: 1
gOOD tHANK yOU gOOD sOURCE tHANKS fOR sHARE =D!!!
co-mex is offline  
Old 03/07/2011, 21:38   #12
 
Iron~Man's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
I have only one question, Why you released this?
Iron~Man is offline  
Old 03/07/2011, 22:09   #13
 
{ Angelius }'s Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 991
Received Thanks: 1,107
Quote:
Originally Posted by Iron~Man View Post
I have only one question, Why you released this?
lol stop being noisey

its already out there take it or leave it :P
{ Angelius } is offline  
Old 03/07/2011, 22:34   #14

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
Quote:
Originally Posted by Iron~Man View Post
I have only one question, Why you released this?
Read? He answered it, he said that it was to let people move from LOTF and he had no use for it anyway.
Kiyono is offline  
Old 03/08/2011, 01:04   #15
 
elite*gold: 0
Join Date: Jan 2011
Posts: 41
Received Thanks: 6
Well i have only 17 errors and 11 warnings when i build the source
The 17 errors are all the same "Default parameter specifiers are not permitted" in client.cs the warnings are different just check the spoiler for the warnings.

ßøøm is offline  
Closed Thread




All times are GMT +2. The time now is 03:31.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.