Author |
Message |
Batux1995
Joined: Wed Dec 03, 2008 8:54 pm Posts: 41 Location: Andromeda Galaxy,localhost
|
Re: Zombie Defense -fixtastic-
Oh my god Grif cheer dude!But you are right about the six posts thing:D
|
Sun Jun 21, 2009 9:34 pm |
|
|
AgentBaron
Joined: Mon May 18, 2009 11:48 pm Posts: 205 Location: The swamps of Stuporia!
|
Re: Zombie Defense -fixtastic-
I'm sorry, I really don't know what the function is offhand. I saw it on the forums somewhere... I think you'd want it to be something like: Code: Gold = *get gold amount function*
*when a zombie dies...* Gold == Gold + *insert value here* Something like that... it's probably not correct syntax, but I hope you get where I'm going with that.
|
Sun Jun 21, 2009 10:02 pm |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
AgentBaron wrote: I'm sorry, I really don't know what the function is offhand. I saw it on the forums somewhere... I think you'd want it to be something like: Code: Gold = *get gold amount function*
*when a zombie dies...* Gold == Gold + *insert value here* Something like that... it's probably not correct syntax, but I hope you get where I'm going with that. Thanks, Ill try and figure it out. Btw, how would you make something 2 player Co-Op using lua? Ive never played Co-Op on CC before so I wouldnt have any idea.Nevermind I found out. Ill use search next time before I ask something @Grif Thats great, I wasn't asking you to
|
Sun Jun 21, 2009 10:25 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Zombie Defense -fixtastic-
This in COunter.lua will do the trick(replace x btw): Code: ActivityMan:GetActivity():SetTeamFunds(ActivityMan:GetActivity():GetTeamFunds(0) + x, 0) Look at maginot, it's an excelent example. It's compatable with MP by just adding a players = 2 line in actviities file.
|
Sun Jun 21, 2009 10:32 pm |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
mail2345 wrote: This in COunter.lua will do the trick(replace x btw): Code: ActivityMan:GetActivity():SetTeamFunds(ActivityMan:GetActivity():GetTeamFunds(0) + x, 0) Look at maginot, it's an excelent example. It's compatable with MP by just adding a players = 2 line in actviities file. Ah! Thank you so much, thats a big help EDIT: Hmm I might be doing something wrong, but I dont think that code is working Im not getting any gold from killing them. This is the code I have for Counter.lua: Code: function Destroy(self) ActivityMan:GetActivity():SetTeamFunds(ActivityMan:GetActivity():GetTeamFunds(0) + 10, 0) killcount = killcount + 1; zombiecount = zombiecount - 1; end I put 10 in for x, assuming that was how much gold I wanted the player to get per kill.
Last edited by FauxMask on Sun Jun 21, 2009 10:52 pm, edited 1 time in total.
|
Sun Jun 21, 2009 10:40 pm |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
Re: Zombie Defense -fixtastic-
I got a little done do far, tried to get an axe, a sawn-off, and a crowbar, but I'm not happy with any of them yet... Halp?
Attachments:
zahmbae.PNG [ 9.92 KiB | Viewed 7645 times ]
|
Sun Jun 21, 2009 10:45 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Zombie Defense -fixtastic-
FauxMask wrote: mail2345 wrote: This in COunter.lua will do the trick(replace x btw): Code: ActivityMan:GetActivity():SetTeamFunds(ActivityMan:GetActivity():GetTeamFunds(0) + x, 0) Look at maginot, it's an excelent example. It's compatable with MP by just adding a players = 2 line in actviities file. Ah! Thank you so much, thats a big help EDIT: Hmm I might be doing something wrong, but I dont think that code is working Im not getting any gold from killing them. This is the code I have for Counter.lua: Code: function Destroy(self) ActivityMan:GetActivity():SetTeamFunds(ActivityMan:GetActivity():GetTeamFunds(0) + 10, 0) killcount = killcount + 1; zombiecount = zombiecount - 1; end I put 10 in for x, assuming that was how much gold I wanted the player to get per kill. Sure you saved the file right?
|
Sun Jun 21, 2009 11:01 pm |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
mail2345 wrote: Sure you saved the file right? Yeah, I just made sure of that Try it yourself and see
|
Sun Jun 21, 2009 11:05 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Zombie Defense -fixtastic-
Worked for me. Any console errors?
|
Sun Jun 21, 2009 11:11 pm |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
mail2345 wrote: Worked for me. Any console errors? No conole errors. Hmm.. well the only thing I changed from the last version was that you start out with 100 gold already, but I dont know if that could be the problem, let me check. EDIT: Okay, I didn't change anything but now it suddenly working lol. I think it was just my computer being slow to update file or something. Anyway, thanks again Btw, I made it so its co-op now, but how do I set the stuff for player 2? As soon as the game starts it says he is dead (which is understandable, I didnt tell CC to create him in the first place) I look at Maginot Mission's Lua, but I don't quite understand how they differenciate what goes/happens to what player Sorry if this is confusing, Im trying to explain it well.
|
Sun Jun 21, 2009 11:15 pm |
|
|
LowestFormOfWit
Joined: Mon Oct 06, 2008 2:04 am Posts: 1559
|
Re: Zombie Defense -fixtastic-
Here's my take on the chainsaw: Frame 1: Frame 2: Animated Firing:
|
Sun Jun 21, 2009 11:47 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Zombie Defense -fixtastic-
Mission success.
For loops added. While loops added.
Wrapper system added so aslong as you keep your code inside of the loop, it should work.
Now fix your borked scroll ratios.
|
Sun Jun 21, 2009 11:53 pm |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
mail2345 wrote: Mission success.
For loops added. While loops added.
Wrapper system added so aslong as you keep your code inside of the loop, it should work.
Now fix your borked scroll ratios. I looked through it, not exactly sure what a lot of it means, but thanks, it seems you saved me the work of making everything work with 2 players What is wrong with my scroll ratios, and where are they so I can fix them?
|
Mon Jun 22, 2009 12:22 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Zombie Defense -fixtastic-
With the lua, as long as you keep it between: Code: while i <= #playerList do playerActor = playerList[i] and It should work. ScrollRatios are found in your scene's ini. Play a multiplayer game. The top of the screen glitches. Find the layer that controlls that and fix the problem(oh, I'm running 800x600)
|
Mon Jun 22, 2009 12:28 am |
|
|
FauxMask
Joined: Mon Jun 01, 2009 4:12 am Posts: 74
|
Re: Zombie Defense -fixtastic-
mail2345 wrote: With the lua, as long as you keep it between: Code: while i <= #playerList do playerActor = playerList[i] and It should work. ScrollRatios are found in your scene's ini. Play a multiplayer game. The top of the screen glitches. Find the layer that controlls that and fix the problem(oh, I'm running 800x600) Okay I get it now Hmm I dont have that problem unless I switch it to 800x600. Ill see what I can do to fix that
|
Mon Jun 22, 2009 12:41 am |
|
|
|