Please help with capture the flag ctf. when player dies the flag disappears
by Lucci · in Hardware Issues · 04/20/2009 (10:29 am) · 8 replies
I am making a capture the flag game for a shcool project and its due tomorow. i have it almost finished. the only problem i have is when a player grabs a flag and he gets killed the flag disappears and it doesnt get mounted again. thanks for your help
#2
04/20/2009 (12:20 pm)
Ok, thanks
#3
04/20/2009 (1:10 pm)
i put this in the player.cs and it still doesnt work. do i have to make any changes to it?
#4
Any console errors?
And this is in the wrong place. CTF is not hardware. Maybe try the public forums for the egine you're using.
05/22/2009 (12:27 am)
Did you replace the existing method of the same name, or did you just add it to the file? If you define a method twice, I think your definition may be written over.Any console errors?
And this is in the wrong place. CTF is not hardware. Maybe try the public forums for the egine you're using.
#5
05/22/2009 (9:06 am)
Ok, thanks, and i replace the existing file. I dont think there is any errors.
#6
05/22/2009 (12:14 pm)
Have you adapted the code to work with the way your CTF is scripted? I know this seems obvious, but I'm trying to run through the checklist... Michael's code seems sound, but if, for example, $FlagSlot doesn't exist, then you won't get the results you expect.
#7
Are you using a resource to implement CTF gameplay, or did you write your own custom solution? It's hard to say what is going wrong without knowing how your CTF "mechanic" works.
05/22/2009 (12:35 pm)
Hmmm, I had forgotten about this... Are you using a resource to implement CTF gameplay, or did you write your own custom solution? It's hard to say what is going wrong without knowing how your CTF "mechanic" works.
#8
05/22/2009 (5:35 pm)
actually i didnt adapted the code. i just replaced the old one. i dont't know much about making games. i used the resource . this is my first game and i thought following the ctf resource would be a good way to start and get the feel. My buddy had the same issue when he followed the resource but he doesnt remeber how he fixed his. thanks for the help btw. i really appreciate it!
Associate Michael Hall
Distracted...
Armor::onDisabled(%this, %obj) { // stuff... // Have we got a flag? ... if so then drop it %image = %obj.getMountedImage($FlagSlot); if (%image) { %obj.decInventory(%image.item, 1); %obj.unmountImage($FlagSlot); %obj.throw(%image.item, 1); } // more stuff... }In theory something like that will check your flagslot (mountpoint where the flag is mounted) when you're disabled/killed and if you have a flag mounted then take it out of inventory, unmount it, and then throw a flag to be recovered.