View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:36 pm



Reply to topic  [ 5 posts ] 
 Stop CPU from spawning? 
Author Message
User avatar

Joined: Sun Aug 23, 2009 3:32 am
Posts: 8
Reply with quote
Post Stop CPU from spawning?
How can I stop cpu from spawning units in skirmish defense or BvB? And how can I increase my own start money? I basically just want to have a sandbox mode. I tried messing with different lua files but nothing works. Right now, I'm resorting to putting tunnels across the top of the map to stop ships from flying in.


Thu Jun 02, 2011 4:34 am
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Re: Stop CPU from spawning?
1)Find the corresponding lua file like "SkirmishDefense.lua", open it.
2)If you don't want any enemy to be spawned, find "if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetMOIDCount() <= 210 then", add some code to make it not possible, for example, "self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) > 100 and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0" will never come true.
3)Find
Code:
If/elseif self.Difficulty <= GameActivity.zDIFFICULTY then
self:SetTeamFunds(number x, Activity.TEAM_y)

x for the start money, y for the team, z for the difficulty. Just change x as you like.


Thu Jun 02, 2011 5:59 am
Profile
User avatar

Joined: Sun Aug 23, 2009 3:32 am
Posts: 8
Reply with quote
Post Re: Stop CPU from spawning?
#2 causes an error and console pops up.

I have tried putting the code in after the aforementioned line or just replacing it but neither works.


Fri Jun 03, 2011 1:58 am
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Re: Stop CPU from spawning?
replace "self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0" with "self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) > 100 and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0".


Fri Jun 03, 2011 4:45 am
Profile
User avatar

Joined: Sun Aug 23, 2009 3:32 am
Posts: 8
Reply with quote
Post Re: Stop CPU from spawning?
Thanks that worked perfectly


Fri Jun 03, 2011 5:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


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.
Designed by STSoftware for PTF.
[ Time : 0.173s | 13 Queries | GZIP : Off ]