RhapsodyInGeek's Forum Posts

  • newt

    I'm not sure what I'd be looping in this case to pick the correct object when there might be multiple instances of it on screen?

    Jayjay

    I knew about the Create Object by Name, didn't know it did that though. It'd be useful if it were just a few guns and all I was doing was a quick Power calculation, but I'm also setting a Character ID, an Attack Type, and an Element, and doing a further modifier on the Power in the case of a certain status condition. Also, your suggestion pretty much equates to the same thing as Example B, except it'd be a bit more unreadable having it all in one long event due to the amount of weapons and variables that are to be involved.

  • So I'm trying to spawn objects by expression to try to streamline my events, but I've run into a little problem. As far as I understand, under normal circumstances when you spawn in object in Construct that object is automatically the one picked for any following actions, which is cool. However, I don't know how to modify that same object if the object created is through a string variable in an expression. Basically...

    I want to do

    Player presses Attack Control

    --> Player create object Player.Value('CurrentWeapon')

    --> Set (Player.Value('CurrentWeapon').Value('Power') = blahblahblahstupidmathblahblahblah

    I don't want to do, but will I guess if I have to

    Player presses Attack Control

    --> If Player.Value('CurrentWeapon') = WimpyGun

    ----> Player create object WimpyGun

    ----> Set WimpyGun.Value('Power') = blahblahblahwimpymathblahblahblah

    --> Elseif Player.Value('CurrentWeapon') = NotWimpyGun

    ----> Player create object NotWimpyGun

    ----> Set NotWimpyGun.Value('Power') = blahblahblah1337mathblahblahblah

    --> Elseif etc..., etc...

    ----> blahblahblahlotsofeventsblahblahblah

    Am I just gonna have to suck it up and make a condition for each object as outlined in Example B? <img src="smileys/smiley19.gif" border="0" align="middle" /> Or is there a way to make Example A work?

  • And... that example .cap... Wow. That is a LOT... And using arrays? That would make things difficult when trying to attack more than one enemy at once.

    Heh, it's not as much as you might think. It's really just using the same checking logic for different parts of the array (weakness, resistance, absorption, immunity). And you don't have to use arrays (though I highly recommend it!). I'm just using arrays for database stuff, things that I don't want to have to change every instance of every sprite for if I want to make a game balance edit, so I can just reference a database entry for it. I'm making an action adventure RPG so it's kinda necessary for me.

    But yea, if you want a complex combat system, you're going to have to get a little complex. The key thing to remember to do is make sure it's readable and organized, or else you'll run into problems debugging later.

    I'm sure tulamide or R0J0hound could find a one condition/one action way to do what I did <img src="smileys/smiley2.gif" border="0" align="middle" /> but the method I threw out seems to work just fine.

  • Here's the damage formula I'm using for my game, in calculator mode. Basically the way it's designed is that each time a hero's attack object collides with an enemy object this big ol' calculation gets run for the two objects. It incorporates arrays in the calculator, but in my actual game it's a mix between array values and private variables.

    Linkity link link:

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

    In the calculations the elemental resistances are string values, initials. I use "FindToken" to compare the elemental resistances with the attack element. If I want to do no elemental resistances I set them to 0, and if I want to do no attack element I set it to -1, since "FindToken" does count 0 and 0 as an elemental match, since technically they are. I just use letters for readability.

    Anyway, maybe that can give you some ideas? I know it seems convoluted and a lot of events to run at once, but Construct does it all really quickly, and it works like a charm.

  • Health bars are fun. I like to set a maximum health number and then use that for a percentage calculation. Something like:

    Always set Healthbar Width to CurrentHealth / MaxHealth * MaxHealthBarWidth

    Alternatively, what you have should work just fine. The problem with it "growing" is that it's not actually growing, it really is shrinking. You have your Private Variable 'Health' set to an initial value of 0, so when Lugia gets hit by the wave he ends up with negative health. In Construct, an image with a negative size value basically just sort of mirrors/flips itself.

    Here's a "fixed" cap. Check it out!

    http://dl.dropbox.com/u/20459682/lugia.cap

    All I did was get rid of the initial "Always set Healthbar width to 65" due to redundancy since almost immediately after you set it to Lugia's 'Health'. Then I just set the value of Lugia's 'Health' to start at 70. Voila! Healthbar that shrinks as Lugia gets hit.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you post your cap? Easier to help that way.

    I tried something similar with Custom Movement and got something working pretty sweet, though in the end I've opted to go for the 8 directional movement behavior.

    The way I prevented the player from going through solids was by doing

    If Player Overlaps Solid

    --> Push Player out of Solid, Normal

    Gives mostly wonderful results. The push out of object action is a custom movement action that you can find near the bottom.

  • So I came across a discovery about five minutes ago. When using the normal Text object, setting the text to this:

    "Hey there, Max!"

    prints out this:

    "Hey there, Max!"

    Astute observation on my part, eh? <img src="smileys/smiley36.gif" border="0" align="middle" /> However, I love SpriteFont, because it's incredible. Absolutely incredible. But I've happened upon an interesting curiosity...

    "Hey there, Max!"

    prints out

    "Hey there,

    Max!"

    Upon further investigation, I've found that using a comma seems to automatically put a newline afterwards.

    "This is t,he mes,sage system!"

    prints out

    "This is t,

    he mes,

    sage system!"

    How frustrating. Did I accidentally switch on some sort of option, is it working as intended, or is it just another little bug? I know it's got some, though I've managed to work around pretty much all of them so far. Just wondering if I should just use a different character to represent comma instead.

  • You know, I think I remember that explanation before. Something about ticks versus timedelta or something, right? Which made me wonder why this formula is even working right in the first place. So I got rid of the wait functions and tested it out and it still worked fine. Which means I don't have to add the waits in! Thanks for the reminder! It's nice that Construct does actually perform the events in order.

    The updated cap, which uses an Array, which is what my game will be utilizing to keep track of stats.

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

  • So I've got a pretty spiffy damage calculation thing going on here. But it's got a couple issues.

    http://dl.dropbox.com/u/20459682/attack_calculator.cap

    This is basically the calculator I'm going to be using for normal attacks in my game. To use it, you just input the values desired into each of the locations, and then click the "Attack!" button. Then it automatically calculates damage and shows you the values for each step of the calculation. Fun stuff!

    One thing to mention is that because of the way the elemental detection works, the Attacker Element needs to be set to -1. Which brings us to our first bug...

    BUG #1

    I'm basically trying to use Find(Enemy Elements, Attack Element) > 0 to see if there's an element match in the EnElem string with the singular AtkElem. This works fine when:

    Attack Element = "f"

    Enemy Elements = "f"

    but if we change it to

    Attack Element = "f"

    Enemy Elements = "f, w, z" or Enemy Elements = "fwz"

    it seems like it returns 0 and doesn't modify the Attack Power.

    BUG #2

    I have a Critical Hit chance set up. The calculation is

    Attack Luck >= random(1024)

    --> Attack Power * 1.5

    I've tried to rig it in any number of ways to get it to work, from trying to set the delays a little longer to making it automatically attempt to modify the damage by toggling off the Luck requirement, and no dice. At least it's not reading these dice. <img src="smileys/smiley3.gif" border="0" align="middle">

    Any thoughts, gentlemen? They would be much appreciated! <img src="smileys/smiley4.gif" border="0" align="middle">

    EDIT:

    Just noticed now none of the modifications are actually working... what am I screwing up on?

    EDIT #2:

    So I did even further examining, looking over my events, still unable to figure out what I was doing wrong in the damage calculations and discovered... I was actually doing it right and it was working as intended. The bugs were actually in the display code, where it wasn't displaying the actual damage being done, just the attack power after Step 2. So the displayed calculations don't function properly but the actual damage done works correctly. If you take the enemy HP value in the last equation and subtract the number down at the bottom (the final enemy HP) it shows the proper damage was delivered.

    Oh, oversights! <img src="smileys/smiley9.gif" border="0" align="middle">

  • My wow, that's really cool. Looking at your formula also makes me want to rework mine a bit to make it look a bit nicer. Like how you threw the base HP outside of the whole bias calculations so that it added it after. Makes it look cleaner and helps with modifying it more easily on a character by character basis. Also what'll help me on a per character basis is being able to quickly see stat values and curves so that I can use it as a reference for coming up with character growth stats. You've given me a calculator I can use!

    Plus, it's better to have an example cap by someone who knows what they're doing than someone massacring a sweet calculation. So thanks! <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Even a quarter ellipse will do. <img src="smileys/smiley2.gif" border="0" align="middle">

    I have put a name to my pain!

    Bias

    This module calculates Ken Perlin's Bias function. Given an input value between 0 and 1, it calculates an output value which is also between 0 and 1 according to:

    y(x) = x^(log(B)/log(0.5))

    where the input value x and bias B correspond to the two input ports. If B=0.5, then y(x)=x. Values of B less than 0.5 push the output toward smaller values, while values of B greater than 0.5 push the output toward larger values.

    Source: http://www.artofillusion.org/docs/texedtut/chapter4

    So I played around a bit with it and came up with:

    ceil(18 + (("level" / 99)^(log(0.15) / log(0.5))) * 881 + "level")

    Essentially what this does is force Level 1 to be 20HP, and upon every level up you gain at the very least 1 HP, and the amount grows with each level up, until Level 99, at which it will end on 999 HP. I'm not huge into the ugly fix making it a 1 HP stat growth in the beginning, but it only lasts until around Level 10 or so.

    Here's the cap with an example!

    http://dl.dropbox.com/u/20459682/levelhp.cap

    It feels a bit convoluted though, so of course, I'm still open to suggestions! <img src="smileys/smiley4.gif" border="0" align="middle">

  • So I'm trying to work out some stat formulas for my game. I'm incorporating a level up system where the maximum HP is going to be 999, and the maximum level 99. I'm trying to get a healthy curve to the stat growth, but I can't seem to make it a smooth curve. I've played around a bit with lerp, qarp, and cube, but no dice. My biggest problem is I'm rubbish at math.

    Basically, I'm trying to do this:

    <img src="http://img560.imageshack.us/img560/986/statcurvegraph.png" border="0" />

    but I'm not much of an Ian Malcolm.

    Help me Obi-Wan Kenobi! You're my only hope!

  • Thanks for the props, Mr. Snooley!

    harrio - I'm sorry. I couldn't fit more Flashback in there. But the fact that the lyric that's sung over it fits with the game pretty swell is a good consolation prize! Still, blame the composers for not allotting enough time! Oh wait, that's me... <img src="smileys/smiley9.gif" border="0" align="middle" />

    - Cool game! A different way to platform! I also liked the mine cart segment. Brought fun memories of Donkey Kong Country! <img src="smileys/smiley1.gif" border="0" align="middle" />

    My top 3 choices would be:

    1. Families

    2. Hotspots & image points

    3. Good support for tilemaps

    All the other things, while really cool in their own right, feel far less important than the first 2 choices, and the 3rd one is just something that's been asked for by lots of folks on Construct Classic.

    Also, is there a "For Each Object (Ordered)" loop in Construct 2 yet? Maybe throw that one in their if it isn't. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • What I like to do is set up a few all purpose collision objects (namely a square shape and a triangle shape) and place them where I don't want players to go (usually also on a separate layer for organizational purposes), and then have the game turn them all invisible at the start of the layout. Then I leave my scenery on "no collision" usually, unless I really really need it to be. I don't ever notice any slowdown from this technique either.