Jump to content


Photo

File editing conventions


2 replies to this topic

#1 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 17 January 2005 - 08:45 PM

I propose a new standard for when you edit/create AI files:

Edited files:At top of file:
----------------------------------------
-- File: 'FILEPATH/FILENAME.ai'
-- Edited by Person1    @ 01.01.2005
-- Edited by Person2    @ 16.01.2005
-- Edited by Person1    @ 28.01.2005
-- Edited by Person3    @ 08.03.2005
for example:
----------------------------------------
-- File: 'ai/cpu_manager.ai'
-- Edited by Thudmeizer @ 01.01.2005
-- Edited by Corsix     @ 16.01.2005
edited/added sections:
-- SomePerson Modded/Added
CODE
--End
For example:
--Corsix Added
function BuildBaseStrategy:AddOnNotify( addon_id, notify_code , build_channel)
	aitrace("this race does not have an addon notify!")
end
--End
--Corsix Modded

  local id_2 = self.post_addon_2_id
  
  -- Added these two lines
  local before = math.abs(self.percent_post_upgraded - (num_up_post/num_post*100))
  local after = math.abs(self.percent_post_upgraded - ((num_up_post+1)/num_post*100))
  
  --Added "and"... + changed plan type
  if( self:PlanExists("Build NotifiedAddOn Plan", id_2) == false ) and after <= before then
 	 self.AddPlan( self, BuildNotifiedAddOnPlan( id_2 , 0) )
  end

        local id_2 = self.turret_addon_2_id
        
        -- Added these two lines
  local before = math.abs(self.percent_turr_upgraded - (num_up_turr/num_turr*100))
  local after = math.abs(self.percent_turr_upgraded - ((num_up_turr+1)/num_turr*100))
        
        --Added "and"... + changed plan type
        if( self:PlanExists("Build NotifiedAddOn Plan", id_2) == false ) and after <= before then 
 	 self.AddPlan( self, BuildNotifiedAddOnPlan( id_2 , 1) )
  end
  
  --End

Created files:At top of file:
----------------------------------------
-- File: 'FILEPATH/FILENAME.ai'
-- Created by Person1   @ 01.01.2005
-- Edited by Person2    @ 16.01.2005
-- Edited by Person1    @ 28.01.2005
-- Edited by Person3    @ 08.03.2005
for example:
----------------------------------------
-- File: 'ai/plans/buildnotifiedaddonplan.ai'
-- Created by Corsix     @ 17.01.2005

What you do guys think about this?

Edited by Corsix, 17 January 2005 - 08:50 PM.

Posted Image

#2 Grey

Grey
  • Members
  • 29 posts
  • Location:Århus C, Denmark

Posted 18 January 2005 - 12:20 AM

I like it.
Will give us a basic form of version control.
Of course we'd have to agree on in advance what to work solo on.

#3 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 18 January 2005 - 01:17 AM

Excellent idea Corsix.. makes sense considering if multiple changes are made by many people then you'd want to know the author.

Further, I would STRONGLY RECOMMEND a thread that shows the following:

WHO MADE THE CHANGE
WHAT FILE WAS CHANGED
WHAT SECTIONS WERE CHANGED
WHAT THOSE CHANGES DID
WHEN DO THESE NEW SCRIPTS COMMENCE
WHO WAS IMPACTED (ALL or SPECIFIC RACE)

Looking good!
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users