Jump to content

Howto add one extra item to the vote menu


Ukill

Recommended Posts


Can anybody tell me why this does not work online

Offline it added an extra option to the VoteMenu. (Compiled file :  Rx_Mutator_VoteMenu.u )

20170220190234_1.jpg20170220190241_1.jpg

How do i get it to run on my server ?

 

Rx_Mutator_VoteMenu : (Content)

  1. // *****************************************************************************
  2. //  * * * * * * * * * * * * Rx_Mutator_VoteMenu * * * * * * * * * * * * * *
  3. // *****************************************************************************
  4. class Rx_Mutator_VoteMenu extends Rx_Mutator;
  5.  
  6. event PreBeginPlay()
  7. {
  8.     local Rx_VoteMenuHandler VoteMod;
  9.     super.PreBeginPlay();
  10.  
  11.     VoteMod=Rx_VoteMenuHandler(GetDefaultObject(Class'Rx_VoteMenuHandler'));
  12.     VoteMod.VoteChoiceClasses[8] = class'Rx_VoteMenuChoice_ExtraChoice';
  13. }
  14.  
  15. final static function object GetDefaultObject(class ObjClass)
  16. {
  17.     return FindObject(ObjClass.GetPackageName()$".Default__"$ObjClass, ObjClass);
  18. }
  19.  
  20. defaultproperties
  21. {
  22. }
  23.  

 

Rx_VoteMenuChoice_ExtraChoice : (Content)

  1. // *****************************************************************************
  2. //  * * * * * * * * * Rx_VoteMenuChoice_ExtraChoice * * * * * * * * * * * * * *
  3. // *****************************************************************************
  4. class Rx_VoteMenuChoice_ExtraChoice extends Rx_VoteMenuChoice;
  5.  
  6.  
  7. function Init()
  8. {
  9.     ToTeam = Handler.PlayerOwner.PlayerReplicationInfo.Team.TeamIndex;
  10.     Finish();
  11. }
  12.  
  13.  
  14. function string ComposeTopString()
  15. {
  16.     return super.ComposeTopString() $ " is calling for turn mode1";
  17. }
  18.  
  19. function Execute(Rx_Game game)
  20. {
  21.     // Do something
  22. }
  23.  
  24. DefaultProperties
  25. {
  26.     PercentYesToPass=0.20f
  27.     MenuDisplayString = "ExtraChoice"
  28. }

 

I did found the code below, maybe it help to solve the problem :

  1. if(Rx_Controller(PlayerOwner) !=none && Rx_Controller(PlayerOwner).VoteHandler != none) 
  2. {
  3.     if(Rx_Controller(PlayerOwner).VoteHandler.VoteChoiceClasses.Length < (8+ExtraVoteNum))
  4.     {
  5.         Rx_Controller(PlayerOwner).VoteHandler.VoteChoiceClasses.AddItem(class'RenX_CommanderMod.Rx_VoteMenuChoice_Commander'); //1
  6.     }
  7. }

 

Edited by Ukill
  • Like 1
Link to comment
Share on other sites

To complete this Topic :

On 24-2-2017 at 6:44 PM, Ukill said:

2. Extend the current votesystem (In my opinion this one got more limitations, but is more easy to implement)

The way to do this can be found in the Rx_Mutator_AdminTool mutator, which are placed in the Download section, under Modifications (see link below) :

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...