Author |
Message |
moocow9000
Joined: Wed Sep 02, 2009 1:45 am Posts: 40 Location: Houston, TX
|
Gold Generating Actor
Hey there, fellow Cortex Commanders! I was wondering if somebody could make me a buyable actor (buyable like you can buy it from the bodies menu instead of spawning it in skirmish mode) that would generate gold? I have that pack with those Bunker Bits that generates gold, but you can't spawn those in campaign mode.
Thanks Guys!
|
Mon Sep 07, 2009 11:08 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Gold Generating Actor
function Update(self) local funds = ActivityMan:GetActivity():GetFundsOfTeam(self.Team); ActivityMan:GetActivity():SetFundsOfTeam(self.Team,funds + 1); end
|
Mon Sep 07, 2009 11:25 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Gold Generating Actor
What Grif left out: Copy and paste that script into a .lua file (just make a .txt and rename it after you've edited it), put that script in one of the known .rtes, such as Base.rte, open up the .ini for an actor, add the line Code: (tab)ScriptPath = (insert the path of the .lua file here) The path should look like Code: Base.rte/(luafile).lua Oh, and that (tab) means press the tab key.
|
Mon Sep 07, 2009 11:31 pm |
|
|
moocow9000
Joined: Wed Sep 02, 2009 1:45 am Posts: 40 Location: Houston, TX
|
Re: Gold Generating Actor
So, make a new .txt document, paste "function Update(self) local funds = ActivityMan:GetActivity():GetFundsOfTeam(self.Team); ActivityMan:GetActivity():SetFundsOfTeam(self.Team,funds + 1); end" into it, then rename it (whatever).lua then just put it on the bottom of an .ini file for an actor?
|
Mon Sep 07, 2009 11:54 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Gold Generating Actor
Here, I did it for you, but for some reason it's not working. Before I replaced it, GetFundsOfTeam was returning errors, so I looked it up on the wiki and saw it was GetTeamFunds. When I replaced it it stopped throwing errors, but simply did not work. Not sure why.
|
Tue Sep 08, 2009 12:01 am |
|
|
moocow9000
Joined: Wed Sep 02, 2009 1:45 am Posts: 40 Location: Houston, TX
|
Re: Gold Generating Actor
Thanks, but to be sure, in case I have to do something like this, i just make a .txt file, rename it to (whatever).lua then paste it at the bottom of an actor/weapon/craft/anything?
|
Tue Sep 08, 2009 12:05 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Gold Generating Actor
Yes, paste the .lua file in the folder your actor is in, then in the actors' ini file put the above line.
|
Tue Sep 08, 2009 12:09 am |
|
|
|