Results 1 to 3 of 3
  1. #1

    Red face State scope [answered]

    I'd like to call a stateless version of a function from a state:

    Code:
    // Do some stateless stuff.
    function DoStuff()
    {
        // Do stuff.
    }
    
    state TheState
    {
        // Do some extra stuff on top of the regular stuff.
        function DoStuff()
        {
            // First do the stateless stuff.
            state('').DoStuff();
    
            // Now do the extra stuff.
        }
    }
    This example does not work. Is something like this even possible to begin with? Or am I forced to keep using the following somewhat ugly construction:

    Code:
    function DoStuff()
    {
        // Do the stateless stuff.
        DoStatelessStuff()
    }
    
    // Do stateless stuff.
    function DoStatelessStuff()
    {
        // Do stuff.
    }
    
    state TheState
    {
        // Do some extra stuff on top of the regular stuff.
        function DoStuff()
        {
            // First do the stateless stuff.
            DoStatelessStuff();
    
            // Now do the extra stuff.
        }
    }

  2. #2
    Redeemer
    Join Date
    May 2000
    Location
    between the monitor and chair
    Posts
    1,523

    Default

    Code:
    global.DoStuff();
    Michiel 'El Muerte' Hendriks
    Magicball Network - Little Big Adventure community
    the Unreal Admin page - Unreal server administration
    UnrealWiki - UnrealScript and UnrealEd wiki.
    UnCodeX - powerful UnrealScript tool for programmers

  3. #3


 

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.