Hello Guys,
i working on a mod [Researchable Elements] and i will add hardware/R&D Lab Researches [without the UL].
can anyone help me,please?
@kristof1104 suggested this to me, but I never got around to testing it:
var customMMO = {
id : "CustomMMO",
name : "MMO".localize(),
pointsCost : 1700,
canResearch : function (company) {
return company.researchCompleted.indexOf(r.MMO) == -1 && company.researchCompleted.indexOf(r.opportunityInternet) != -1
},
iconUri : "./images/projectIcons/superb/mmo.png",
description : "Massively Multiplayer Online games! We know how much fun it is to play multiplayer games but imagine that instead of playing with a handful of players you could play with thousands! This project will unlock a brand new genre to allow you to create MMO games.".localize(),
targetZone : zone,
complete : function (company) {
company.researchCompleted.push(r.MMO);
var msg = "Boss, our research into massively multiplayer online (MMO) games is complete. The possibilities of MMOs are big but they are also risky. In our research we realized that before we can begin to develop an MMO we will need to create a special game engine for it.{n}You will need to complete the research for the MMO support feature with one of your staff. Once it is integrated into a game engine you can start building an MMO but be careful. It seems that MMOs only work with the best theme/genre combinations and you will also need to have specialists on your team to make an MMO successful.".localize();
var notification = new Notification(labReport, msg);
company.notifications.push(notification)
}
};
Research.bigProjects.push(customMMO);
I get this Error:
"ReferenceError: r is not defined
Enabled Mods:
Game Dev Tycoon Mod API by support@greenheartgames.com
[WIP] Researchable elements by speedy_242
Game Version: 1.5.28
Platform: Windows
Distribution: Steam"
Change r to Research
Case sensitive ^^^
I change this and i have no error but the research is not available.
In the save you are using to test it, has Internet Opportunities been researched yet? In the example I gave you, the research cannot be researched until Internet Opportunites has been researched (I know, a lot of “research”)
@chizbejoe
In my save i have all researches researched.
Edit: I make this "return company.researchCompleted.indexOf(r.MMO) == -1 && company.researchCompleted.indexOf(r.opportunityInternet) != -1
to “return company.researchCompleted.indexOf(r.MMO) && company.researchCompleted.indexOf(r.opportunityInternet)”, yet working it but i will thereby enable a new research ( no R & D Lab / hardware Lab research ), you know how to do that?
Ps: sry for my bad english
Replace every single instance of r with Research.
For “canResearch:” put:
function(company) {
return -1 == company.researchCompleted.indexOf(Research.MMO) && -1 != company.researchCompleted.indexOf(Research.opportunityInternet)
}
This will make it so it cannot be researched until “Internet Opportunities” has been researched. Now remember, that is just an example. You need to implement your own code based on the research you are adding. If you use my exact code, you are just re-implementing MMOs.
@chizbejoe
this isnt my Problem But i will make a research(no R&D Lab/Hardware lab Research) that Need a R&D Lab Research (like The MMO Research
So you want to add a Standard research item only if a specific Rnd Research has been researched?
Here you go:
Examples.addResearch = function () {
GDT.addResearchItem(
{
id : "TestResearch",
name : TestResearch,
engineCost : 1E4,
devCost : 15E3,
v : 2,
canResearch : function (company) {
return company.researchCompleted.indexOf(Research.MMO) == -1;
},
category : category,
categoryDisplayName : categoryDisplayName,
group : group,
consolePart : true,
techLevel : 1
});
};