Welcome to the GameZone24.net Forums - Serious Sam.
Page 1 of 3 123 LastLast
Results 1 to 15 of 36

Thread: My 2 Cents

  1. #1
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    My 2 Cents

    Hi there, it has been a long time since i came here
    First of all, idk if this is the right section, feel free to move this thread

    So, today i was having fun learning RegEx, and to train myself, i did the regex for serious sam tag

    Here it is, I hope there is still some programmer around and this could help doing something , i would like to do a new NameEditor (with cool stuffs like an integrated fader) some time ago but i've not time

    Code:
    (\^c\w{0,6}|\^[CFiIbBAr]|\^f[0-9]|\^a\w{2}|[^^]\w*)
    Easy usage under python ( )
    Code:
    >>> s =  "^i^b^c000080^f2Provo^B^C^I^F^a88^c400040ca^Atio^rn"
    >>> print s
    '^i^b^c000080^f2Provo^B^C^I^F^a88^c400040ca^Atio^rn'
    >>> test = re.compile(r"(\^c\w{0,6}|\^[CFiIbBAr]|\^f[0-9]|\^a\w{2}|[^^]\w*)", re.DOTALL)
    >>> l = test.findall(s)
    >>> print l
    ['^i', '^b', '^c000080', '^f2', 'Provo', '^B', '^C', '^I', '^F', '^a88', '^c400040', 'ca', '^A', 'tio', '^r', 'n']
    >>> tag = ''.join([ i for i in l if i[0] != "^" ])
    >>> print tag
    'Provocation'
    >>>
    Should be pretty easy to do it with other languages (Java,C etc), but i hate them, so ...

    PS: I had to download the NameEditor and i pleasantly noticed the my TagFader is pretty much downloaded

    ~ Proud member of Limited Edition since 19 January 2009 ~

  2. #2
    Golden^_+Imperator
    Join Date
    March 2008
    Location
    Currently Iceland
    Posts
    4,088

    Downloads: 201  Uploads: 24

    Quote Originally Posted by ProvoCation View Post
    Hi there, it has been a long time since i came here
    First of all, idk if this is the right section, feel free to move this thread

    So, today i was having fun learning RegEx, and to train myself, i did the regex for serious sam tag

    Here it is, I hope there is still some programmer around and this could help doing something , i would like to do a new NameEditor (with cool stuffs like an integrated fader) some time ago but i've not time

    Code:
    (\^c\w{0,6}|\^[CFiIbBAr]|\^f[0-9]|\^a\w{2}|[^^]\w*)
    Easy usage under python ( )
    Code:
    >>> s =  "^i^b^c000080^f2Provo^B^C^I^F^a88^c400040ca^Atio^rn"
    >>> print s
    '^i^b^c000080^f2Provo^B^C^I^F^a88^c400040ca^Atio^rn'
    >>> test = re.compile(r"(\^c\w{0,6}|\^[CFiIbBAr]|\^f[0-9]|\^a\w{2}|[^^]\w*)", re.DOTALL)
    >>> l = test.findall(s)
    >>> print l
    ['^i', '^b', '^c000080', '^f2', 'Provo', '^B', '^C', '^I', '^F', '^a88', '^c400040', 'ca', '^A', 'tio', '^r', 'n']
    >>> tag = ''.join([ i for i in l if i[0] != "^" ])
    >>> print tag
    'Provocation'
    >>>
    Should be pretty easy to do it with other languages (Java,C etc), but i hate them, so ...

    PS: I had to download the NameEditor and i pleasantly noticed the my TagFader is pretty much downloaded

    Can it be already used in SS? i tried to put it in console, and nothing happenes (i think that regex isn't included )




    *~>>Devils Ultimate d'Erektor<<~*

    People who lead a very successful business, usually tend to have extremely low freetime which results in depressions.
    The only thing that matters is personal happines and health, money can destroy both.
    ~Amco 2016

    It doesnt matter what you look like, or what stereotype you fulfill as long, as you're modest
    and respectful towards everyone, and feel comfortable about yourself.
    ~Amco 2020

    post your screens? played yesterday? of today? no screens available? No screens of january? december 2022? november 2022? no played matches in sam? hm sad. just stay a "legend" on gz these days. inactive since decades or activ as "Alias" with vpn lol. ~Vyebani User 2023


  3. #3
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    You shouldn't use \w for hexadecimal values, either use \x or [a-fA-F0-9].
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  4. #4
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    Actually, I just put the Player Profile Editor source code up on the Alligator Pit Github account: https://github.com/AlligatorPit/Player-Profile-Editor

    Feel free to do a pull request for feature additions and we'll merge it into the Serious Sam Revolution Toolkit on Steam.

    Edit: I also just open sourced the Revolution Packer program, found here: https://github.com/AlligatorPit/Revolution-Packer
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  5. #5
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    Quote Originally Posted by Scratch View Post
    Actually, I just put the Player Profile Editor source code up on the Alligator Pit Github account: https://github.com/AlligatorPit/Player-Profile-Editor

    Feel free to do a pull request for feature additions and we'll merge it into the Serious Sam Revolution Toolkit on Steam.
    Yo! angelo right?
    Didnt know there was something already done I'll give a look
    It was simply an exercise for me

    Btw, i used \w since it's like [a-zA-Z0-9_], not big difference from [a-fA-F0-9]. It's more flexible in case of "broken" tags imho
    Last edited by ProvoCation; 08.07.2014 at 12:19.

    ~ Proud member of Limited Edition since 19 January 2009 ~

  6. #6
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    Quote Originally Posted by ProvoCation View Post
    Yo! angelo right?
    Didnt know there was something already done I'll give a look
    It was simply an exercise for me

    Btw, i used \w since it's like [a-fA-F0-9_], not big difference from [a-fA-F0-9]. It's more flexible in case of "broken" tags imho
    Ah, I see, makes sense. The game also interprets non-alphanumeric characters as "valid" though, even though they will be valued as 4-bit integer 0. So technically if you want to account for all broken tags, you'd have to do something like ^c.{,6} instead. (Not all tags end with a length-valid color tag)

    And yes, I'm Angelo
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  7. #7
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    Quote Originally Posted by Scratch View Post
    So technically if you want to account for all broken tags, you'd have to do something like ^c.{,6} instead. (Not all tags end with a length-valid color tag)
    In fact I did this for colors
    Code:
    \^c\w{0,6}
    But you're right too, "." instead of "\w" takes all broken tags

    EDIT: I missed this reply

    Quote Originally Posted by GraphX View Post

    Can it be already used in SS? i tried to put it in console, and nothing happenes (i think that regex isn't included )
    Ehm, it's obvious it doesnt work....are you trolling me?

    ~ Proud member of Limited Edition since 19 January 2009 ~

  8. #8
    Golden^_+Imperator
    Join Date
    March 2008
    Location
    Currently Iceland
    Posts
    4,088

    Downloads: 201  Uploads: 24

    Quote Originally Posted by ProvoCation View Post
    Ehm, it's obvious it doesnt work....are you trolling me?
    No, i'm dumb in those things




    *~>>Devils Ultimate d'Erektor<<~*

    People who lead a very successful business, usually tend to have extremely low freetime which results in depressions.
    The only thing that matters is personal happines and health, money can destroy both.
    ~Amco 2016

    It doesnt matter what you look like, or what stereotype you fulfill as long, as you're modest
    and respectful towards everyone, and feel comfortable about yourself.
    ~Amco 2020

    post your screens? played yesterday? of today? no screens available? No screens of january? december 2022? november 2022? no played matches in sam? hm sad. just stay a "legend" on gz these days. inactive since decades or activ as "Alias" with vpn lol. ~Vyebani User 2023


  9. #9
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    Quote Originally Posted by ProvoCation View Post
    In fact I did this for colors
    Code:
    \^c\w{0,6}
    But you're right too, "." instead of "\w" takes all broken tags
    You don't need that 0 there by the way, if you do {,6} it basically means maximum of 6, the same as where {6,} would mean a minimum of 6.

    Good job though! I love regex, one of my favorite things ever.
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  10. #10
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    Quote Originally Posted by GraphX View Post
    No, i'm dumb in those things
    Well, what i wrote is to use inside a third-part program code, not directly on SS
    I simply gave an example in Python, which is my favourite programming language.


    Quote Originally Posted by Scratch View Post
    Actually, I just put the Player Profile Editor source code up on the Alligator Pit Github account: https://github.com/AlligatorPit/Player-Profile-Editor

    Feel free to do a pull request for feature additions and we'll merge it into the Serious Sam Revolution Toolkit on Steam.

    Edit: I also just open sourced the Revolution Packer program, found here: https://github.com/AlligatorPit/Revolution-Packer
    Is that C#? Btw I think i can't help sorry I never used github, nor C# (should be similar to Java though), nor i've time to check that codes

    ~ Proud member of Limited Edition since 19 January 2009 ~

  11. #11
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    Yep, that's in C#. I would rewrite it in C++ with the help of the (very underrated) Iup library, actually. That might be a fun exercise for myself.

    If you do enjoy programming a lot I suggest you learn how Github works, as well as learning new languages such as C, C++, C#, etc. Always fun to learn something new!

    Some things that would need to be done on the player profile editor is adding preview support for ^a (which is not very difficult) and ^f which will need some restructuring to account for control invalidation (30fps?)
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  12. #12
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    Quote Originally Posted by Scratch View Post
    If you do enjoy programming a lot I suggest you learn how Github works, as well as learning new languages such as C, C++, C#, etc. Always fun to learn something new!
    I'm surely gonna do it, once finished university studies
    Enought things to learn nowadays, RegEx are soo easy/short they can fit my tasks

    ~ Proud member of Limited Edition since 19 January 2009 ~

  13. #13
    Alligator Pit
    Join Date
    May 2005
    Location
    Netherlands
    Posts
    10,171

    Downloads:Uploads: 0

    For anyone reading this who have no idea what this thread is about (eg. GraphX ), this is probably not useful to you at all. Above regex can only be used to parse existing tags into something more readable (or more specifically, to match on the groups of formatting codes so programmers can use them to format them on things like webpages, etc.)
    Disclaimer: Opinions expressed in this post are my own, not my employer's.

  14. #14
    VPN Elite

    Join Date
    January 2007
    Location
    Germany
    Posts
    6,388

    Downloads: 31  Uploads: 0

    hi provo, good to see some normal people here


    hm sad. just stay a "legend" on gz these days. inactive since decades or activ as "Alias" with vpn lol.

  15. #15
    Limited Edition
    42 A'dam Server Admin

    Join Date
    December 2007
    Location
    Bologna --> Italy
    Posts
    11,636

    Downloads: 41  Uploads: 0

    Quote Originally Posted by AmcoTraD View Post
    hi provo, good to see some normal people here
    ahah
    yo man

    ~ Proud member of Limited Edition since 19 January 2009 ~

 

 
Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Just my 5 cents
    By Marduk in forum General Discussion
    Replies: 19
    Last Post: 22.12.2012, 18:33

Posting Permissions

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