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 - dreph

Pages: 1 2 3 ... 10
1
Ask a Question / Re: How to make enemies detect each other?
« on: November 09, 2018, 01:35:02 pm »
Thanks for that! It's good to know I can get away with it.  I might be able to use simple physics as well because I'm not using gravity for this project.

Also, I was referred to the Easy Math extension a week or so ago, but it's easy math.  I figured that stuff out already. :)

2
Ask a Question / How to make enemies detect each other?
« on: November 09, 2018, 11:35:26 am »
Ok, so let me start off with my understanding of things.

I have a player follow behavior, it checks player 1 (and 2 if two players are on screen) and adds their X and Y locations to a list.  I used a loop to handle it all, and everything is working splendidly.  X and Y locations for Player 1 and Player 2 are being tracked in a list and all is well.

Now, what I want to do is actually have the enemies stay away from each other... but I have two ideas for an approach to this logic and I would love some input.

My first approach is to create a new list for enemy locations.  The problem is that I plan to have approximately 12-16 enemies on screen at once at some point, and I want to know, before I jump too far into it, if anyone has experience messing around with Always updating a list and issues with performance? 

My second approach is to make each enemy a "sensor" and compare their own X/Y locations to the last collided enemy actor, and adjust accordingly.  Currently the enemies move directly towards the closest player, but I'm sure that I could easily add a quick "if not colliding with enemy group" to their follow behaviors, and have them avoid their buddies by "if collided with enemy group, compare X/Y and move away"

What are your thoughts? I would love to get some feedback before I delve in.  Thanks!

3
Ask a Question / Re: Dropping/Stacking Items
« on: November 09, 2018, 10:09:55 am »
For me, that happens when a high-cpu intensive event happens under "When Updating", but without logs I cannot be certain.  I wish I had more to add.

4
Ask a Question / Re: Dropping/Stacking Items
« on: November 08, 2018, 01:22:09 pm »
So, when it crashes, what is the error you receive?

5
The easiest approach for this is to store these scores as two attributes.  You can have a currentScore attribute and a lastScore attribute.

Have the lastScore be a game attribute, and the currentScore attribute as the score value that is tracked.  At the end of each level, set lastScore to currentScore, then if they die or have to restart, make sure the scene sets currentScore to lastScore attribute.

That should do it. :)

6
Ask a Question / Re: GoTo Line Equivalent for Stencyl
« on: November 08, 2018, 01:07:02 pm »
A quick Google search answered the question for me.  "Spaghetti code is bad practice, and Haxe does not have this functionality.  Use conditional loops instead as they are much more clear"

Back to the drawing boooooard!

7
Ask a Question / SOLVED - GoTo Line Equivalent for Stencyl
« on: November 08, 2018, 12:57:00 pm »
Is there a way to label a statement, like most other languages, and have a GoTo <label>?  Even command prompt has a GOTO function, I just don't think I've seen an equivalent in Stencyl blocks.

8
Actually, just like I mentioned I don't think it should have been working to begin with.  I believe it was the order that the scripts were running, but the fix was to add a delay to changing "Spawning" to false after EnemyCount > 0

Hope this example helps anyone running into issues like this.

9
Howdy! So I'm having a strange issue, and it's likely that it should not have been working to begin with, but here it goes.

I am working on a Spawn Enemies script.  The concept is that once the player(s) get to a certain point on the screen, the enemies spawn AND then it sets the next checkpoint for enemy spawns. As of yesterday, this was working perfectly.  It would increment the CP attribute by one, and get the appropriate coordinates for the next checkpoint.  I was playing around with making it a bit more complicated, but then it started incrementing all the way to the last checkpoint immediately after the enemies spawn at the first checkpoint.  What did I do wrong?  Any input is welcome.

I'll check back in if I figure it out before anyone is able to give input.  Sorry for delays in replies I'm also taking care of a newborn.

10
Ask a Question / Re: Set Offscreen Bounds clarification
« on: November 06, 2018, 04:35:22 pm »
I read somewhere that this affects ALL actors, is this true?  Or is it only for the actor that is attached to?

I figured it out.  It seems to affect all actors, but the Top, left, bot, right do not require extra math.  It seems like the blocks acts more like additional padding outside of that side of the screen.  Thanks for the input.

11
Ask a Question / Set Offscreen Bounds clarification
« on: November 06, 2018, 04:06:52 pm »
So, when I set offscreen bounds, does that mean in relation to the camera or in relation to the scene?  Just curious.

12
Ask a Question / Re: Jumping While in Air/Falling
« on: November 06, 2018, 04:05:00 pm »
Sorry for the delay, but it is because you are setting the y-speed of the actor instead of pushing the actor or setting velocity.  Therefore, when the actor jumps, they never stop jumping because nothing in your code stops the actor from "Set y-speed"

If you use push actor or set velocity, that alleviates this and utilizes gravity.

13
Ask a Question / Re: Jumping While in Air/Falling
« on: November 02, 2018, 12:32:48 pm »
Ok, so I had to look at the code a few times, but I think I know where you need to start.

First off, you have a Touch Floor attribute.  You need to make sure that this attribute is being triggered back and forth appropriately.  With that said, you need to make sure that the platforms are in the appropriate groups and not just "Actor" which is default.  Check your Actors for the platforms and make sure they are in the Falling/Unmoveable Platform groups respectively.

Secondly, you have two places that involve "action1".  One of them is an input trigger, and one of them is under "when updating" for input.   You only need one of those in action to initiate the action. 

Finally, during your "when updating" portion, you have a spot that automatically sets the y-speed in a downward direction if "Touch Floor" is false.  Depending on how your logic is going to be finalized, you may want to rework how falling works and utilize gravity and pushing the director.  Hope this helps.

14
Ask a Question / Re: Make a projectile do damage to enemy
« on: November 02, 2018, 09:11:48 am »
That was probably it, honestly.  However, I have often gotten away with not using the underscore before the attribute name using the same block.  Example, my working script for the enemy damage was calculated by subtracting the projectile's ATK attribute from the current HP did not require the use of the underscore.  I have seen it require it a lot but never had this issue... just weird is all.

EDIT: Actually, I'm having an issue with the same block doing something else!  I can't get the information using the appropriate underscore and everything is right, so it seems.  Take a look.  Everything shows up as zero unless I manually type in "640" for the first checkpoint, then everything fills in appropriately.

EDIT 2: It seemed to actually be a timing issue.  I delayed setting the attribute by .1 seconds and all came up ok.  I'll try to keep in mind that not all of the behaviors will spawn completely right at the beginning.

15
Ask a Question / Re: Make a projectile do damage to enemy
« on: October 31, 2018, 05:51:29 pm »
I took a different approach and made it work from the side of the enemy, so it's fine.  I'm just curious as to limitations of the engine. Thanks!

Pages: 1 2 3 ... 10