Ethan's Recent Forum Activity

  • if sprite.IID = 1, set animation frame to sprite(2).framenumber

    Put a 2 in brackets just before the . and frame number to pick the sprite in an action.

    Alternatively store sprite 2's animation frame in a global variable and set sprite 1's to the value stored there.

  • There is a js library for vector graphics here http://paperjs.org/.

    Some one just needs to make a plugin, which would be cool.

  • its really only blank screen?

    What browser are you using? All i got was a black screen on Safari, the arcade has never liked Safari though, but it worked fine on Chrome.

  • Really great! A lot of fun thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks everyone.

    I used R0j0's method shortly after he suggested it which works fine, but i'll certainly look at yours korbaach, and Magistross thanks for taking the time show how to do it with Regex as originally requested, really impressive, it might be a quick and neater alternative. The reason i wanted to use Regex was because i'm used to using tokens to search strings and could have done it that way if the replace function could specify a particular token index instead of replacing all occurrences.

  • You add the IID (not UID) after it.

    Firstobject(0).x

    Edit: sorry i probably misunderstood your first post. I don't know if the above was what you wanted.

  • The game art looks nice, but the hud is a mess in my opinion and doesn't match, even the drop shadows on some of them don't match the direction of the rest.

  • Thanks R0J0, it's good to get an outside perspective on the problem.

  • Ok i need a bit of design advice.

    I'm currently working on the ai code to my game. I've split the logic up it into various stages. I've done the tactical and capturing stages and i'm currently working on the recruiting stage.

    Basically you get money for capturing towns. Your commander unit is the only one which can recruit new units, and must be on a keep tile to do so. New units when bought are spawned on connecting castle tiles. It's a copy of the Battle for Wesnoth system which i prefer over other tbs games.

    Right now i simply have a routine to work out which units to recruit based on the enemy units on the board.

    I loop through all the enemy units, record their weakest stats in a list, loop through the ai units, for each one that can beat an enemy unit in battle i delete it from the list (as they will move and attack them in the tactical stage). What's left in the list are all the enemy units the ai needs to recruit against as it currently has no units on the board that can beat them in combat. I then prioritise their creation by finding the enemy units, that are the biggest threat, that the enemy has the most of, and recruit a unit that can beat it in combat first.

    My problem is i have a number of variables the ai needs to take into account to decide - when to move to a keep, which keep to move to, and what units to recruit.

    Heres how my system works. It's a work in progress so other variables can be added later to improve it, but for now i use the following-

    Check to see if ai has any money, if not then skip recruiting.

    Check to see if any empty keeps with empty castles are in move range, if not then skip recruiting.

    For all those keeps within move range, that are empty and have empty castles, generate the following scores.

    The distance of keep to Commander.

    The number of empty castles keep has.

    The number of enemy units in attack range of the keep and the combined damage score it could inflict on commander if it moved there.

    The units the commander needs to recruit to oppose each of those enemy units, and the combined cost.

    Whats the best method to use and combine the information i have to pick the best keep to move to and which units are a priority to recruit?

    For example, the commander obviously wants to move to the safest keep, but that might only have 1 castle connected to it, where as it might have enough money to recruit lots of units.

    I guess i'm wanting to figure out a way to somehow combine all these values into one general score or something.

    Any suggestions or advice?

  • Ok i'll try that thanks for your help.

  • Does any one know how to delete any duplicate numbers and letter from a string using regex?

    For example if my string looks like this

    "112, 113, 112, 114, 113, 112,"

    it would be turned into this

    "112, 113, 114".

    I've been looking into regex but it's over my head.

    Thanks.

Ethan's avatar

Ethan

Member since 20 Jun, 2007

None one is following Ethan yet!

Trophy Case

  • Coach One of your tutorials has over 1,000 readers

Progress

17/44
How to earn trophies