Ok, i'm makeign a new level thing called Star Wars Dark Cheeses: The Gouda Horisons
the idea is simple, two teams battle it out, one cheese, one normal, new weapons and force rankings are achived by killing 10 enermy players, the scoreing and stuff is handeled by cog, as well as the time limits, score limits, and the fact the level is allways team based, also theres a cog to switch to a camera when one team wins and set off the snazzy ending cutseens.
But (as allways) a problem has appeared thats... strange.
the first cog in the list below is where i think the problem is, people joining the second or fourth team are set to team two and there skin is set to the warrior skin (as it should be) BUT if you join team 1 or 3 allthough the team is changed to 1, the skin dosent change at all.. i cant figure it out.
(the other cogs are there incase its not actually an error in the skin/evolution cog)
Oh, and if your wondering hwo sutch a simple cog set could be so badly made, its because i did it, i hope you can unserstand it!
------------------
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
the idea is simple, two teams battle it out, one cheese, one normal, new weapons and force rankings are achived by killing 10 enermy players, the scoreing and stuff is handeled by cog, as well as the time limits, score limits, and the fact the level is allways team based, also theres a cog to switch to a camera when one team wins and set off the snazzy ending cutseens.
But (as allways) a problem has appeared thats... strange.
the first cog in the list below is where i think the problem is, people joining the second or fourth team are set to team two and there skin is set to the warrior skin (as it should be) BUT if you join team 1 or 3 allthough the team is changed to 1, the skin dosent change at all.. i cant figure it out.
(the other cogs are there incase its not actually an error in the skin/evolution cog)
Oh, and if your wondering hwo sutch a simple cog set could be so badly made, its because i did it, i hope you can unserstand it!
Code:
# JK cog script # # 00_skinvolv # # [PJB] # # This cog will when resiveing the correct trigger, set the # players skin to a big lump of chease if he's on the chease team. # on a different trigger it will return the side the players on # on a differnt trigger it updates the model used for a chease # (for evolution) flags=0x100 # Runs cog loccaly on all mashines, so the players checked on eatch mashine # not just the hosts. symbols message trigger message startup message pulse model base0=cheese1.3do model base1=ky.3do model mod=cheese1.3do model mod1=cheese2.3do model mod2=cheese3.3do model mod3=cheese4.3do model mod4=cheese5.3do model mod5=cheese6.3do model mod6=cheese7.3do model mod7=cheese8.3do model mod8=cheese9.3do model ky=ky.3do model ky1=kyd0.3do model ky2=kyk7.3do model ky3=kyl8.3do model ky4=kyc5.3do model ky5=kya11.3do model ky6=kyg7.3do model ky7=kyh4.3do model ky8=kya18.3do thing player local int level=-1 local int a=0 local int b=0 local sound cheeseup sound warriorup end code startup: setpulse(1); return; # ........................................................................................ trigger: if(getsourceref()==7) //if the player has evolved { if(getparam(0) != jkgetlocalplayer()) return; player=getparam(0); level=level+1; call evolve; } if(getsourceref()==7) //if resiveing info on a players model change the model to that { if(getparam(0)==jkgetlocalplayer()) { a=getparam(1); if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) base1 = ky[a]; if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) base0 = mod[a]; } } if(getsourceref()==10) //if resiveing a request, return the players side { if(getparam(0)==jkgetlocalplayer()) { if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) b=1; if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) b=0; sendtrigger(-3,9,jkgetlocalplayer(),b,0,0); } } if(getsourceref()==11) //if resiveing info on a players side, set his side to that { if(getparam(0)==jkgetlocalplayer()) { if(getparam(1)==0)SetPlayerTeam(jkgetlocalplayer(), 1); if(getparam(1)==1)SetPlayerTeam(jkgetlocalplayer(), 2); } } return; # ........................................................................................ pulse: //level -1 is fists if(level == 0 || level == 1)setInv(player, 11, 999); if(level == 2)setInv(player, 4, 999); if(level == 3 || level == 4 || level == 7)setInv(player, 12, 999); if(level == 5)setInv(player, 15, 999); if(level == 6)setInv(player, 8, 999); //level 8 is saber if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) { SetPlayerTeam(jkgetlocalplayer(), 1); if(getthingmodel(jkgetlocalplayer())!=base0) SetThingModel(jkgetlocalplayer(), base0); return; } if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) { SetPlayerTeam(jkgetlocalplayer(), 2); if(getthingmodel(jkgetlocalplayer())!=base1) SetThingModel(jkgetlocalplayer(), base1); return; } return; # ........................................................................................ evolve: if(getparam(0)==jkgetlocalplayer()) { player=jkgetlocalplayer(); if(level == 0) { setInv(player, 2, 1); SetInv(player, 20, 0); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,0,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,0,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 1) { setInv(player, 3, 1); SetInv(player, 20, 1); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,1,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,1,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 2) { setInv(player, 4, 1); SetInv(player, 20, 2); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,2,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,2,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 3) { setInv(player, 5, 1); SetInv(player, 20, 3); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,3,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,3,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 4) { setInv(player, 6, 1); SetInv(player, 20, 4); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,4,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,4,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 5) { setInv(player, 7, 1); SetInv(player, 20, 5); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,5,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,5,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 6) { setInv(player, 8, 1); SetInv(player, 20, 6); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,6,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,6,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 7) { setInv(player, 9, 1); SetInv(player, 20, 7); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,7,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,7,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } if(level == 8) { setInv(player, 10, 1); SetInv(player, 20, 8); if(getplayerteam(jkgetlocalplayer())==1 || getplayerteam(jkgetlocalplayer())==3) {sendtrigger(-3,8,player,8,0,0); playsoundglobal(warriorup,1,0.0,0x0);} if(getplayerteam(jkgetlocalplayer())==2 || getplayerteam(jkgetlocalplayer())==4) {sendtrigger(-3,8,player,8,0,0); playsoundglobal(cheeseup,1,0.0,0x0);} } } return; # ........................................................................................ end
Code:
# jk cog script # # 00_cheasemain.com # # [PJB] # # This is the main dark cheases cog. It relays the trigger for victory senarios and # resives the trigger for a loss, it deals out the players so there is allways an # almost equal number of players on eatch team, it plays the victory 'shout', and # it also plays the background music, if you can call my mad stuff music X-D # # it also fixes the team command bug that occoured when a chease player typed "team 3" # or similar as a command during a team game, makeing him appear to be a warrior, not a # chease. this has now been fixed by useing a local player skin checking cog. # # The victory trigger's 0 paramiter is the returnable, or unstoppable 'flag' basicaly # about ten to twenty seconds before there is no way to win (if the bomb countdown has # been started, or if the gaint chease orbit has begun to decay) the trigger is sent to # this cog, but with the 0 paramiter set to 0 (returnable), when it reaches a point where # there is NO way the opposeing team can win the trigger is sent a second time with the 0 # paramiter set to 1, this is mostly so if needed for a future sequal incoperateing a # larger objective can be done with ease but it also allows the taunts to be depenant on # progress. # # all the triggers have particular source refrenses (ID's) and i have nicnamed them # channels. here is a list of channels # # channel (ID/source) Task Paramiters # 7 Evolve a player up a level 0 = player # 8 Broardcast player and new skin 0 = player, 1 = model file (3do) # 9 Local skin changer cog returns 0 = player, 0 = side (0 chease or 1 warrior) # 10 Local skin changer cog request 0 = player # 11 Local skin changer cog payment 0 = player, 1 = side (0 chease or 1 warrior) # 12 victory trigger ( warriors ) 0 = 1 for no-return, 0 for returnable, 3 for external call # 13 turn view to a camera for all 0 = camera thing # 14 Victory Trigger ( Chease ) 0 = 1 for no-return, 0 for returnable, 3 for external call symbols template walkplayer=walkplayer message startup message trigger message pulse message Join message leave message killed sound cheasetunt sound warriortunt sound cheasewin sound warriorwin sound backmusic1 sound backmusic2 int music local int m=0 local int b=0 local int c=0 local flex backvol=0.5 sound back1sing1 sound back1sing2 sound back2sing1 sound back2sing2 flex rnd=0 local int a=0 local flex singvol=1 sound newwarrior sound newchease float rate=0.5 thing player local int warrior_count=0 local int chease_count=0 local int pl local thing d local thing killer local thing kill local int i=0 local int limit local int kteam=0 local int team=0 local end # ======================================================================================== code startup: // Register COG as master COG SetMasterCOG(GetSelfCOG()); if(IsMulti()) if(!IsServer()) return; //check if multiplayer, then if this is not the server go home SetMultiModeFlags(0x101); limit = GetScoreLimit(); //get score limit ClearMultiModeFlags(0x8); //disable normal score limit handeling ClearMultiModeFlags(0x82); //enable freindly fire, and make it a multi level game SetMultiModeFlags(0x4); //disable normal scoreing for(i=0;i<=GetAbsoluteMaxPlayers();i=i+1) { HeapSet(i, 0); } music = playsoundglobal(backmusic1, backvol, 0.0, 0x1); setpulse(rate); // initalise the pulse to check for destroyed targets, compleated // objectives, and other stuff not handeled by triggers AKA (music) if(chease_count == warrior_count) //descide the players model { rnd=rand()*2; if(rnd < 1) {pl=1; warrior_count=warrior_count+1;} if(rnd >= 1) {pl=0; chease_count=chease_count+1;} sendtrigger(-3,11,GetPlayerThing(0),pl,0,0); //boot up skin cog with player and team info } capturething(GetPlayerThing(0)); return; # ........................................................................................ trigger: if(getsourceref()==7){if(IsMulti()) if(!IsServer()) return;} //not delt with here else if(getsourceref()==8){if(IsMulti()) if(!IsServer()) return;} //not delt with here else if(getsourceref()==9) { if(IsMulti()) if(!IsServer()) return; player=getparam(0); if(getparam(1)) warrior_count = warrior_count -1; if(!getparam(1)) chease_count = chease_count -1; } else if(getsourceref()==10){if(IsMulti()) if(!IsServer()) return;} //not delt with here else if(getsourceref()==11){if(IsMulti()) if(!IsServer()) return;} //not delt with here else if(getsourceref()==12) { if(IsMulti()) if(!IsServer()) return; if(getparam(0)==1 || getparam(0)==3) playsoundglobal(warriorwin, 1, 0.0, 0x0); if(getparam(0)==0) playsoundglobal(warriortunt, 1, 0.0, 0x0); } else if(getsourceref()==13){if(IsMulti()) if(!IsServer()) return;} //not delt with here if(getsourceref()==14) { if(IsMulti()) if(!IsServer()) return; if(getparam(0)==1 || getparam(0)==3) playsoundglobal(cheasewin, 1, 0.0, 0x0); if(getparam(0)==0) playsoundglobal(cheasetunt, 1, 0.0, 0x0); } return; # ........................................................................................ pulse: // start random "singing" in the music section a = a + 1; if(rate * a >= 20) { rnd=rand()*3; if(rnd <= 2) { a=0; if(m==0 && rnd <1){playsoundglobal(back1sing1, singvol, 0.0, 0x0);} if(m==0 && rnd >= 1){playsoundglobal(back1sing2, singvol, 0.0, 0x0);} if(m==1 && rnd <1){playsoundglobal(back2sing1, singvol, 0.0, 0x0);} if(m==1 && rnd >= 1){playsoundglobal(back2sing2, singvol, 0.0, 0x0);} } } // end random "singing" in the music section // start music changer section b = b + 1; if(rate*b >= 180) { if(c == 0) StopSound(music, rate*4); if(c >= 5) { if(!m){music = playsoundglobal(backmusic2, backvol, 0.0, 0x1); b = 0; c = 0;} if(m) {music = playsoundglobal(backmusic1, backvol, 0.0, 0x1); b = 0; c = 0;} } } // end music changer section return; # ........................................................................................ Join: player=getsenderref(); capturething(player); if(warrior_count < chease_count) {pl=1; warrior_count=warrior_count+1;} if(chease_count < warrior_count) {pl=0; chease_count=chease_count+1;} if(chease_count == warrior_count) { rnd=rand()*2; if(rnd < 1) {pl=1; warrior_count=warrior_count+1;playsoundglobal(newwarrior,1,0.0,0x0);} if(rnd >= 1) {pl=0; chease_count=chease_count+1;playsoundglobal(newchease,1,0.0,0x0);} } sendtrigger(-3,11,GetPlayerNum(player),pl,0,0); return; # ........................................................................................ leave: player=getsenderref(); sendtrigger(-3,10,player,0,0,0); return; # ........................................................................................ killed: kill=getsenderref(); d=getsourceref(); if(GetThingTemplate(d)==walkplayer) {killer = d; call score; return;} for(i=0;i<6;i=i+1) { d=GetThingParent(d); if(GetThingTemplate(d)==walkplayer) {killer = d; call score; return;} } return; # ........................................................................................ score: kteam=getplayerteam(kill); if(kteam==4) kteam=2; if(kteam==3) kteam=1; team=getplayerteam(kill); if(team==4) team=2; if(team==3) team=1; if(kteam==team) { SetPlayerScore(killer, GetPlayerScore(killer)-1); SetPlayerKilled(killer, GetPlayerKilled(killer)-1); SetTeamScore(getplayerteam(killer), GetTeamScore(getplayerteam(killer))-1); } if(kteam != team) { SetPlayerKills(killer, GetPlayerKills(killer)+1); SetPlayerScore(killer, GetPlayerScore(killer)+1); SetTeamScore(getplayerteam(killer), GetTeamScore(getplayerteam(killer))+1); } if(GetPlayerScore(killer)>=limit) { if(getplayerteam(killer)==1 || getplayerteam(killer)==3) { sendtrigger(-3,12,3,0,0,0); jkStringClear(); jkStringConcatAsciiString("The Warriors Reatched The Score Limit"); jkStringOutput(-3, -1); } if(getplayerteam(killer)==2 || getplayerteam(killer)==4) { sendtrigger(-3,14,3,0,0,0); jkStringClear(); jkStringConcatAsciiString("The cheases Reatched The Score Limit"); jkStringOutput(-3, -1); } } if(getplayerscore(killer)>9) { if(getplayerscore(killer)==10)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==20)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==30)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==40)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==50)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==60)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==70)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==80)sendtrigger(-3,7,killer,0,0,0); if(getplayerscore(killer)==90)sendtrigger(-3,7,killer,0,0,0); } return; # ........................................................................................ end
Code:
# Jk cog script # # pj_timelimit.cog # # [PJB] # # The function of this cog is simple, find the time limit of the game # move it from automated to cog handled, then when it is reched move a thing # and end the game for everyone.. symbols message startup message arrived message pulse message Trigger thing chease thing camera thing camera2 float Speed=5.0 flex sleept=1 int minites local int seconds=59 local int time local int i=0 local int timeD=10 # Cog will defualt to timeD if no limit is set (0 = no limit) sound start sound decaying sound verysoon sound fixed end # ======================================================================================== code startup: if(IsMulti()) if(!IsServer()) return; //check if multiplayer, then if this is not the server go home time = GetTimeLimit(); if(time > 0) // if theres a limit set from JK { ClearMultiModeFlags(0x10); } Else //if not defualt to one from JKL { time = timeD; ClearMultiModeFlags(0x10); } if(!time) return; //if the time limit is zero end here PlaySoundGlobal(start, 1, 0.0, 0x0); minites = time - 1; capturething(chease); setpulse(1); //begin pulse! return; # ........................................................................................ arrived: //if(getcurframe(chease)==2) jkendlevel(1); if(i==0) { SendTrigger(-1, 14, 1, 0, 0, 0); movetoframe(chease, 2, speed/2); sendtrigger(-1, 13, camera,0,0,0); i=1; sleep(sleept); jkendlevel(1); } return; # ........................................................................................ trigger: if(getsourceref()==12) { if(getparam(0)!=3 || getparam(0)!=1) return; movetoframe(chease,0,speed); jkStringClear(); jkStringConcatAsciiString("The Warriors Fixed The Cheases Orbit"); jkStringOutput(-3, -1); sendtrigger(-1, 13, camera2,0,0,0); PlaySoundGlobal(fixed, 1, 0.0, 0x0); setpulse(0); } if(getsourceref()==14) { if(getparam(0)!=3) return; setpulse(0); movetoframe(chease, 1, speed); SendTrigger(-1, 14, 1, 0, 0, 0); jkStringClear(); jkStringConcatAsciiString("The Warriors are To Late, The Chease's Orbit Has Begun To Decay!"); jkStringOutput(-3, -1); PlaySoundGlobal(decaying, 1, 0.0, 0x0); } return; # ........................................................................................ pulse: seconds=seconds-1; if(seconds <= 30 && !minites || seconds==30 && minites <5 && minites >0) call printtime; if(seconds == 15 && !minites) PlaySoundGlobal(verysoon, 1, 0.0, 0x0); if(!minites && !seconds) { seconds = 10; jkStringClear(); jkStringConcatAsciiString("The Warriors Are Almost To Late, The Chease's Orbit Has Begun To Decay!"); jkStringOutput(-3, -1); SendTrigger(-1, 14, 0, 0, 0, 0); sleep(getsoundlen(decaying)); movetoframe(chease, 1, speed); PlaySoundGlobal(decaying, 1, 0.0, 0x0); setpulse(0); } if(!seconds) { seconds=59; minites = minites-1; call printminite; } return; # ........................................................................................ printminite: jkStringClear(); jkStringConcatAsciiString("Theres Only: "); jkStringConcatInt(minites+1); jkStringConcatAsciiString(" minites remaining"); jkStringOutput(-3, -1); PlaySoundGlobal(verysoon, 1, 0.0, 0x0); return; # ........................................................................................ printtime: jkStringClear(); jkStringConcatAsciiString("Warning, Time To Decay Is "); jkStringConcatInt(minites); jkStringConcatAsciiString(":"); jkStringConcatInt(seconds); jkStringOutput(-3, -1); return; end
Code:
# JK cog script # # 00_camera.cog # # [PJB] # # This cog will when resiveing the correct trigger, set the # players camera to the thing it resives as an argument with # the trigger. In this way setting all players cameras in # a multiplayer game to one thing. flags=0x100 # Runs cog loccaly on all mashines, so the players checked on eatch mashine # not just the hosts. (so its not only the host that sees the camera view) symbols message trigger end code trigger: if(getsourceref()!=13) return; SetCameraFocus(0, GetParam(0)); SetCameraFocus(1, GetParam(0)); SetActorFlags(jkgetlocalplayer(), 0x200001); ClearPhysicsFlags(jkgetlocalplayer(), 0x1); SetPhysicsFlags(jkgetlocalplayer(), 0x800); return; end
------------------
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?