bladedpenguin's Recent Forum Activity

  • Ooh interesting. I might use something similar as well.

  • The Persist behavior only preserves stuff if you come back to the same layout. I'm looking for a way to let some items be persistent, but items in my inventory will follow me into a different layout.

    As for plugins: I won't have any trouble with discontinued or poorly maintained plugins/behaviors if I am the one writing the plugins ;-B I couldn't find anything to suggest that families are polymorphic with respect to functions, but I just got my item behavior up and running. I have two items, and pushing a key triggers whatever item is in a particular slot, and then each item does it's own thing. It's just a little glue really. This way, at some point down the line I can very easily do crazy stuff like a cursed sword that sets you on fire when you pick it up, or enemies that can be placed in inventory slots.

    I'm still having trouble keeping stuff between layouts. I noticed that even though itemslots are global and positioned on a global layer, they get reset every time a new layout starts. What is the best way to fix this?

  • I was hoping someone more familiar with C2 and Javascript could check my thinking and give me some suggestions. I am currently using sprites to represent and hold all my RPG items. I'm not sure if this is the best choice, but it seems like a good idea for now. I have another sprite that I am using as an Itemslot, which so far can hold an Item and stores it's UID. My first problem is that items disappear between layouts, which leaves the Itemslot holding a UID for a nonexistent Item. I was thinking that I should maybe have each nonempty Itemslot store it's item as JSON and destroy it when the layout ends, and restore it on the start of the next layout. Is this a good solution or is there a better one?

    My other question is about callbacks. I would like to assign functions to the Item family, such as onEquip, onUnequip, and onUse, so that armor can boost the character's armor stat in onEquip or a weapon can spawn a bunch of bullets in onUse. I guess I am looking for family members to share polymorphism. Would it be better to implement this with an RPGItem behavior or plugin?

  • Stitching in this case is something that is done to the background sprite. It basically means that the left edge of the sprite matches up with the right edge, so the background still looks good when the player walks to the edge of it , and you see two instances of the background, one at the left edge and one with the right edge lined up so you can't see the seam.

    This seems like an interesting challenge. If you do end up moving the background instead of the player, you have to move all the obstacles and enemies etc also. What I would do instead is designate a margin the width of the screen around the edge of the layout. For everything within that margin, you duplicate it so that everything that happens on the right happens on the left and visa versa. If the duplication is good enough, the player won't notice when they are teleported from one edge to the other. Then you modify all your pathfinding and enemy behaviors so they respect the boundary as well, and make sure enemies also get teleported when they hit the edge. I bet that using a Canvas can help you to visually duplicate parts of the layout, which makes it easier to hide that seam.

  • So it was suggested in this thread that I make a plugin to "translate" player entered text to give them an accent or make it sound like they are from a different ingame region. I can certainly bang out a couple of javascript functions with regular expressions in them and make them return modified strings, but I am interested in what this might look like in terms of Construct 2? What Actions, Expressions or Conditions would a Language Mangler plugin have?

    I'm also looking for ideas about what kind of filters I should include. I've already thought about looking for a few specific vowel/consonant patterns at the beginning of the word so I can substitute a few letters, rearrange the remaining letters, and bump the word so it appears later in the sentence. What other ideas should I implement? Rot13? specific word replacements? If there is enough interest, I will actually make something. I need the regex practice.

  • Haha maybe I should? What exactly might such a thing do? I suppose It could have a range of like a dozen premade stackable manglers, which do everything from making charachters speak with an accent to changing sentance structure to making completely deterministic but unintelligible gobbledygook.

    I guess I just got caught up in it because I just did some javascript regex for my own game. I just made a parser for my rpgcharachter behavior, which takes an attack string and factors in randomness and the character's stats and skills to make a damage string. The damage string describes things like degree of armor piercing, ice damage temperature, etc, which the defender processes against their own armor and resistances to take damage. regexes are fun!

  • Oops. Listen to Codah. He knows the simplest way to do it

  • You seem to be turning sound on and off by enabling/disabling the LevelMusic group. This does not actually start and stop the sound, it just stops events related to it. In this case, the LevelMusic group does not get enabled until the level has already started, which prevents event 385 from triggering. When the level restarts, 385 triggers again, because LevelMusic is already enabled, but you never did anything to stop the music, so when 385 triggers again it just plays over top of the already playing music.

    You need to actually Audio.pause or Audio.stop your music when falling off the screen or pausing. Remember that this is done by tag, not by name, so you need to tag the music when it starts.

  • I wonder if there is a regex plugin?

    In any case, look at my code where I make in = input.split(" "). (really, in is not a valid identifier because it is a reserved word, so use inp instead)This takes apart the sentance at the spaces, so the variable "in" is now an array that contains each word in the sentance. I took it a step deeper, and took each word apart and put it back together wrong, but you could just as easily stop at this point an put the whole sentance together wrong.

     var output = "";
    for (i in inp) {
      output  = inp[i] + " " + output;
    }
    [/code:1k2lj6z8]
    This is fairly simple, it just puts the sentence back together backwards, but you could go into some crazy tower of hanoi recursive fractal type of word reorder. You can use regular expressions to pick out specific words, which, using the above regex, would allow you to do things like pick all consonant-vowel-consonant-anything words and put them in the front of the sentence, with or without mangling the word itself. You can even combine the two, so it's possible to mangle sentence order AND mangle individual words AND substitute both words and letters.
    
    The only thing I can't imagine how to do easily is picking out and reordering based on actual syntactic structure, such as nouns, verbs, adjectives, direct object etc. Understanding human language is hard.
    
    I hope that covered what you were hoping to do. If not, feel free to keep asking. If you can be more clear about what it is that you are in particular looking for, I may be able to help you further
  • Hello! I'm bladedpenguin with Blind Arrow Games, and we are working on an RPG called Apprentice, which is about the darker side to a magical world. We just transitioned from RPGmaker, and holy crap is this community vibrant! It seems like in all the threads where a couple users are musing about a solution, Ashley swoops in to save the day and give The Right Answer(tm) lol. It seems like transitioning to C2 will make the rpg basics a little more difficult, but when it comes time to implement Interesting Gameplay, C2 will really shine and let us do whatever we want! I've already got some crazy ideas....

    I'm new to javascript, but I hope to eventually release any plugins that we develop to help us on Apprentice. So far I've got an RPG charachter plugin, and I'm contemplating an rpg item, though both are a horrible mess.... They will become more refined and polished as I learn more about javascript and the C2 internals My programming history includes working with Minecraft plugins in Java, writing bash scripts as a Linux system administrator, using python to solve math problems, and a couple classes in c/c++. Looking forward to figuring stuff out and creating great things with you all!

  • If I understand you correctly, It sounds like you need to read up on picking. When you spawn a bullet from a turret, both that particular bullet instance and that particular turret are selected, so you should be able to set the instance variables for that partcular bullet, and no others. You can then destroy bullets based on whether distance traveled is greater than the Range instance var on the bullet. Perhaps if you post a capx, we can see where you are going wrong.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would second the suggestion that you look into regular expressions. They really are made for exactly what you seem to be trying to do here. Using regexs, you can do more versatile translations, do them more efficiently. For example, I might try something like

    var input; // this is the text you are going to translate
    var in; //a temporary array to hold words
    var t; //temp
    var output = "";
    in = in.split(" ");
    for (var i in in) {
      if (null != (t = in[i].match(/([~aeiou])([aeiou])([~aeiou])([a-z]*)/i))){
        output += " " + t[4] + t[2] + t[3] + t[3] + t[1]
      }
    }
    
    [/code:ekeaikau]
    Pardon any mistakes. I am new to javascript, and i have not tested this at all. It's just to give you a general idea of what you might do.
    
    What this does is split an input sentance into words based on spaces. Then it tries to match each word against a regular expression, which is the funky bit after in[i].match(). The regular expression looks first for a nonvowel, then a vowel, then another nonvowel, then it considers the word matched and includes any letters that come after that. the regex stores the things it finds in the array t. For example, if you fed it the word "language", it would first match the whole things and store it in t[0] = "language". The subsequent parts of the array contain the groups in the regex, so t = ("language","l","a","n","guage").  The line that starts with output +=  will add a space, which was removed in the split, then stitch the word back together from the array t in a suitable mangled fashion: guageannl. similarly, you could feed it "lol" and you would get "olll", or give it "similar" and get "ilarimms". You can also make it do letter substitutions and other crazy shenanigans. It becomes a roll your own, extra complicated form of pig latin!
    
    Was this at all what you were looking for?
bladedpenguin's avatar

bladedpenguin

Member since 5 Feb, 2015

None one is following bladedpenguin yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies