eMafia Scripting - Page 2
Register

User Tag List

Page 2 of 2 FirstFirst 1 2
Results 51 to 82 of 82
  1. ISO #51

  2. ISO #52

    Re: eMafia Scripting

    Quote Originally Posted by Raptorblaze View Post
    That's my point, rearranging it so returns or functions never use an end block at all would make it a bit cleaner if nothing else
    That would require a stringBuilder to handle "" and + and such or else > wouldn't be usable in text. That's why JavaScript seems simpler now.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  3. ISO #53

    Re: eMafia Scripting

    Mind if ask what language you've built the system on?
    Spoiler : FM Experience :
    Spoiler : L-FM :
    FMXVII FM Roronoa Zoro - Obvious Jester - Lost, FMXVII FM Ryan - Citizen -Lost
    Spoiler : S-FM :
    S-FM 81 Bus Drivers: Bus Driver - Lost, S-FM 86 Plane Crash: Jailor Won, S-FM 84 Heart of The Swarm: Citizen - Won, S-FM 82 Colonization: Host - 3 Town Survivors, S-FM 71 MLP FiM I: Doctor - Lost, S-FM 68 Democracy: Citizen - Lost

  4. ISO #54

    Re: eMafia Scripting

    Quote Originally Posted by 42shadow42 View Post
    Mind if ask what language you've built the system on?
    Java
    We are opposed to the line of compromise with imperialism. At the same time, we cannot tolerate the practice of only shouting against imperialism, but, in actual fact, being afraid to fight it. Kim Il Sung
    [CENTER]S-FM: Bus Drivers, S-FM: Trust, S-FM: Double Killers, S-FM: Double Killers Too, S-FM: Heart of the Swarm [COLOR="#FF0000"]HOST[SIZE=1]

  5. ISO #55

    Re: eMafia Scripting

    Apo has to agree that javascript is working nicely, barely even have to edit the previous functions.
    Currently only able to call commands with the ers reference like ers.text(String) or ers.textTo(playerNum,String), but it's an 'ok' downside for now but will be looking for a way to make it possible to use the commands without an object reference.

    With this scripting style, object oriented programming is possible, referencing directly(well..Apo will make it pesdo-directly) to Roles/Match/Player to access things, OR the current style of 'general' functions, OR a mix of both?

    Opinions of the general populace is best to work out what is easiest and most functional to use. Like going with the OOP style would changes things like <TARGET1> to ers.self.getTarget1(). <TEXT_TO>5,I see you pee.</TEXT_TO> to ers.playerObj.text("I see you pee.") or ers.textTo(5, "I see you pee.") to keep ease of possibilities.
    Last edited by Apocist; October 24th, 2013 at 08:33 AM.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  6. ISO #56

    Re: eMafia Scripting

    Apo is sorry for long delay, have been without a computer since ... The Friday before last??

    JavaScript support is fully functional, so when he gets Internet at his new location he will update everything. Controlling the match through the scripts is object based.

    To make things simpler, the basic objects are already labeled for quick access. For example: if a role is running the script, 'self' is referenced.
    If a team is running the script 'team' would be used. And 'match' will always be available.

    Example commands would be self.getRoleName(); team.getName(); match.getNumAlivePlayers; match.getAlivePlayers(); ect

    Will go into more details later...

    Have also enabled Teams to go along with team win conditions. Only those within the same affiliation may be in the same team or the match won't start(there will be default teams so this can normally be ignored altogether, but teams will be changed from within the role selection setup)

    Still perfecting the Teams and working on the Flags needed to allow normal and special statuses such as Doused, Electrified/Charged, Poisoned, ect.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  7. ISO #57

    Re: eMafia Scripting

    Finally have the interwebs back, YAY! Apo happy.

    Updated the first two posts with the new features of Teams, onEvents, Javascript, ect.

    So is this scripting style more preferable to the previous custom markup language? Have to say it's more to grasp for players new at it, but provides alot more functionality.

    Working on Flags now, once running, will feel more comfortable to open access to the game.

    How great will our ability to implement roles be? For example, would implementing a lightkeeper type role (for a day after their death, all players are anonymous) be possible with the functions we'll have access to?
    Added onDeath event, holding off on misc Match commands for the moment but on my todo list, can prehaps be done through the ChatController commands that already exist(the anonymous feature is disabled atm)

    Edit: if you set all the players through the use of match.chatAddPlayer, you should have been already able to achieve your goal(once Apo re-enables the option)

    1. Have hosts set the OoO when designing the setup
    2. Have each role assigned to a list of pre-defined "types" which are in a specific OoO position each, some types would run all actions in their group at the same type while others (like roleblockers) would do several loops to clear out paradoxes.
    Suggestion design worked out, inprocess

    The Action Type(ooo thats what I'll call it now) will be named when creating the role.
    Then within the Match Settings, the host can order the Action Types(The Types will be providied based on what roles are enabled for the match)

    It won't have a default order for new types, custom Action Types would be placed at the bottom of the list of an already made Default list of the normal roles

    Apocist, is there any chance you'd add an option to name the variable produced by [FOREACH] to allow for nested loops? Right now I can't think of a situation where you'd need them but you never know!
    self.getVar("StringName") and self.setVar("StringName","Whee") were converted to the javascript version, may not work the same right now due to different way of handling data types, but it's a start

    Edit: Totally read that wrong... was trying to get everything fixed too fast...
    Because it's java script now, it's named to whatever you choose
    Last edited by Apocist; November 11th, 2013 at 05:05 AM. Reason: oopsies

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  8. ISO #58

    Re: eMafia Scripting

    Quote Originally Posted by RLVG View Post
    It's a FM Role, which is most likely becoming a custom in eMafia if we can make our own roles.

    Basically :
    1. Charge someone each night, making the person permanentally charged. (Like Arsonist douse)
    2. When someone charged meets another charged, both charged will become attacked.

    With more examples for scripts, we can get an idea on how to create unique roles.
    Ok, here is the flag system that was required to make special roles work(good thing I add onVisit)...
    Let me know how this could be improved upon.
    Example of the Electromaniac script:

    onNightTargetChoice:
    var target = self.getTarget1():
    if(target != null){
    self.text("You will charge "+target.getName()+" tonight.");
    }
    else{
    self.text("You will not charge anyone tonight.");
    }


    onNightEnd:
    var target = self.getTarget1();
    if(target != null){
    self.visit(target);
    target.addFlag("CHARGED");
    target.getFlag("CHARGED").setScriptPre("onVisit","
    if(visitor.hasFlag(\"CHARGED\")){
    match.attack(visitor, \"Electocuted\", \"been shocked to death\");
    match.attack(self, \"Electocuted\", \"been shocked to death\");
    }
    ");
    }
    ------------------------------------------

    Here is what is going on:

    Like normal, it detects the user is choosing a target at night during onNightTargetChoice.

    When the night ends:
    Visits the targetted player
    Gives the target a flag/status by the name of CHARGED.
    Gives a script to the flag to run during a certain time. (which is onVisit).

    The end result being that onVisit runs whenever the player is visited by someone else.
    Therefore; whoever visits a player with the charged flag, that visitor is checked for having the flag as well....if so...death for both.

    Flags seem a bit more complex because we are running different objects(each with different functions) as well as in different onEvents
    Apo's allowed Flags themselves to hold the same scripts as the Roles. A script on a flag merely appends its own script BEFORE or AFTER the script of the Role it is apart of. So lets say making a Flag post script for the event... 'onNightEnd' would make its Role holder perform that Flag script after it's done doing its own Role script
    Last edited by Apocist; December 2nd, 2013 at 09:10 AM. Reason: Updated to reflect OoP

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  9. ISO #59

    Re: eMafia Scripting

    Many more commands updated/moved/deleted. Change behavior of core roles. onAttacked event added. Doctor, Escort, Mafiaso, and Godfather scripts updated.

    Added Constant functionality of a player merely possessing a certain named flag, these include:
    NIGHTIMMUNE
    for the moment

    Edit: Then quickly realized that only Doc scripts aren't posted.
    Last edited by Apocist; December 13th, 2013 at 09:06 AM.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  10. ISO #60

    Re: eMafia Scripting

    I might try to help a bit once my final is finished.
    When we talked about pubs, we are talking about us.
    When they talked about pubs, they exclude themselves.
    They say only bad players want to modify citizens, and they do not satisfy bad players.
    Are we bad players? We include bad players, but that is just a part of us.
    ---They put veteran, mayor, allowed jester to visit for nothing, and they regretted and say those things are brainless.

  11. ISO #61

    Re: eMafia Scripting

    Action Categories replaced the flawed Action Order by number system.
    All Roles are to given a named category instead of a number. The actions can be order arranged by the host of the match, but starts with the standard default ordering in place.

    Next order of business is going to be throwing the engine onto my dev laptop and let that act as the 24/7 server until expenses are settled. With that in place, access to the game will be made available with the much flawed client. In addition the client will be able to view the innards of every role in the next update.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  12. ISO #62

    Re: eMafia Scripting

    Attempting 1:




    Name: Survivor
    Affiliation: every factions
    Category: core neutral

    Action Category: selfvest

    onTeam: OFF
    Team Name: (blank)
    Teammates visible OFF
    Share Night chat OFF
    Share Win ON

    Number of Day Targets: 1
    Number of Night Targets: 0
    Who you may target during Day: Everyone except self

    (During the example of these scripts the object references 'match', 'self', and sometimes 'team' are already provided)

    onNightTargetChoice:
    var target = self.getTarget?();
    if(target != null){
    self.text("You will put on your bullet-proof vest");
    }
    When we talked about pubs, we are talking about us.
    When they talked about pubs, they exclude themselves.
    They say only bad players want to modify citizens, and they do not satisfy bad players.
    Are we bad players? We include bad players, but that is just a part of us.
    ---They put veteran, mayor, allowed jester to visit for nothing, and they regretted and say those things are brainless.

  13. ISO #63

  14. ISO #64

    Re: eMafia Scripting

    Oh that's reminds me, been busy with 60 hour work weeks Apo's been slack'n. I'll put the ability to upload/add your own role into the next release so you can test scripts.

    As for HTML5, I personally don't know it's potentials. I have the a ability to put this on an iPhone add in the future, but development on a completely different platform(for a third time) is a bit much. But it should be possible to allow different clients to connect to the server, but Apo has no intention of creating one.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  15. ISO #65

    Re: eMafia Scripting

    Quote Originally Posted by louiswill View Post
    Attempting 1:




    Name: Survivor
    Affiliation: every factions
    Category: core neutral

    Action Category: selfvest

    onTeam: OFF
    Team Name: (blank)
    Teammates visible OFF
    Share Night chat OFF
    Share Win ON

    Number of Day Targets: 1
    Number of Night Targets: 0
    Who you may target during Day: Everyone except self

    (During the example of these scripts the object references 'match', 'self', and sometimes 'team' are already provided)

    onNightTargetChoice:
    var target = self.getTarget?();
    if(target != null){
    self.text("You will put on your bullet-proof vest");
    }
    Apo really needs to provide better documentation as well, but for the most part, this script will tell the user that they will put on a bulletproof vest, yet they have to target(click) on a player besides themselves. Would need to set the targetable to 'self'

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  16. ISO #66

  17. ISO #67

    Re: eMafia Scripting

    Quote Originally Posted by Apocist View Post
    Oh that's reminds me, been busy with 60 hour work weeks Apo's been slack'n. I'll put the ability to upload/add your own role into the next release so you can test scripts.
    The ability to make your own role is up now... just need to figure out where to put a menu in the lobby....Apo hates GUIs...... VISUAL DESIGN IS NOT HIS FORTE OK?!?!

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  18. ISO #68

    Re: eMafia Scripting

    Released a very unrefined and unpolished version. Download this file, and put it into a folder and it will keep the program up to date.

    You can script your own roles with the built-in editor and even test them out if you can get a match running. (For now you can access it by creating a match and viewing a role from the Possible Role list)
    Apo still needs to still make a decent guide and reference sheet.

    Quite sure there are plenty of bugs and ugliness, but any suggestions

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  19. ISO #69

  20. ISO #70

    Re: eMafia Scripting

    Hrm, for some reason it logged eMafia out of the sc2maf forum.

    As for 3 characters, do you mean like 3 playable accounts? It is possible, each eMafia account is linked to a Sc2Maf forum account, so you would need 3 forum accounts. There will be safe guards in the future to inform everyone in that match if two or more accounts share the same IP to prevent cheating.

    Also Apo noticed he forgot to add the New Role button so you can only edit existing roles. Will add that, add a menu in the main lobby for roles, and fix the forum login issue as soon as Apo gets home.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  21. ISO #71

  22. ISO #72

  23. ISO #73

    Re: eMafia Scripting

    Quote Originally Posted by ika View Post
    no, what i mean is my fourm account is 3 chracters long and it doenst allow 3 chracters
    Oh is the right? Now that Apo remembers it, before it required the forum it was 4 - 18 characters. Whats the limit on the forum? (Think that he was just making up some random logical numbers) For now setting to 2 - 24 characters.

    *nods*

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  24. ISO #74

    Re: eMafia Scripting

    Almost forgot to. Client updated with Create New Role Option, location in the Lobby -> Menu -> Role

    Might need to change how updates are handled, 3.5 mbs(atm) per update for the main program is a bit much if it happens alot. Apo's a seeing about the program loading the class files instead to make the updates smaller.
    (edit: well found a quick fix to that, poorly structured directories don't help)
    Last edited by Apocist; February 7th, 2014 at 11:57 AM.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  25. ISO #75

  26. ISO #76

    Re: eMafia Scripting

    Quote Originally Posted by ika View Post
    verifying.JPG

    i tried to verify but got this again...

    it worked on making my account and got the pm to verify but when i wnet o verify i got that

    creating the account had no problems dealing with 3 character though
    @#!#, Didn't remember setting a limit on the verify section too. fixed

    Your account still exists, just on waiting verification still

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  27. ISO #77

  28. ISO #78

    Re: eMafia Scripting

    Quote Originally Posted by ika View Post
    Capturewut.JPG

    was sitting in the game alone. you can do one player apparenylt withc is kinda funny
    Lol, haven't tested electro maniac yet, but I know the godfather is broken. Something to do with how the functions are being read.

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  29. ISO #79

  30. ISO #80

    Re: eMafia Scripting

    Shouldn't line 17 be.


    1. for(var player in team.getAliveTeammates()){\n\
    Spoiler : FM Experience :
    Spoiler : L-FM :
    FMXVII FM Roronoa Zoro - Obvious Jester - Lost, FMXVII FM Ryan - Citizen -Lost
    Spoiler : S-FM :
    S-FM 81 Bus Drivers: Bus Driver - Lost, S-FM 86 Plane Crash: Jailor Won, S-FM 84 Heart of The Swarm: Citizen - Won, S-FM 82 Colonization: Host - 3 Town Survivors, S-FM 71 MLP FiM I: Doctor - Lost, S-FM 68 Democracy: Citizen - Lost

  31. ISO #81

    Re: eMafia Scripting

    Quote Originally Posted by 42shadow42 View Post
    Shouldn't line 17 be.


    1. for(var player in team.getAliveTeammates()){\n\
    Yes, you are correct!

    But that didn't solve the problem either. The For-in variant would not work due to it not keeping the object references. had to change it to
    Code:
    var teammates = team.getAliveTeammates();\n\
    for (var i = 0; i < teammates.length; i++) {\n\
    Edit: also changed the scripting to show the javascript syntax errors as well as line number now


    Thx for the help, with this it works... now off to make the Forum Signups, feel free help out by 'signing' up on the forum if you ever see the eMafia GM post

    Quote Originally Posted by SuperJack View Post
    Look what you have caused. Seems like everyone who posted is now confused about their own gender and are venting their frustration into opinions.

  32. ISO #82

 

 

Similar Threads

  1. eMafia Introduction
    By Apocist in forum General Discussion
    Replies: 64
    Last Post: May 28th, 2014, 04:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •