Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → kill credits in multiplay
kill credits in multiplay
2002-11-14, 4:33 PM #1
Oops, I originally put this question in the lesser forum. Here goes again...
Is there a way to give 5 kill credits instead of 1 in multiplayer JK? Suicides and non-player caused deaths need to still subtract only 1 kill.
2002-11-15, 5:49 AM #2
Theres probably and easier way, but Id do it like this, and have each player running the cog locally.

Err and I cant remember offhand if GetSourceRef() is used to return trigger id number. That could be wrong.

Code:
symbols

message startup
message killed
message trigger

end

# ========================================================================================

code

startup:
	player = GetLocalPlayerThing();
	Return;

# ========================================================================================

killed:
	killer = GetSourceRef();
	if(GetThingType(killer) == 10 && killer != player)
	{
         SendTrigger(GetPlayerThing(0), 95124, killer, 0, 0, 0);
	}
        Return;

# ========================================================================================

trigger:
        if(GetSourceRef() == 95124)
        {
         victor = GetParam(0);
         // its +4 due because the original kill earns you 1
         SetPlayerKills(victor, GetPlayerKills(victor) + 4);  
         SetPlayerScore(victor, GetPlayerScore(victim) + 4);
         SyncScores(); 
        }
        Return;

# ========================================================================================
end
- Wisdom is 99% experience, 1% knowledge. -
2002-11-15, 7:39 AM #3
Thank you. I tried that out today. Im hoping this will keep a very suicidal level on the positive side in the scoring!

Though, I havent got it to work...But I have some questions on how this should be used. Is this meant to be 1 cog acting alone sending a trigger to itself? What the heck is victim? Am I right to assume victor and player and killer are all local things? If this is to be run locally what good does syncscores do? And wouldnt "killer" be assigned to the projectile that kills the player and not the actually killer player? And, and, uh thats all.

[This message has been edited by Gelatinous_Drool (edited November 15, 2002).]
2002-11-15, 10:18 AM #4
LoL **** you should have wrote it yourself cuz you were right on all accounts, sorry I was writing that from work, from memory.

1) the victim slipped in, it should have been victor.

2) Yes you should check if the thing killing the player has a parent.

3) Actaully unless your host, your sending the trigger to the other persons version of that cog. I would assign the cog to the player in items.dat or incorporate this code into another local cog. Thats what i meant by each player must run this locally.

It might be possible to run it just on host's killed: but I cant recall if another persons death sends the killed message to other players hence the triggers. SyncScores(); probably isnt nessesary but I think I remember reading that it might wait until next death to sync them without it.

Try this version:

Code:
symbols

message startup
message killed
message trigger

end
#====================================
code

startup:
  player = GetLocalPlayerThing();
  Return;

#====================================

killed:	
  killedby = GetSourceRef();
  killer = GetThingParent(killedby);
  if(GetThingType(killer) == 10 && killer != player)
  {
   SendTrigger(GetPlayerThing(0), 95124, killer, 0, 0, 0);
  }
  Return;

#====================================

trigger:
  if(GetSourceRef() == 95124)        
  {
   victor = GetParam(0);
   // its +4 due because the original kill earns you 1
   SetPlayerKills(victor, GetPlayerKills(victor) + 4);
   SetPlayerScore(victor, GetPlayerScore(victor) + 4);
   SyncScores();
  }
  Return;

#==================================
end
- Wisdom is 99% experience, 1% knowledge. -
2002-11-16, 3:03 PM #5
I hope YOU dont think I'm a goose.

new question:
WHATS THE MULTIPLAY KILL LIMIT?

↑ Up to the top!