Results 1 to 3 of 3
  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default RTS Hud, input, markers and StageAlign?

    Hi,

    I am planning a hud for my rts project and I have a few questions regarding the unreal- and actionscript interfaces.

    The first problem regards player input. For example:
    Should I leave rectangle selection to unrealscript and make flash display it? (No direct input for flash)
    Or should I let actionscript notify the udk once a selection was made in flash? (Flash handles mouse input)

    Same goes for things like setting targets, scrolling the map, etc.. On the one hand I think unrealscript's PlayerInput should handle the input, but not using flash on the other hand leaves me with a feeling of wasted potential/processing time.

    The second question concerns unit icons: Depending on the selection of units I want to display certain icons and stats (Life, Energy) above a unit. For every selected and displayed unit, I need to add a movie clip to the stage and update its position everytime the units' screen position changes. The resource friendliest way (I think) is keeping an unrealscirpt array of on-screen units and only adding or deleting movie clips from flash when the contents of the array changes. I only call actionscript to update the screenposition of existing movieclips every tick or so. Does this make sense?
    Or can I just delete all and create new movieclips every tick? How much impact on performance would that have (I am thinking about a couple hundrets of units)? The RTS Starterkit uses the canvas and simply redraws unit markers every frame, but obviously flash handles things differently.
    Is there maybe a third option I don't know about?

    greetings
    FTC
    Last edited by FTC; 07-16-2012 at 03:58 AM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default

    Ok I now let flash handle the mouse interaction and have the markers in an array to only update necessary things.

    But I have one question, when resizing the window the stage does not really does what it should:
    Code:
    stage.addEventListener(Event.RESIZE, OnResize); 
    function OnResize(event:Event):void 
    {
    	stage.scaleMode = StageScaleMode.SHOW_ALL;
    	stage.align = StageAlign.BOTTOM_LEFT;
    }
    However the stage is just centered within the udk window, not on the bottom left.

    Another thing is, that I have to convert the actionscript mouse coordinates into udk screen coordinates. I have done some research, but since I use AS 3 I cannot use:
    Code:
    Stage["visibleRect"].width
    What is the equivalent for ScaleForm 4.0?

    greetings
    FTC

  3. #3
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default

    I found it:
    Code:
    Extensions.visibleRect
    However, I ask myself why this is documented in here?
    http://gameware.autodesk.com/documen...extensions.pdf

    I still have problems with the StageAlign since it does not do anything...

    greetings
    FTC


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.