Welcome to the Builder Academy

Question adding new code

More
22 Aug 2012 19:20 #727 by wifidi
adding new code was created by wifidi
To coders or whom it may concern,

Is there an expected way to add code or does success suffice (barring significant inefficiency)? For example, to add a repel ability for a Jedi character class or as a spell for mages, that repels other players or monsters from the room, is it simply a matter of locating where to slap-on code and slapping it on, or must a coder attempt to make it as extensible as possible, e.g., assignable to the opening of a container, door, etc.?

I'd like to see people take a crack at coding the same idea and post it. It almost seems like a duty to program an idea to its utmost rather than plinking it in for one case, yet logical extension possibly allows overimplentation instead of the originality of its initial creative form. Implementing a case v. implementing any case seems like something that seperates the hackers from the real programmers.

Sincerely,
wifidi

Please Log in or Create an account to join the conversation.

More
22 Aug 2012 22:40 #728 by rudeboyrave
Replied by rudeboyrave on topic Re: adding new code
www.circlemud.org/pub/CircleMUD/contrib/code/commands/push.txt

here is a link for the old do_push snippet. It allows a player to push another (or a mob) in a direction and they would move that way. I think it might be helpful seeing that it pretty much does what you are asking for. (moves a mob out of a room)

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
22 Aug 2012 23:49 #731 by Vatiken
Replied by Vatiken on topic Re: adding new code
There is a discernible difference between adding a hack in the code vs doing a proper implementation of some sort of functionality. However, due to the constraints of both time and skill, somethings that could be done properly end up as simple hacks. In a previous thread the topic of adding rooms to the world was discussed, and within the code there is an add_room() function, and it is a major hack as the proper way of implementing an add_room() functionality would of been a total reconstruction of how tbaMUD/CircleMUD handles rooms to properly allow for easy ins and outs of new locations. That said, that's a major overhaul and the VNUM system (along with combat) are the core mechanics of the DIKU system, so it makes little sense to do more then a hack when so much code would have to be changed to meet the goal.

For your example though, tbaMUD's spell system is designed to accommodate both generic (Damage, Affect, Group ...) spells and manual spells. So adding something above and beyond the generics and easily be done by creating a manual spell ("ASPELL()") such as was done with SPELL_LOCATE_OBJECT and SPELL_IDENTIFY.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
23 Aug 2012 05:23 #732 by zusuk
Replied by zusuk on topic Re: adding new code
Hey:

My coding efforts are usually motivated (unfortunately) by two driving forces:

1) To meet my goals in a timely manner

2) Impatience with implementing code in a way that is different than is comfortable for my current skill level.

(i.e. basically what our resident expert said) That drives like 90% of my work. That being said, the 10% of coding I get to do that isn't driven by those two factors, always ends up as the code I am proud of and I wouldn't mind sharing with the world.

That being said, to answer the more direct question about the "Star Wars Force Push" and how I would handle it:

1) I personally never have any hesitation at looking at/being inspire by/or directly throwing-in snippets, just as long as good "crediting" habits are part of your nature (which I take person pride in).

2) I would implement the push a player aspect really fast and easy, to make sure I meet the quick goal, and if time allowed, I would upgrade it later to push players/objects/doors/etc

Although -never- put off documentation! :) It'll come to haunt you later.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 0.181 seconds