[Help] SkillPoints number in Manialink

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
Qlex
Nadeo
Nadeo
Posts: 198
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » 13 Sep 2017, 13:46

Check if the affectation worked :

Code: Select all

		foreach(Event in PendingEvents) {
				log(Now ^ ") Event received. Event.Type : " ^ Event.Type ^ ", Event.CustomEventType : " ^ Event.CustomEventType);
			switch (Event.Type) {
				case CMlScriptEvent::Type::PluginCustomEvent: {
					switch (Event.CustomEventType) {
						case "skillpoints_sent" : {
							declare Integer Page_SoloSP for Page;
							log(Now ^ ") Skillpoints received by layer : " ^ Page_SoloSP);
							(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ Page_SoloSP);
						}
					}
				}
			}
		}
If you don't see the line "Skillpoints received by layer" when in the TM2UF menu (Ctrl + G), that means the solo.xml does not receive the correct Event

User avatar
adamkooo2
Posts: 1100
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 13 Sep 2017, 16:43

I have included the main frame of solo.xml to TM2UF menu.script.txt, so values are loaded (but wrong numbers, it looks skillpoints label displays leaderpoints, and rank label displays amount of players in country of player login).
I will try to send the evnt to solo.xml or do you think it will be possible to include the manialink and hide frames of the included ML?
Arkady Smurf.wip
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 198
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » 18 Sep 2017, 09:26

If you have values that are not zero then I think your method is good.

Check if you're using this line :

Code: Select all

ScoreMgr.Campaign_GetSkillPoints(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId)
some other methods of the class CScoreMgr might be used on accident, like MapLeaderBoard_GetPlayerCount or CampaignLeaderBoard_GetPlayerCount.

User avatar
adamkooo2
Posts: 1100
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » Yesterday, 18:18

Thx, but it it does not work. An error ocurred:

Code: Select all

ERROR [58, 48] The member or variable UserMgr does not exist.
ERROR [58, 48] The dot operator '.' must be applied to a class or a vector
ERROR [58, 57] The dot operator '.' must be applied to a class or a vector
ERROR [58, 16] Incorrect arguments to call the function Campaign_GetSkillPoints
I had to replace UserMgr.MainUser.Id with LocalUser.Id to make it work
Arkady Smurf.wip
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 198
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » Today, 08:29

Is LocalUser.Id giving you the correct results? If not, try calling this function with UserMgr.MainUser.Id, but in the Menu.Script.txt, not in solo.xml

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 3 guests