It is currently Thu Nov 26, 2020 2:29 am

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 
Offline
Moderator
Moderator
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).

Code:
Export custom_tech_researched, custom_tech_progress;

Starting
begin
     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"
end;

On ArtifactUsed(side,art,p1,p2) do
     begin
          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
     end;

On SpecResearchCancel(lab,percent) do
     begin
          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
     end;

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

_________________
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?


Top
 Profile  
 
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:  
cron
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