It is currently Sun May 09, 2021 12:34 pm

All times are UTC [ DST ]

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Custom technologies
PostPosted: Mon Jun 13, 2011 4:59 pm 
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
Here's a template for creating your own custom technology. You can read more about the used functions and events in the "Identify"-section of the editor (version 1.11.0 RC7 and later versions).

Export custom_tech_researched, custom_tech_progress;

     custom_tech_researched = false;
     custom_tech_progress = 0;
     SetArtifactUse(GetSide(amlab),art_use_cube,art_instant,amlab);  //Create a button which looks like a cube in the lab identified by "amlab"

On ArtifactUsed(side,art,p1,p2) do
          SetSpecResearch(amlab,10,true);  //Start researching custom technology - remember to adjust how hard the difficulty should be to research (the second input)
          SetWorkingProgress(amlab,custom_tech_progress);  //If the research was canceled then start where you stopped
          SetArtifactUse(side,art,art_no,amlab);  //Remove the button from the lab

On SpecResearchCancel(lab,percent) do
          custom_tech_progress = percent;  //Remember how long we got with the research
          SetArtifactUse(GetSide(lab),art_use_cube,art_instant,lab);  //Replace the button in the lab

On SpecResearchComplete(lab) do
          custom_tech_researched = true;
          //Something happens...

I have an if that has an else, but that if has another if with an else inside... My question is... If an if has an else, if there is more than one line in that if, should it have a begin and an end?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Original War is an RTS / RPG game by Altar Games
Original War Support is not part of Altar Games but is maintaining Original War for Altar Games

Privacy Policy