D1st0rt wrote: |
Wow, I thought I there was only one other person that played this game in Blacksburg...
This looks interesting btw, I don't suppose I could convince you to switch to either TWCore or ASSS eh? |
CypherJF wrote: |
I had this idea too so glad someone else had the time to develop this type of application! |
D1st0rt wrote: |
I'm a sophomore CS minor (majoring in mechanical)
I can't currently think of an easy way to swap out APIs, following conventions in each core would probably require a complete code generator for each. |
tansey wrote: |
[..]
... Nice Gosling quote btw. =) |
Cerium wrote: |
Neat project. If you really want to help the non-developers, look at the trigger system in Blizzard's RTS games. If you implemented something like that... damn. |
Cerium wrote: |
Neat project. If you really want to help the non-developers, look at the trigger system in Blizzard's RTS games. If you implemented something like that... damn. |
Cerium wrote: |
Neat project. If you really want to help the non-developers, look at the trigger system in Blizzard's RTS games. If you implemented something like that... damn. |
CypherJF wrote: |
[..]
Blizzard maps/triggers were pretty sweet back in Starcraft/Warcraft. Haven't played anything new lately from them. |
Animate Dreams wrote: |
[..]
New? The only thing Blizzard has done since then is World of Warcraft. |
tansey wrote: |
[..]
Link? |
Samapico wrote: |
im guessing in the case of asss this could all be converted to region code? |
Cerium wrote: |
The key here is that each "trigger" could have multiple actions/reactions. It was a very simplistic system that everyone could adapt to quickly without any programming experience, but could still make powerful maps and subevents. |
Cerium wrote: |
Some examples that could be good for SS (The underlined text represents sub-options the user would select after choosing the action/reaction):
any player enters region region1 -> grant prize fullcharge to active player Timer timer1 reaches 5 seconds AND team1 controls atleast 2 flags -> grant 500 points to team1; reset timer timer1 |
Smong wrote: |
[..]
You would still need a compiler and header files, which some people are going to have problems setting up. Having a bot/asss plugin read the file and do everything dynamically just sounds a bit flaky and complex. |
Samapico wrote: |
teams Even / Odd could be used for some balling games
But I guess that,s mostly an interface issue... whether to show 'enters' , 'leaves', etc. as all individual actions, or show a 'regions:' category, in which you can choose the verb Same thing could apply to about every condition created |
Cerium wrote: |
Conditions:
variable is operator value Actions: move player at location to location set variable to value |
Code: Show/Hide public interface IPlugin
{ IPluginHost Host { get;set;} string Name { get;} string Description { get;} string Author { get;} string Version { get;} /// <summary> /// A string containing the code required to call this plugin's main method. /// The method call should start with "mervgen." since it will be placed inside /// of a class (MervGen) which will have an instantiated object named mervgen. /// /// i.e.: "mervgen.[name]([parameters])" /// </summary> string CallMethod { get;} /// <summary> /// A string containing the signature of this plugin's main method. /// /// i.e.: "[return type] [name]([parameters]);" /// /// Note that conditions should return bool and actions should return void by convention. /// </summary> string MethodSignature { get;} /// <summary> /// A string containing the definition of this plugin's main method. /// /// i.e.: "[return type] MervGen::[name]([parameters]) { [body] }" /// </summary> string MethodDefinition { get;} /// <summary> /// The list of phrases which will be displayed to the user. /// </summary> List<Phrase> Phrases { get;} /// <summary> /// The built-in stats that this plugin uses. /// </summary> List<Stats> RequiredStats { get;} /// <summary> /// The valid locations that this method can be called from. This is used /// to determine where the method call(s) will be inserted in the generated /// code. /// /// For instance, a plugin which is concerned with where a player moves /// would likely have a single entry (PlayerMove) as its valid placement. /// </summary> List<Events> ValidPlacements { get;} void Initialize(); void Dispose(); /// <summary> /// Instructs the plugin to generate all source code based on the /// current state of its Phrases list. The code to be generated is: /// /// - MethodSignature /// - MethodDefinition /// - Any extra methods, includes, or variables. /// /// MethodSignature and MethodDefinitions should be generated to their /// corresponding properties in the plugin. All extra code should be added /// to the appropriate location in the PluginHost. /// </summary> void GenerateCode(); } public interface IActionPlugin : IPlugin { } public interface IConditionPlugin : IPlugin { } public interface ITrigger { List<IActionPlugin> Actions { get; set; } List<IConditionPlugin> Conditions { get; set; } string Name { get; set; } } public interface IVariable { string Name { get; set; } string Type { get; set; } string Declaration { get; set; } } public interface IPluginHost { /// <summary> /// The triggers for this bot. /// </summary> List<ITrigger> Triggers { get; set; } /// <summary> /// The method signatures of any additional library methods which may need /// to be generated. /// </summary> List<string> LibraryMethodSignatures { get; set; } /// <summary> /// The method signatures of any additional library methods which may need /// to be generated. /// </summary> List<string> LibraryMethodDefinitions { get; set; } /// <summary> /// Any #include's (or #define's) which need to be included in the generated class. /// </summary> List<string> Includes { get; set; } /// <summary> /// Any fields which need to be generated in the class. /// </summary> List<IVariable> Variables { get; set; } } public enum Events { All, Tick, ArenaEnter, ArenaSettings, ArenaLeave, ArenaListEntry, ArenaListEnd, FlagGrab, FlagDrop, FlagMove, FlagVictory, FlagGameReset, FlagReward, TimedGameOver, SoccerGoal, BallMove, File, PlayerEntering, PlayerMove, PlayerWeapon, WatchDamage, PlayerDeath, BannerChanged, PlayerScore, PlayerPrize, PlayerShip, PlayerSpec, PlayerTeam, PlayerLeaving, SelfShipReset, SelfPrize, SelfUFO, PositionHook, BrickDropped, ObjectToggled, CreateTurret, DeleteTurret, ChatArena, ChatPublicMacro, ChatPublic, ChatTeam, ChatTeamPrivate, ChatPrivate, ChatPlayerWarning, ChatRemotePrivate, ChatServerError, ChatChannel, LocalCommand, LocalHelp, RemoteCommand, RemoteHelp, Init, Terminate } public enum Stats { PlayerDeaths, PlayerKills, PlayerShipChanges, PlayerFlagGrabs, PlayerFlagDrops, PlayerFlagVictories, PlayerFlagPoints, PlayerScore, PlayerKillPoints, PlayerDamageDealt, PlayerDamageReceived, PlayerTeamKills, PlayerMVP, TeamDeaths, TeamKills, TeamShipChanges, TeamFlagGrabs, TeamFlagDrops, TeamFlagVictories, TeamFlagPoints, TeamScore, TeamKillPoints, TeamDamageDealt, TeamDamageReceived, TeamTeamKills, TeamMVP,//Tracks the player with the most points in each team TeamMVT //Tracks the team with the most points } |
Code: Show/Hide public class MyCondition : IConditionPlugin
{ #region IPlugin Members IPluginHost host = null; private string name = "My Condition Plugin"; private string author = "Wes"; private string description = "This is a test plugin to see if the MervGen plugin architecture works"; private string version = "1.0"; private List<Phrase> phrases = new List<Phrase>(); private List<Stats> stats = new List<Stats>(); private string callMethod = "mervgen.myConditionPlugin()"; private string methodSignature = "bool myConditionPlugin();"; private string methodDefinition = "bool MervGen::myConditionPlugin(){ return true; }"; private List<Events> validPlacements = new List<Events>(); public List<Events> ValidPlacements { get { return validPlacements; } set { validPlacements = value; } } public string MethodDefinition { get { return methodDefinition; } set { methodDefinition = value; } } public string MethodSignature { get { return methodSignature; } set { methodSignature = value; } } public string CallMethod { get { return callMethod; } set { callMethod = value; } } public IPluginHost Host { get { return host; } set { host = value; } } public string Name { get { return name; } } public string Description { get { return description; } } public string Author { get { return author; } } public string Version { get { return version; } } public List<Phrase> Phrases { get { return phrases; } } public List<Stats> RequiredStats { get { return stats; } } public void Initialize() { phrases.Add(new Phrase("Player ")); List<string> options = new List<string>(); options.Add("any player"); options.Add("freq 0 player"); phrases.Add(new Phrase("player", options)); phrases.Add(new Phrase(" enters region ")); options = new List<string>(); options.Add("region1"); options.Add("region2"); phrases.Add(new Phrase("region", options)); phrases.Add(new Phrase(" and has bounty greater than ")); phrases.Add(new Phrase("bty", OptionType.FillNumber)); validPlacements.Add(Events.All); } public void Dispose() { } public void GenerateCode() { } #endregion } |
Smong wrote: |
Ok a few questions now.
- What does myConditionPlugin() get used for? Some time during code generation? |
Code: Show/Hide case EVENT_PlayerMove:
{ Player *p = (Player*)event.p[0]; if(mervgen.myConditionPlugin()) { ...(actions for the trigger called here) } } |
Smong wrote: |
- Would it be better to initialise phrases = new List<Phrase>(); inside Initialize() incase it gets called twice? |
Smong wrote: |
- What does validPlacements.Add(Events.All); do? Would it have been ok to use just movement and bounty change events for this particular condition? |
Smong wrote: |
- What does #region IPlugin Members and #endregion do? |
Quote: |
WORK ON THIS |