• 0

    posted a message on Orders

    think I found something....

    worth testing on larger scale anyway:

            Value: Pathing Cost Between Points
                Point 1: Center Of Region
                    Region: spawn
                Point 2: Center Of Region
                    Region: blockade

    The pathing cost is the time that it takes a unit to get to another point.
    if it can't reach it then the amount will be 65536.
    I've tested this on a small scale.

    so if you use that statement in a comparison you can determine if there is a valid movement path between 2 points ;)

    think this will solve it *prays*

    ow you've got a unit choke... damn missed that reading *goes on testing this with units instead of buildings*

    *EDIT*
    doesn't work when there's a unit blockade :(
    *END OF EDIT*

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders

    I haven't tested this but I noticed the following conditional statement:

    Comparison - Unit Order is Valid
    ** EDIT **
    this conditional doesn't work as I hoped. looking if there is something else that works nicely
    ** END OF EDIT **

    can you use that to check if the move order is valid (I hope blizzard added this to check if the unit can move there if all routes are visible)

    I'll see if I can figure out something but hope this will work ;)

    Best Regards,
    Helral

    Posted in: Miscellaneous Development
  • 0

    posted a message on Making a different dialog open depending on player?

    @helixdnb:

    in the case that I mentioned it displays the dialog boxes for all players at the same time.
    if you want for example to display it first for player 1, then for player 2, etc. you want to use different triggers.

    you want to catch the button clicking of the previous player to trigger the dialog for the next player.

    so if I would set up an example of this using your math example:

    I would make a few global variables to keep track of:
     - the current player (CurrentPlayer)
     - the current dialog being displayed (ActiveDialog)
     - the correct answer for the dialog (CorrectAnswer)

    next I would setup several triggers to fire after one another:
    ========= the first trigger =============
    Dialog for starter player
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
            Variable - Set ActiveDialog = (Last created dialog)
            Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "1+1=..." color set to White text writeout set to false with a writeout duration of 2.0
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
            Variable - Set CorrectAnswer = (Last created dialog item)
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "3" and the hover image set to ""
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
            Dialog - Show (Last created dialog) for (Player group(Current Player))

    =========== end of first trigger ===========

    ======== the other triggers all look like this =======
    Dialog for next player
        Events
            Dialog - Any Dialog Item is Clicked by Player Any Player
        Local Variables
        Conditions
        Actions
            Dialog - Hide ActiveDialog for (Player group(Current Player))
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Used dialog item) == CorrectAnswer
                Then
                    ------- answer was correct
                Else
                    ------- answer was wrong
            Variable - Set Current Player = (Current Player + 1)
            ------- check if player is in use, if not continue increasing until you've reached the last number then start at 1 again.
            Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
            Variable - Set ActiveDialog = (Last created dialog)
            Dialog - Create a Label for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top with an offset of (50, 50) with the text "2x2=..." color set to White text writeout set to false with a writeout duration of 2.0
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "2" and the hover image set to ""
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "4" and the hover image set to ""
            Variable - Set CorrectAnswer = (Last created dialog item)
            Dialog - Create a Button for Dialog (Last created dialog) with the dimensions (200, 50) anchored to Top Left with an offset of (50, 50) setting the tooltip to "" with button text "6" and the hover image set to ""
            Dialog - Show (Last created dialog) for (Player group(Current Player))
    ================ end of this trigger ============

    ofcourse this second trigger isn't usable at all since you'll end up using only this trigger.
    you need to adjust it however you wish. you can setup a list of dialogs at initialization and just toggle them for the players in this bit.
    keep the current position in a variable or something.

    Hope this helps ya further ;)

    Players are numbered: 0 through 15. positions 0 and 15 are Neutral and Hostile respectively so they aren't normally controlled by a user.
    so basicly Player 1 = number 1.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Making a different dialog open depending on player?

    there are different ways to do this.
    you can define a trigger per player in which you create the dialog and set the show dialog for that player.

    or you can setup a list of dialogs and then iterate through all the players and display the dialog
    the latter looks something like this:

    -------------------------
    Dialog for all Players
        Events
            Game - Map initialization
        Local Variables
            DialogList = No Dialog <Dialog[4]>
        Conditions
        Actions
            Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
            Variable - Set DialogList[1] = (Last created dialog)
    -- create other dialog information for player 1 dialog (buttons, background, etc) --
            Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
            Variable - Set DialogList[2] = (Last created dialog)
    -- create other dialog information for player 2 dialog (buttons, background, etc) --
            Dialog - Create a Modal dialog of size (500, 400) at (0, 0) relative to Center of screen
            Variable - Set DialogList[3] = (Last created dialog)
    -- create other dialog information for player 3 dialog (buttons, background, etc) --
            Player Group - Pick each player in (All players) and do (Actions)
                Actions
                    Dialog - Show DialogList[(Picked player)] for (Player group((Picked player)))
    ------------------

    I haven't tested the above if it actually works, but it should work in theory.

    Posted in: Miscellaneous Development
  • 0

    posted a message on how does save and load functionality actually work?

    you can always encode the data. currently in wc3 people enter a certain character code for loading a "Hero". using that technique you get a single string for in the bank like:

    "[email protected]"

    or alike, which could represent something like:

    a lvl 10 zealot hero with 3 lvl in skill A and 5 lvls in skill B and carrying items X and Y also has 120 minerals owned by a player with the name TestPlayer.

    I have no knowledge on how they generate those codes though, but perhaps someone else can help you look further in that direction if you need to be secure of the data input.

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.