Results 1 to 18 of 18

Thread: Bad expression

  1. #1
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default Bad expression

    Ok,please tell me how I did screwed up this code.
    Thanks.

    Untitled-3.jpg
    Code:
    class Menu extends GFxMoviePlayer;
    
    var GFxClikWidget StartButton;
    var GFxObject MainMenuTitle;
    
    function bool Start(optional bool StartPaused = false)
    {
    super.Start();
    Advance(0);
    
    MainMenuTitle = GetVariableObject("_root.textField");
    MainMenuTitle.SetString("text","Salut!");
    
    return true;
    }
    /**Callback when a Click widget with enableInitCallBack set to TRUE is initialized. Returns TRUE if the widget was handled, FALSE if nor*/
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Object)
    {
    switch(WidgetName)
    {
    
    case ('startBtn'):
    StartButton = GFxClikWidget(Widget);
    StartButton.AddEventListener("Click_press", OnStartButtonPress);
    break;
    default;
    break;
    }
    return true;
    }
    
    function OnStartButtonPress(GFxClikWidget.EventData ev)
    {
    ConsoleCommand("open Game");
    }
    defaultproperties
    {
    WidgetBindings.Add (WidgetName"startBtn",Widgetclass=class'GFxClikWidget'))
    }

  2. #2
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,513

    Default

    No such thing called Widget within the WidgetInitialized function. Did you mean Object?

  3. #3
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Hi,this is the tutorial I've made the menu after.
    I copy the code as in the video.
    http://www.youtube.com/watch?v=_iP4t...eature=mh_lolz

  4. #4
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    Code:
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget ) // Old - Object)
    ...
    StartButton = GFxClikWidget(Widget);
    ...

  5. #5
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Ok,thanks for the answer,I rewrite the code,but now I get another error.
    final function ConsoleCommand(string Cmd, optional bool bWriteToLog)-here's line 37

    Untitled-4.jpg
    class Menu extends GFxMoviePlayer;

    var GFxClikWidget StartButton;
    var GFxObject MainMenuTitle;

    function bool Start(optional bool StartPaused = false)
    {
    super.Start();
    Advance(0);

    MainMenuTitle = GetVariableObject("_root.textField");
    MainMenuTitle.SetString("text","Salut!");

    return true;
    }
    /**Callback when a Click widget with enableInitCallBack set to TRUE is initialized. Returns TRUE if the widget was handled, FALSE if nor*/
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    switch(WidgetName)
    {

    case ('startBtn'):
    StartButton = GFxClikWidget(Widget);
    StartButton.AddEventListener("Click_press", OnStartButtonPress);
    break;
    default;
    break;
    }
    return true;
    }

    function OnStartButtonPress(GFxClikWidget.EventData ev)




    final function ConsoleCommand(string Cmd, optional bool bWriteToLog)

    {
    if (PlayerOwner != none)
    PlayerOwner.ConsoleCommand(Cmd, bWriteToLog);
    }
    defaultproperties
    {
    WidgetBindings.Add (WidgetName"startBtn",Widgetclass=class'GFxClikWid get'))
    }

  6. #6
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    First: Can you replace Quote with Code in preview post?
    Second: Remove that function - is already declared in parent class...

  7. #7
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    First: Can you replace Quote with Code in preview post?
    Second: Remove that function - is already declared in parent class...

    Hi,thanks for the repply,here's the new code,but I still get that error.
    Code:
    class Menu extends GFxMoviePlayer;
    
    var GFxClikWidget StartButton;
    var GFxObject MainMenuTitle;
    
    function bool Start(optional bool StartPaused = false)
    {
    super.Start();
    Advance(0);
    
    MainMenuTitle = GetVariableObject("_root.textField");
    MainMenuTitle.SetString("text","Salut!");
    
    return true;
    }
    /**Callback when a Click widget with enableInitCallBack set to TRUE is initialized. Returns TRUE if the widget was handled, FALSE if nor*/
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    switch(WidgetName)
    {
    
    case ('startBtn'):
    StartButton = GFxClikWidget(Widget);
    StartButton.AddEventListener("Click_press", OnStartButtonPress);
    break;
    default;
    break;
    }
    return true;
    }
    
    function OnStartButtonPress(GFxClikWidget.EventData ev)
    
    
    
    defaultproperties
    {
    WidgetBindings.Add (WidgetName"startBtn",Widgetclass=class'GFxClikWidget'))
    }

  8. #8
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    ...and what it say..?

  9. #9
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    ...and what it say..?
    Almoust the same.Please tell me what is the name of the uc file that is used to for the udk menu.Thank you.
    Untitled.jpg

  10. #10
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    Look closer at the red in log... You have messed-up UTGame package... Never do that...

    Wait... You have placed custom code to UTGame package..?
    Last edited by VendorX; 04-24-2012 at 01:58 PM.

  11. #11
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    Look closer at the red in log... You have messed-up UTGame package - Menu to be exactly... Never do that... Post Menu.uc code.
    I do not understand can you please explain to me with more detail?
    Thanks.

  12. #12
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    Look closer at the red in log... You have messed-up UTGame package - Menu to be exactly... Never do that... Post Menu.uc code.
    I do not understand can you please explain to me with more detail?
    Thanks.

  13. #13
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    Look closer at the red in log... You have messed-up UTGame package - Menu to be exactly... Never do that...

    Wait... You have placed custom code to UTGame package..?
    Yes I placed the Menu.uc file in the UTGame directory.

  14. #14
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default Bad expression

    Quote Originally Posted by VendorX View Post
    Look closer at the red in log... You have messed-up UTGame package - Menu to be exactly... Never do that...

    Wait... You have placed custom code to UTGame package..?
    Yes I placed the Menu.uc file in the UTGame directory.

  15. #15
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    Errors are in red:
    Code:
    class SFMenuTutorial extends GFxMoviePlayer;
    
    var GFxClikWidget StartButton;
    var GFxObject MainMenuTitle;
    
    function bool Start(optional bool StartPaused = false)
    {
    	Super.Start();
    	Advance(0);
    
    	MainMenuTitle = GetVariableObject("_root.textField");
    	MainMenuTitle.SetText("Hello World!");
    
    	return true;
    }
    
    // Callback when a Click widget with enableInitCallBack set to TRUE is initialized. Returns TRUE if the widget was handled, FALSE if nor
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    	switch(WidgetName)
    	{
    		case ('startBtn'):
    			StartButton = GFxClikWidget(Widget);
    			StartButton.AddEventListener('Click_press', OnStartButtonPress);
    			break;
    		default:
    			break;
    	}
    	return true;
    }
    
    function OnStartButtonPress(GFxClikWidget.EventData ev)
    {
    	ConsoleCommand("open DM-Deck");
    }
    
    defaultproperties
    {
    	WidgetBindings.Add((WidgetName="startBtn",Widgetclass=class'GFxClikWidget'))
    }
    ...and if you have your custom game package, then this is the place for this menu - not UTGame...
    Last edited by VendorX; 04-24-2012 at 02:46 PM.

  16. #16
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    Errors are in red:
    Code:
    class SFMenuTutorial extends GFxMoviePlayer;
    
    var GFxClikWidget StartButton;
    var GFxObject MainMenuTitle;
    
    function bool Start(optional bool StartPaused = false)
    {
    	Super.Start();
    	Advance(0);
    
    	MainMenuTitle = GetVariableObject("_root.textField");
    	MainMenuTitle.SetText("Hello World!");
    
    	return true;
    }
    
    // Callback when a Click widget with enableInitCallBack set to TRUE is initialized. Returns TRUE if the widget was handled, FALSE if nor
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    	switch(WidgetName)
    	{
    		case ('startBtn'):
    			StartButton = GFxClikWidget(Widget);
    			StartButton.AddEventListener('Click_press', OnStartButtonPress);
    			break;
    		default:
    			break;
    	}
    	return true;
    }
    
    function OnStartButtonPress(GFxClikWidget.EventData ev)
    {
    	ConsoleCommand("open DM-Deck");
    }
    
    defaultproperties
    {
    	WidgetBindings.Add((WidgetName="startBtn",Widgetclass=class'GFxClikWidget'))
    }
    Fixed all,now I have problems witht the movie flash.

  17. #17
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    This tutorial is good - look again...

    ...and delete those double posts above. Just by curiosity: what's now..?
    Last edited by VendorX; 04-24-2012 at 02:53 PM.

  18. #18
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    208

    Default

    Quote Originally Posted by VendorX View Post
    This tutorial is good - look again...

    ...and delete those double posts above. Just by curiosity: what's now..?
    The menu loads,but I can't use it.

    Now I need to learn action script.


 

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.