Excal's Recent Forum Activity

  • Excal: I am learning via your learning :) You made your learning a community project - very cool. Tons of inputs from various minds. A peek over my should type deal.

    I think sharing of code is why the open source movement is so strong in the first place. It's a great way to learn. A lot of questions people ask in this forum are already implemented in various projects already, but most people aren't willing to share their .capx for numerous reasons that I understand.

    For those curious, this is my open source project. I'm glad it has helped you, DUTOIT, and I hope it can help others!

  • Now I feel guilty.

    But as others have pointed out, the problem is twofold: newbies don't want to take the time to learn, and those who do help tend to solve the problem and not explain how it was solved.

    If you explain how something is solved to me, I might have follow-up questions that expand on the method you used and how it might apply to other situations. This helps me understand your solution and be able to apply it to more than one project.

    Another issue is that there's no obvious learning path. If there was a stickied post titled "Learn to use C2" with links to tutorials to follow in order, then that might really help. Reading the manual is not going to teach us how to use C2. It's a great reference, but it does not actually give us steps to follow.

  • My issue lies in the backtracking, as I'm not sure what exactly the round(cos(90)) stuff is doing. Could you elaborate a bit more on that part?

    R0J0hound

  • R0J0hound

    Thanks for the more detailed explanation.

    I've gotten the direction and distance working, but it's building the backwards list that isn't working for me.

    <img src="http://i.imgur.com/SIRGp3P.png" border="0" />

    My dirs = "" at all times, and I'm not sure why.

  • <img src="http://i.imgur.com/3VVk1VC.png" border="0">

    Added two new fields for the highlight function. Each highlighted square now shows how far away it is from the current active object, as well as which direction:

    1 = left, 2 = right, 3 = up, 4 = down

    <img src="http://i.imgur.com/Ifco3i7.png" border="0">

    In the above picture, the computer AI selects an object based on highest range, determines the closest player object to it, and sets it as the target. Then it highlights all available moves the program can move:

    <img src="http://i.imgur.com/bEW1WLa.png" border="0">

    However, what it needs to do next is construct a direction list so it knows how to move from its current square to the square closest to the target.

    <img src="http://i.imgur.com/SIRGp3P.png" border="0">

    I call the PathToDestination function earlier (scroll up).

    However, my "dirs" variable always equals "" and I'm not sure why. Can someone take a look?

    vee41 maybe? I know, I ask you too much :(

    R0J0hound, my events are based on your example, except instead of creating the squares on the board and then moving, I highlight the squares, then assign distance and direction variables only to the highlighted squares.

    BoardGame.capx

  • I'll try to figure out what is going on, but an explanation of implementation from someone who has implemented direction backtracking would be nice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you can figure out how to convert from an on-map scale to pixels, then you should be set.

  • I believe he means stretch.

    Scale outer only works for a small number of games. Other games that need an exact fit don't work well with scale outer, and I hope there is some sort of solution or way to make letterbox scale work in the future.

  • Check their position in relation to viewports, and then destroy accordingly.

    For Each Object

        Object X < ViewportLeft -> Destroy object.

        Object X > ViewportRight -> Destroy object.

        Object Y < ViewportTop -> Destroy object.

        Object Y > ViewportBottom -> Destroy object.

  • I'm a bit skeptical. Reducing file size by massive amounts without any loss in quality seems too good to be true.

  • There is an official, stickied thread in this exact forum for this.

  • R0J0hound, I'm reviving this thread because the issue has come up again.

    I resolved player movement by requiring the player to select squares one at a time. I also believe this is the most optimal thing to do, as multiple paths to a location definitely require player decision.

    However, I am now working on implementing the AI for the computer player and need to discover how to move a computer object to a designated spot.

    <img src="http://i.imgur.com/2ZUNnrW.png" border="0" />

    So here you see the computer has selected one of its objects and highlighted the possible moves for that object. There are two relevant global variables:

    <img src="http://i.imgur.com/fp2igWg.png" border="0" />

    ComputerProgram is the UID of the object the computer has selected.

    ComputerTarget is the UID of a player-controlled object that the current computer object is trying to get to.

    It won't be hard for me to do a distance check and find out which highlighted square is closest to the target. However, I need a way to find out how the computer object is going to move there (what sequence of highlighted squares to move to). I fired up your .capx and found this section to be of great interest:

    <img src="http://i.imgur.com/GGOqrDu.png" border="0" />

    Could you go into a little more detail on how this works? I assume the default values for dirs is just for placeholder.

Excal's avatar

Excal

Member since 9 Mar, 2013

Twitter
Excal has 1 followers

Connect with Excal

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies