### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - homeofdeath212

Pages: 1 2 3 ... 9
1
##### Ask a Question / Re: Need help with calculations for a HP Bar
« on: July 24, 2019, 11:43:06 pm »
Any time HP are depleted, do something like this:

1. Make an attribute called Old HP Bar Stacks and set it equal to floor of (For Boss get _HP) / Max HP Per Stack
2. Subtract damage from boss HP
3. Set HP Bar Stacks to floor of (For Boss get _HP) / Max HP Per Stack
4. If HP Bar Stacks < Old HP Bar Stacks then a stack was depleted.

I got it to work thanks to this. Thanks again!

2
##### Ask a Question / Re: Need help with calculations for a HP Bar
« on: July 23, 2019, 07:07:35 pm »

You can replace the code in HP_Bar_Update with the following two blocks:

Set Current HP in Stack to remainder of (For Boss get _HP) / Max HP Per Stack
Set HP Bar Stacks to floor of (For Boss get _HP) / Max HP Per Stack

Then you shouldn't need to keep track of HP lost unless you're using that statistic for something else

Amazing. I wish I knew all of this earlier. Thanks!

However I do have another problem now though. I can't seem to figure out now "when" exactly is a stack depleted. I wanted to track it so that I could be able to change the color of the hp bar whenever a stack is depleted.

Anyway to do this?

3
##### Ask a Question / Re: Need help with calculations for a HP Bar
« on: July 23, 2019, 01:02:56 pm »
Divide HP by 5000. The quotient is the number of stacks. The remainder is the HP left in the current stack. Divide the remainder by 50 to get percent of stack remaining.

The remainder block is in the math palette. To get the quotient, take floor of HP / 5000.

Pardon me if you don't mind but can you elaborate more on this?
Also I've attached additional code in case it helps

4
##### Ask a Question / [Solved] Need help with calculations for a HP Bar
« on: July 20, 2019, 09:38:07 pm »
As the title says, I need help with calculations for the hp bar I'm working on.

Desired result:
The HP bar for the boss has X(let's say 20) stacks. Each stack is 5k hp. The boss has 100k hp so that means the hp bar would have 20 stacks. Each time the boss losses 5k hp, a stack is deducted and the hp bar fills up again but this time instead of x 20, it would say x 19 and would repeat the process until the boss is dead.

I got most of that to work as intended. My problem is that the hp bar won't fill up to max (only up to half at most) whenever a stack is deducted and it needs to be refilled again.

Bonus: How does coloring work exactly for image instances? Because with the image I use, the colors all don't show up correctly except red. (Example: https://www.youtube.com/watch?v=85tj-pc80A8&feature=youtu.be [look at the hp bar below] )

The code I've used so far:

5
##### Ask a Question / Re: Need help with calculations regarding actor orbiting another actor
« on: July 20, 2019, 07:56:38 pm »
I now fully know what those are for. And I got the whole thing fully working as I intended. Thanks again Liberado!

6
##### Ask a Question / Re: Need help with calculations regarding actor orbiting another actor
« on: July 20, 2019, 12:41:18 pm »
This is exactly it! Thanks for the help Liberado

I do have a question though. While I think I got the gist on how it works, I cannot control how fast the cycle speed goes. I tried messing with the 'angle' attribute and 'degrees' actor value but it seems like it only breaks the circle into a jumbled mess. What should I tamper with to adjust the speed?

7
##### Ask a Question / Re: Need help with calculations regarding actor orbiting another actor
« on: July 18, 2019, 05:16:35 pm »
Store every created drone into a list. Whenever a new drone is created, add it to the list, then loop through all items in the list and reposition them accordingly, since your code can already move to the desired position.

Fixed the image being absent. I tried to see if I could get the image to show up without having the download link for the image attached.

8
##### Ask a Question / [Solved] Need help with calculations regarding actor orbiting another actor
« on: July 18, 2019, 03:58:32 pm »
As the title says, I need help with some maths.

Desired result:
The player ship spawns drones with a very short intervals between spawns (say, 0.5s before another drone is created).
The drones would then align themselves around the player ship according to how many drones are currently online.
Let's say 4 drones are currently online so that means 360* / 4 drones = 90 degrees would be the distance in a circle between each drones.
Then eventually the 5th drone goes online so that means it's time to recalculate the distance between drones in a circle. That would be 360* / 5 drones = 72 degrees.
How would I implement this into code? The current code I have only seem to get where the drones would end up in the circle right but the other drones won't adjust themselves to accommodate the new drone.

Bonus: I don't know if this matters but whenever the drones are firing they slow down their orbiting speed and when a new drone is created in the meantime, the drone would overlap with another drone.

Edit 1: I just noticed that the [ (no. of drones) / 360 ] in the equation. I fixed this part of the code by making it [ 360 / (no. of drones) ] but it didn't fix my problem.

Edit 2: re-linked picture. I'm still confused how the forums work when attaching things.

This is what I tried so far. Thanks in advance

9
##### Windows / Mac / Flash / HTML5 / Re: W.I.P Project : Galaxiconia
« on: June 09, 2019, 01:06:25 pm »
Did a few things:

1. Added glow to projectiles. They look shinier now. Not all have it yet. Also planning to add glow to things that need it and is not limited to projectiles. I do fear how it'll affect my FPS even though I'm using the image api for it.

2. I successfully recreated the HP bar I've wanted to make... sorta. Unfortunately my calculations are off. Also I'm having trouble with the tints. They keep showing up darker than what I intended

3. Had to do away with the light rays during a mini-boss' death cutscene(replaced with glowing explosions). Will try again one day when I'm more adept in using soft lights.

4. Almost forgot to mention that if your ship goes behind/below any HUD interface, the HUD would set its opacity lower so that you can still see your ship... or any enemy ship that happens to be below the HUD.

Video:
https://youtu.be/85tj-pc80A8

10
##### Windows / Mac / Flash / HTML5 / Re: W.I.P Project : Galaxiconia
« on: May 12, 2019, 09:32:08 pm »
Close enough

Looks like I need to polish this more for this to look decent.

Also, I'll take me some time to get the new game link up since a few  things broke when I made the switch from 3.4 to 4.0 and they're vital to the gameplay.

[edit: pardon for the bad quality of the .gif. I never noticed Stencyl had a 8mb limit before]

11
##### Ask a Question / Re: Problem with number increment in decimals
« on: May 12, 2019, 04:28:53 am »
Are you sure you're not overwriting value of this attribute? Right click on the palette [set apply effect percentage] and show in behavours.
I'm pretty sure that's the only place where the [set apply effect percentage] code is used.
The numbers I get is accurate to what I want but it seems like random decimals are added for no reason.

It's in the Maths section. Or you can just search "round", duh
If I'm not mistaken, that's for rounding decimals to integers right?
I meant rounding decimal places like [0.12342] to [0.1] or [0.21241] to [0.21].

12
##### Ask a Question / Problem with number increment in decimals [Solved]
« on: May 11, 2019, 10:56:24 pm »
Can someone tell me what's wrong with my code.
I cannot understand why the output should be like this:

Code:

Off-topic:
Is there a way to round to the nearest [eg. Tenths, Hundredths, etc] decimal?

Edit:
I believe that's just how floats behave.

Welp. I didn't know about that. I'll keep this in mind from now on then.

Corbanwolf's suggestion might do the trick. Alternativelly, you can multiply the value up to the desired decimal point, round it, then combine that as text with "0." to get the display as you want.

I tried this and it gave me the results I needed. It's roundabout but I guess I'll take what I can get. Thank you and Corbanwolf for helping me with this

13
##### Windows / Mac / Flash / HTML5 / Re: W.I.P Project : Galaxiconia
« on: May 09, 2019, 09:11:08 pm »
Pardon my absence.
I was busy(+burnout) for the past months that I didn't work on the game during that period.
I only started working on it again in mid-april so I don't have much to show you.
So here's the little progress I can show:

The 1st boss is "finished". Aside from the needed HUD components for the boss, the boss is complete. Had to cut some attacks from the boss.
However I still have add more effects for the boss fight(the death cutscene for the boss and mini-bosses) so I hope this weekend I can get them implemented.
Here's a video:
https://youtu.be/q9Y57MLaoDg (full boss fight)

I still have to implement the boss' hp bar so I'm thinking of putting the hp bars of these games into mine and see if I can replicate it.
https://youtu.be/ZNaEeGdIAxc?t=1333 (top middle of the screen)
https://youtu.be/GnX0uZnagi4?t=175 (top middle  of the screen)

Hopefully it translates well into my game.

Also to address one more thing:
If you're aren't aware yet, the demo is broken. So I'll either have to hastily make a new release version or try to get that demo fixed. I will get this fixed as soon as possible whatever solution I stumble upon first.

That's all so far and again, pardon for my absence but from here on out updates will be "constant" again.

14
##### Ask a Question / Re: "Cannot Add Listener Function To Null Actor" How to avoid this?
« on: April 20, 2019, 10:29:37 pm »

Do you mean creating actors in the dashboard? I believe so as each actor would have its assets stored separately.

Have you not thought about using images instead of actors for the shield?

Then just use a boolean attached to your actor that checks if the shield is active, and code to check how close a projectile is rather than use collisions.

It seems like I guessed right then. Good thing I got the shield behavior working or else I might've need to bloat the game.

For images... I didn't as I needed the shield to collide with the player too(but not damage) and make the shield look like a physical object. If I made into an image, it might be hard to code in the collisions needed to achieve that. Not to mention the shield also has animations which I haven't learned how to do that with images.

@homeofdeath212, you could do it this way:

I forgot that existed. This did exactly what I wanted. Thanks, Liberado.

15
##### Ask a Question / Re: "Cannot Add Listener Function To Null Actor" How to avoid this?
« on: April 18, 2019, 03:09:35 pm »
Yeah I have also had this issue in the past. I don't think the error causes any problems though. But it would be interesting to hear if anyone has a good solution.

It doesn't cause the game to crash(I saw this error from the logs) but the collisions won't work

You'd need to attach the collision event directly to the shield actor.

Seems like there's no other way then.

Anyway, does creating multiple actor types using the same visuals still increase the size of the game file?
I tried doing this method to save space(and convenience) but I guess that's not possible

Pages: 1 2 3 ... 9