CJD's Forum Posts

  • Each AI instance actually has room for option 2, but I didn't think I'd ever need to utilize this as a method to get it to work.

    Each AIHolder has a Variable "Entity ID" or EID, which it would use to spawn a sprite according to that EID.

    I won't be doing the keep each AI instance as a unique one, because thats not the direction I'd like to take.

    Its the easy path out and although attractive Id have to make a unique instance for every AI Id implement, and likely copy and paste code for each.

    So long run, not optimal, also not as customizable as it would first seem.

    I'll first try the family method then try the dummy sprite method ( since there is room for it and it was technically planned, kinda ).

    Thanks for the reply, I'll be back with you if it is or isn't the solution.

  • This isn't relevant to the problem but it does show in action how all of this works.

    These are gifs of my AI in action.

    Interceptor ( when it sort of works )

    i.gyazo.com/fe2823c08cc625c7cd208861d2144937.gif

    Aggressor

    i.gyazo.com/f5f8930650db6a83490a6764fc3d174d.gif

    Self-Preservation

    i.gyazo.com/dc5e3e126ff960110c22a78fdd6fd162.gif

    So this is proof of concept that this does work, but I have to fix it after adding something new just about everytime.

    And yes this does still hold up when there are multiples of the same instance, I make sure of it with condtions and variables narrowing it down, this thankfully still works even at the current version of this project.

    This also works without families, and If possible I'd like to keep it that way.

  • The idea for this custom AI behavior is an Interceptor,

    If me the player is busy with dealing with AI #1,

    AI #2 will jump in when I'm in engagement distance of AI #1.

    I previously had gotten this to work, but every time I add a new AI Module/behavior, it breaks, or something breaks, Bit tired of Construct's Path finding behavior and if this keeps up I'll just have to make my own, which ive seen people suggest doing in the forums.

    I don't want to do this because I've already broken through so many hurdles people usually give up on with this path finding behavior and I would love to share what I found to finally give people answers that traditionally, forums go inactive due to not having a solid answer for.

    I'll send picture of the project file, I know I'm going to get questions as to why its messy or, why I'm using so many "unnecessary events", which will give me extra to read into so when you get a hold of this picture, try to refrain from mentioning it;

    Now because I agree that these questions are valid, know that I can always minimize my project later on.

    Also, everything in this picture is required for the AI to function,

    This is a test bed project so everything is very minimalistic.

    So although I doubt it'll be brought up, just incase, try not to divert your focus; We cannot solve this without your 100%.

    The picture will show the structure of how events should play out in order and what most of the relevant ones ( to this problem ) do.

  • This works! With some modifications.

    ( I had already thought of this part )

    I made a library/table for the possible connections and exceptions, integrating that with this connection system ( with modifications being that I have it move to invisible sprites named "Receiver" and "Sender"; Sender being where it starts and Receiver being where it ends. ) These invisible sprites always position themselves with a function kinda like an image point.

    This way I don't have to copy and paste this whole thing over and over for each function.

    For communication I have a group referencing everything in the library/table using event triggers, then a variable in each function to confirm the connection was correct.

    It runs a script in the background that gives the function its functionality, I plan on doing this to objects in my game, there will be the fake coding system you can see with the rest being handled by a script in the background ;)

    I had always thought of how Id approach it, but upon tinkering with the connection part; It seemed to have been abit more of a challenge than initially thought.

    Weird too because I thought giving each function functionality would be the hard part.

    Definitely crediting you for this! You have no idea how frustrating it was for me when I have everything else done but this small little detail!

  • I'm legitimately considering using the Javascripting service to get around this problem because at the current moment I don't have the brain power to understand how Id use the code-blocks C3 offers to make what I'm trying to make.

    I suppose I should explain what it is I'm making:

    I am making a simplified, dumbed down coding interface for a game I wanna make.

    But I need some way to get every expression/variable the player uses to interact with each other and send data so that the player can make their own "script".

    The way I was planning on going about this was, I have a variable ( those "and", "Function", "OBJ", "Then", etc etc sprites you see on screen ) Then by clicking on one variable and another, you make a link.

    This link sends information which is then processed by the system to get a read on what the player is writing for example:

    IF > OBJ( Door ) > MEM( Closed ) Then > MEM( Open )

    Super simple; Causes a door to open if its closed, and it gives my game something unique I can build puzzles around.

    I think Id be done by now if I could reference objects using variables but C3 simply won't allow it and trust me I've looked up and down and read paragraphs worth of stuff on their system expressions & variables help page for an alternative way of doing it.

  • Pardon the late response: This method *works* but there are acouple problems I've had with it.

    Firstly, I obviously can't move the object I make a connection to otherwise the link will break ( I mean by using a drag and drop behavior ).

    Secondly, when it comes time to connect different objects together; They actually won't connect unless I make a variable for every possible connection.

    ( Which I won't do because I value time quite abit. )

    This gif shows both problems in motion:https://i.gyazo.com/9113f1d48c56c5b87e151cf839f6ce31.gif

  • Can't seem to get that to work,

    I might just have "CurrentSelected" do what it already does and simply use it to store data on what I have selected.

    Have a group store every possible connection referenced by two instances of CurrentSelected,

    Then have two instance variables on the link beam ( link 1 and link 2 )

    Along with a third called "Data" to return the type of connection made based on the name.

  • lionz So for reference I have a Global variable " CurrentSelected " I set that to the UID Of the last object I clicked before clicking the second object and making a beam between the two?

    I'll try it, sounds like it might actually just work.

  • So, I want to make a beam from an object I selected to another object I select later.

    I represent that object I selected with a global variable.

    Now obviously when I do this, I get an error "'CurrentSelected' is not an object. "

    Because it's obviously not an object:

    But this is frustrating because in other game engines I can do this just fine as long as I wait for the game to create that instance of that object with something like " waitforchild("Childname") " The child's name being stored using a global variable.

    I can't do this in Construct 3 the traditional way, so how would I do it the funky construct 3 way?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interesting, it's a good thing I have reason for it, and it isn't just because I don't know how to compact it.

    Even if I didn't there is plenty of room for finding out.

    But either way I consider this topic closed as I ended up figuring out what the problem(s) were on my own whilst showing how it was done.

    As stated in my finished post I may show how you'd go about doing this and by then adjustments would be made.

    Some are quick to assume that it was a beginner issue, and I was kinda hoping to avoid that by asking to get straight to the point which didn't happen until I explained the problem further, which led me to the answer, which was literally a button click away, wheeze.

  • Why additional events, waits, trigger once etc.? Just spawn the bullet in the same event you set the "fire" animation and adjust its angle of motion. And give it "Destroy outside layout" behavior, so it would be destroyed automatically.

    The reason being I can interact with each individual part; general rule of thumb is to inflate a project before compacting it.

    That plus I like individuality and I may come up with a unique way to tackle a problem in the process.

    Can't always do that if I'm doing what everyone else does.

    But yeah, your definitely right; I will compact it in the future when the game releases as it'll be critical when I want to add more firearms.

  • Now I can add recoil separately from the accuracy of the gun, just to be more realistic.

    I may make a " How do I " page that answers this question and shows how to make everything in my game.

  • Now for anyone curious as to how it looks: Here you go.

    https://i.gyazo.com/88d53f0324aaf87b852915118259339c.gif

  • Okay so it did work, I had to make some adjustments to how it's done, instead of using bullet angle I just used the default angle thingy.

    For the shotgun nonsense I just put a trigger once, so that's wrapped up and doesn't do it anymore.

    So, for those of you whom are curious it seems bullet angle works best with a randomizer constantly changing its current value, say it stored somewhere as a number variable.

    I didn't do that here, because that'd be bulkier, I think.

    I simply used angle and what I wrote was this:

    " Gun.Angle + int(random(10, -10)) "

    Gun.angle is where the gun is facing, make sure it has a second image point thats set to the end of the barrel.

    Then you put a plus and ADD the randomizer of your choice.

    All I have to say is I love it when I end up fixing my own problems.

    Always use debug ladies and gentlemen, always; Otherwise you'll spend a year like I did trying to figure this out on my own before giving into using forms.

    ( Which isn't bad, always ask for help even if its literally copy and pasting code. )

  • Ok so I found something quirky with this, apparently more than one bullet is spawned even though, the event itself only spawns in ONE bullet.

    I'm going to tinker with this, if this just so happens to be the problem, I'm going to laugh.

    Trying to add a Trigger once while true event while this happens, see if that fixes it.

    Then I'm going to share how I fixed it to everyone here so that if another person has this problem; I can show them how to fix it.