View unanswered posts | View active topics It is currently Sun May 05, 2024 11:05 am



Reply to topic  [ 268 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 18  Next
 Zombie Defense -fixtastic- 
Author Message

Joined: Wed Dec 03, 2008 8:54 pm
Posts: 41
Location: Andromeda Galaxy,localhost
Reply with quote
Post 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
Profile
User avatar

Joined: Mon May 18, 2009 11:48 pm
Posts: 205
Location: The swamps of Stuporia!
Reply with quote
Post 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
Profile YIM
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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 :oops:
@Grif
Thats great, I wasn't asking you to :)


Sun Jun 21, 2009 10:25 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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 :grin:

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
Profile
User avatar

Joined: Mon Mar 16, 2009 10:50 pm
Posts: 2175
Location: Neverwhere
Reply with quote
Post 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
zahmbae.PNG [ 9.92 KiB | Viewed 6893 times ]
Sun Jun 21, 2009 10:45 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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 :grin:

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
Profile
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Zombie Defense -fixtastic-
Worked for me.
Any console errors?


Sun Jun 21, 2009 11:11 pm
Profile
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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 :grin:

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 :0 Sorry if this is confusing, Im trying to explain it well.


Sun Jun 21, 2009 11:15 pm
Profile
User avatar

Joined: Mon Oct 06, 2008 2:04 am
Posts: 1559
Reply with quote
Post Re: Zombie Defense -fixtastic-
Here's my take on the chainsaw:
Frame 1:
Image
Frame 2:
Image
Animated Firing:
Image


Sun Jun 21, 2009 11:47 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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.


Attachments:
Zombie Defense.lua.txt [15.8 KiB]
Downloaded 452 times
Sun Jun 21, 2009 11:53 pm
Profile
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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 :grin:
What is wrong with my scroll ratios, and where are they so I can fix them? :0


Mon Jun 22, 2009 12:22 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Zombie Defense -fixtastic-
With the lua, as long as you keep it between:
Code:
      while i <= #playerList do
      playerActor = playerList[i]

and
Code:
      i = i + 1
      end

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
Profile
User avatar

Joined: Mon Jun 01, 2009 4:12 am
Posts: 74
Reply with quote
Post 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
Code:
      i = i + 1
      end

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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 268 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 18  Next

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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.047s | 17 Queries | GZIP : Off ]