Rhindon's Recent Forum Activity

  • CAPX: sugarsync.com/pf/D6025908_4317202_6992586

    === PLEASE SKIP DOWN BELOW TO THE UPDATE ===

    Starting at line 3 on the "ES Enemy" event sheet, I'm attempting to set up conditions that tell the Enemy instance to find the nearest PatrolNode within the NodeZone (so that it doesn't try to find a Node outside the proper patrol zone even if that other Node is closer) and then follow the patrol routes I've defined.

    The enemy will go through a series of statuses:

    1. Normal - within each NodeZone, follow the patrol routes setup by the PatrolNodes within that zone.

    2. Chase - the enemy will chase the player...

    3. Alert - the enemy will randomly search for the player within a range from the last point it saw the player.

    4. Resume - Return the the enemy's assign NodeZone and resume the patrol as defined by the Nodes in that zone.

    But at present all I can get to work is the chase, alert, and resume statuses. The enemy will not even select a Node to seek out. Can anyone see what I'm missing?

    ===========================================================

    UPDATE: Related issue but not quite the same as before.

    In the "ES Enemy" event sheet, line 12, I'm trying to pick those patrol nodes that are within a particular zone.

    The enemy and the nodes are assigned the zone's IID - it's "home base". This way, after a chase, it can return to its original patrol area and not just any patrol path.

    So, after a chase...

    • Pick all patrol nodes which have an HomeZone instance variable value equal to the HomeZone instance variable value of the enemy.

    -- From those patrol nodes that are picked, further pick the nearest one to the enemy.

    -- Find path.

    Everything works up to event line 12. But for some reason the enemy will not return to the node it's closest to within its own zone.

    Also check out the "ES Setup" event sheet, lines 4 and 5. That's where I assigned the IID of each patrol zone to the HomeZone variables.

  • Excal - That's a great idea! Make sure you submit it to Ashley in the suggestions forum.

    R0J0hound - On that note, I would THINK it ought to still act accordingly for each instance (without the For Each loop). If it works mostly as it should without the Trigger Once, then all Trigger Once should do is work once PER instance if true. It doesn't make sense to stop it altogether for all instances just because ONE instance meets the conditions.

  • - Haven't used the Turret behavior yet, but yup, that would make perfect sense.

  • Bl4ckSh33p - Atually, before Ashley added the LOS behavior, that's exactly what I was doing. :) lol

  • Thank you, wizaerd and :) I now feel legit. LOL

  • How would it work to add a debug feature that makes the field of vision cone for the LineOfSight behavior visible during preview mode or even during actual gameplay? This could really help me in fine-tuning how far and wide the cone is.

    Sound good? :)

  • blackhornet - Dude. Stunningly amazing! I'm still looking it over, but I think I've kinda got the gist of what you've got going on. But I'm confused on one part.

    Line 39...

    Pick Node by evaluating NodePatrol.UID <> Enemy.CurrentNP

    What in the world is the " <> " bit? LOL I've never seen that before.

  • blackhornet - Dude. Stunningly amazing! I'm still looking it over, but I think I've kinda got the gist of what you've got going on. But I'm confused on one part.

    Line 39...

    Pick Node by evaluating NodePatrol.UID <> Enemy.CurrentNP

    What in the world is the " <> " bit? LOL I've never seen that before.

  • blackhornet - Hmmm...

    Well, a friend helped me identify one problem. I had quotation marks in the Properties field for one of my variables. So the editor was literally looking for ""String""... Heh. I'm going to look things over from there and see what I can resolve from there.

    But the short explanation goes like this:

    PATROL: Find path between designated PatrolNodes.

    CHASE: Find path to last known location of Player.

    ALERT: Find path within a radius from last known location of Player, search randomly for a brief time.

    RESUME: After some time has passed, if Player is not found, return to nearest PatrolNode and resume PATROL status.

    That's basically what's supposed to happen. Does that help at all?

  • blackhornet - LOL Trying to be, truly. But as you can see, I can already say a lot when I'm trying to be brief. Anyway, here's the capx.

    sugarsync.com/pf/D6025908_4317202_6840595

    Look for event sheet "ES CharEnemy", starting particularly at line 17, though lines 13-16 also factor into things.

  • blackhornet - Aye. In my learning and testing, I've found that to be more so the case than not. In trying to isolate a larger problem I'm facing in developing my enemy behavior mechanics, I'm presently attempting to isolate and identify where things work and do not. At one point, I did have the "On path found | Move along path" event set outside the whole series of events and loops that controlled enemy movement. I switched it inside the loop(s) just to test some things...

    Ashley - Thank you, sir! :) Someone newt shared with me a short tutorial on how For Each loops work, so now I'm trying to better implement (or remove) the use of them. My question here is simply trying to better understand the limitations of the functions that the loops have. Kinda like asking, "The rocket fires up...that's its function. But what's its limitation? How FAR UP can it go?" Hopefully that makes sense.

    Your point that For Each has no true/false factor is one such limitation (or quality, I guess) that makes things much clearer for future reference.

    Ultimately, what I wanted to ensure happen was that ONLY each instance whose path had been found would actually move along the path. This was before I fully/better understood how For Each works. I had previous implementations of my enemy behavior that had multiple instances moving when maybe only one or two should have done anything. That led me to thinking I needed For Each regularly...apparently not.

    ...Hmm...would it help if I shared my capx?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have this basic scenario for my game:

    For Each Enemy

    -- Find Path

    -> On path found | Move on path

    "On path found" is, of course, a trigger.

    Can someone explain to me why a trigger doesn't work inside a loop like this?

    I'm finding I have to be very careful with my For Each usage (and sometimes finding it's even redundant...). So if I could get some clarification, that would be wonderful. Thanks!

Rhindon's avatar

Rhindon

Early Adopter

Member since 8 Jan, 2013

Twitter
Rhindon has 2 followers

Connect with Rhindon

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies