Register for your free account! | Forgot your password?

You last visited: Today at 19:25

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


[Release] Redux FB/SS Event

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2006
Posts: 406
Received Thanks: 42
[Release] Redux FB/SS Event

Hello mates, Good Day,
Since no one has releasing any event of the Redux
I am here to release it.
but it's not the same way code by Pro4never
he use some virtual I guess. and override it
and Credits goes to Pro4Never:

First thing is to add mapID and canCast ScentSword / FastBlade only.


Next

Go to Event: Add classfile.

My NPC

Let's set the time



Soulfly25 is offline  
Thanks
3 Users
Old 12/28/2015, 08:31   #2
 
elite*gold: 0
Join Date: Jul 2014
Posts: 402
Received Thanks: 534
Seriously, this is garbage.


Best Coder 2014 is offline  
Thanks
2 Users
Old 12/28/2015, 11:02   #3
 
elite*gold: 0
Join Date: Mar 2006
Posts: 406
Received Thanks: 42
yeah same to your face!
Soulfly25 is offline  
Thanks
2 Users
Old 12/28/2015, 16:25   #4
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,500
Received Thanks: 573
Best Coder 2014 is right. Most of those checks are redundant if you simple check it at the skill packet receive


turk55 is offline  
Old 12/28/2015, 18:06   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
I want to be up front and say I'm always happy to see stuff being released and people who are doing their best to learn and get feedback. That eing said there's a lot of concerns I have with this.

#1: Don't re-write everything 500000 times. Create a base event class which you can inherit from to modify the logic of each event you want to create. You'll save SO much time and have much easier to understand code if you go with that approach.

Even if it's something basic like

IsValidTarget(attacker, attacked)
IsValidSkill(skill)
OnDamage(attacker, attacked, ref damage)
OnKill(attacker, attacked)
AwardPlayer(player, rank)


Write up some basic logic but then each event can override how each works (fb/ss only event? Check if it's fb/ss in the OnSkill and return true/false. Super simple stuff)

#2: Combat related code can be a LOT simpler.... You always want to exit as soon as possible to avoid wasting cpu cycles on something that will not be relevant. This means you should do things like check if a skill can be used in the event you're part of as SOON as you know what skill ID is being used and who is casting it

EG:

if(attacker.Event != null && !attacker.Event.IsValidSkill(skill))
{
attacker.SendMessage("You cannot cast " + skill.Name + " in this event!");
return;
}

#3: Always try to keep each function only handling what its name implies.

This is more nitpicky I suppose but becomes more and more important as you develop larger projects.

In your example code you have all of the event logic running inside of ReceiveDamage but the more things like that you do the harder it will be to grasp exactly what that method involves doing.

Ideally when designing a method you should have one entry point and one exit point (avoid having multiple return statements. Sometimes it's simpler that way but it's generally considered poor form) and each method should do ONLY one job. You can call as many other methods as you wish from it but you wouldn't want a method that's called CountPlayers ending up counting players, spitting out all their names and sending them each a message... Even if you wanted a method to do those 3 things (and it was labeled something that made sense for that task such as... UpdatePlayerScores) you would generally want each bit of logic to be its own function for maximum readability and maintainability in the future.



</rant> I have barely slept so I'm sure a lot of that post makes no sense but here's my tl; dr

Good work on improving your coding skills, contributing to the community and releasing something I'm sure a lot of people will find useful.

That being said you definitely should continue working on your core programming knowledge to avoid making un-necessary design mistakes and to make things easier on yourself in the future.

For those looking to USE this... it should work but it's going to be a lot more work than it should be and will lead you down a road you shouldn't follow when designing a server that you expect to have a bunch of events. If you just want it to point you towards where some of these checks can be placed or to introduce you to how the source works then more power to you all
pro4never is offline  
Thanks
2 Users
Old 12/29/2015, 03:40   #6
 
elite*gold: 0
Join Date: Mar 2006
Posts: 406
Received Thanks: 42
Thanks Pro4never for the good advice. Actually this is not the finally of my work I just study all the function of the skills combat etc. so that I can easily understand working on overriding to make it more simple

Btw, Thanks for the advice you give me some ideas.
Soulfly25 is offline  
Old 01/13/2016, 11:34   #7
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,609
Received Thanks: 829
Seriously is this copied from my old old old LOTF edit?
Super Aids is offline  
Old 01/13/2016, 12:41   #8
 
elite*gold: 0
Join Date: Mar 2006
Posts: 406
Received Thanks: 42
Quote:
Originally Posted by Super Aids View Post
Seriously is this copied from my old old old LOTF edit?
no sir. You can ask pro4never on this. he own the source.
Soulfly25 is offline  
Old 01/13/2016, 20:09   #9
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,988
Received Thanks: 3,340
Quote:
Originally Posted by Soulfly25 View Post
no sir. You can ask pro4never on this. he own the source.
He means the code you posted, not Chris's source code. Also, since copy-pasting is on the table of discussion, having "Copy - Paste is Learning" in your signature really makes me what to believe absolutely nothing you say.
Spirited is offline  
Old 01/15/2016, 06:34   #10
 
elite*gold: 0
Join Date: Mar 2006
Posts: 406
Received Thanks: 42
Quote:
Originally Posted by Spirited View Post
He means the code you posted, not Chris's source code. Also, since copy-pasting is on the table of discussion, having "Copy - Paste is Learning" in your signature really makes me what to believe absolutely nothing you say.
Ahh I see. Maybe right maybe not. What LOFT source is that?
Soulfly25 is offline  
Old 06/19/2017, 05:17   #11
 
elite*gold: 0
Join Date: Apr 2011
Posts: 3
Received Thanks: 0
where i do add npc scprit i did add but now see thi script how do that ?
faziq is offline  
Old 04/18/2018, 18:53   #12
 
elite*gold: 0
Join Date: Jun 2017
Posts: 6
Received Thanks: 0
Soulfly25 send me a private message with your skype ID to talk there because I could not the private message that i've sent you just 2 hours ago. Thank you !
em0tions is offline  
Old 05/09/2018, 19:43   #13
 
elite*gold: 0
Join Date: Jun 2007
Posts: 2
Received Thanks: 0


whats wrong?
bohy55 is offline  
Old 05/09/2018, 21:22   #14
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,988
Received Thanks: 3,340
Quote:
Originally Posted by bohy55 View Post


whats wrong?
Besides your picture being too small to read? I don't know. I see red squiggles. Maybe fix your code to compile?
Spirited is offline  
Thanks
1 User
Old 07/21/2018, 00:16   #15
 
elite*gold: 0
Join Date: May 2017
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by Soulfly25 View Post
Hello mates, Good Day,
Since no one has releasing any event of the Redux
I am here to release it.
but it's not the same way code by Pro4never
he use some virtual I guess. and override it
and Credits goes to Pro4Never:

First thing is to add mapID and canCast ScentSword / FastBlade only.


Next

Go to Event: Add classfile.

My NPC

Let's set the time

no time the variables below are used.
someone help me.

Quote:
ToTalkills
FFA_Signed
DailyPK_Kills

Quote:
see the image:




luizinhofox is offline  
Reply



« FCQMap_Convertor [CandyConquer] | [Releases]Source Veterans 5165 Classic ! »

Similar Threads
[Learning Redux] Video Guides To Using Redux
06/20/2018 - CO2 PServer Guides & Releases - 38 Replies
So I know jumping into a new source can be scary and it's not something everyone wants to do, especially if they have a lot of content running already under something else (looking at you NCOS based servers!). These videos are designed to help...
[Release] Redux registration form (PHP)
11/30/2016 - CO2 PServer Guides & Releases - 30 Replies
Simple registration form for Redux Is it MVC? No I want to add/remove fields, how do I do that? Add/Remove fields in index.php --- In "includes\models\Account.php" Add/Remove the properties,
[Redux] add SS/FB Event.
11/14/2015 - CO2 PServer - Discussions / Questions - 1 Replies
Can anyone help me how to make SS/FB Event in Redux Source. I have an event here which is DailyPK which is mujake post it. so if anyone have it. It would be nice. :D:D:D:D:D



All times are GMT +2. The time now is 19:25.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.