apocist / eMafiaServer

GNU General Public License v3.0
0 stars 1 forks source link

Implement Role Options #4

Open apocist opened 10 years ago

apocist commented 10 years ago

Need to add the function of Role options. Essentially Role options would be the creation of a variety of fields to change how a Role can perform during the scripting process. Examples would include "Sheriff can detect Serial Kill = ON" or "Vig has number of kills = 3".

These conditions are required for Role options: Role option must be storable on database Must to customizable to allow description of the Option as well as the user changeable variable Role option must be changeable during Match setup Role option must be accessible throughout the Match

extermistmonk commented 10 years ago

If the roles are in Javascript wouldn't it be significantly simpler to have the options themselves be implemented in Javascript by role scripters?

apocist commented 10 years ago

It would be a lot simpler to just allow the options to be coded into the role through JavaScript, but to allow those options to be altered by the users setting up a Match through the client is the questionable factor I've been pondering over.

extermistmonk commented 10 years ago

While it's a bit hacky, you could have some sort of tag in comments that instructs the client to present the variable as a host option, then directly manipulate the javascript string based off of the option the user picks. For instance, var numKills = 3; //@hostoption int Number of nightkills allowed The client (or server, depending on how the architecture is set up) would have to parse the string and look for any @hostoption tags, and use the supplied type (int), flavour text (Number of nightkills allowed) and default value (3) to present to the user. Then use string replacement shit to replace the tag with the supplied value before feeding it to rhino