Page 1 of 3
[Help] [Solved] SkillPoints number in Manialink
Posted: 31 Aug 2017, 10:24
by adamkooo2
Hello guys!
Thanks to my poor skill in maniascript, I have another problem:
I want to show amount of skillpoints in campaign in label in manialink.
I've done it before, but with leaderpoints, so I know the way how to do it already.
I have started searching and I've found this:
https://maniaplanet.github.io/maniascri ... c301b7aef4
I have this script:
Code: Select all
(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(0, 0));
An error is shown:
Code: Select all
Incorrect arguments to call the function Campaign_GetSkillPoints
And here comes the question:
What is campaign id and player id?
I hope that will be easy to solve it

Re: [Help] SkillPoints number in Manialink
Posted: 04 Sep 2017, 13:27
by Qlex
Hi,
PlayerId is generally taken with UserMgr.MainUser.Id .
CampaignId is found in one of the several campaigns of DataFileMgr.Campaigns, which return a class of type CCampaign.
Your code would be :
Code: Select all
(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId));
I hope that helps!
Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 15:21
by adamkooo2
Hello,
I have done CTRL + C and replace my code but it seems it does not work.
The game always say that:
Code: Select all
ERROR [5, 93] The member or variable UserMgr does not exist.
ERROR [5, 93] The dot operator '.' must be applied to a class or a vector
ERROR [5, 102] The dot operator '.' must be applied to a class or a vector
ERROR [5, 61] Incorrect arguments to call the function Campaign_GetSkillPoints
I've tested it to convert it to script, but the manialink seems to be too big to be in the declared in text in script.
I've also tested this code:
Code: Select all
(Page.GetFirstChild("Rank") as CMlLabel).SetText(""^ ScoreMgr.CampaignLeaderBoard_GetPlayerRanking(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId, LocalUser.ZonePath, False));

and again the game says:
Code: Select all
ERROR [6, 108] The member or variable UserMgr does not exist.
ERROR [6, 108] The dot operator '.' must be applied to a class or a vector
ERROR [6, 117] The dot operator '.' must be applied to a class or a vector
ERROR [6, 63] Incorrect arguments to call the function CampaignLeaderBoard_GetPlayerRanking
I hope there's a solution, thanks for that CampaignId that is working

Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 16:32
by Qlex
Ah, indeed, you are in a game mode, so that does not work.
Can you try log(ManiaPlanet.UserMgr)? If it's Null try Users[0].Id and tell me the results

Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 17:54
by adamkooo2
Qlex wrote: ↑06 Sep 2017, 16:32
Ah, indeed, you are in a game mode, so that does not work.
No, I am not in gamemode, I do not have the skill to do the whole gamemode
Qlex wrote: ↑06 Sep 2017, 16:32
Can you try log(ManiaPlanet.UserMgr)? If it's Null try Users[0].Id and tell me the results
OK, I've tried toedit the code as you wrote. Here're results:

both are errors :/
Thank you for wasting your time with my problem, even it's not fixed

Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 17:55
by zocka
If you have LocalUser try using this one? (LocalUser.Id)
Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 18:07
by adamkooo2
zocka wrote: ↑06 Sep 2017, 17:55
If you have LocalUser try using this one? (LocalUser.Id)
I've tried LocalUser, but not LocalUser.Id
It works!!!

Thank you both

Re: [Help] SkillPoints number in Manialink
Posted: 06 Sep 2017, 18:16
by adamkooo2
When I try to open it in manialink, I always get an error:

Re: [Help] SkillPoints number in Manialink
Posted: 08 Sep 2017, 10:22
by Qlex
Can you try calling
just before ?
Re: [Help] SkillPoints number in Manialink
Posted: 10 Sep 2017, 19:25
by adamkooo2
Qlex wrote: ↑08 Sep 2017, 10:22
Can you try calling
just before ?
yes, it gives me an error:
Code: Select all
ERROR [7, 9] wait condition has to be Boolean