Page 1 of 2
Criminal System in a Map
Posted: Wed Apr 22, 2009 11:11 pm
by da_great_ghost
Alright id first like to say I'm only asking if this is even remotely possible. I want to know before I start working on it.
What I'm trying to accomplish is a successful criminal system for a map. My idea was that the 2 playable teams are civilians and imperials. When you kill something on one of those teams your transfered to the criminal team. The criminal team is hostile to both the playable teams and when killed is sent to the prisoner team(only cp is in the jail). Remember this has to be online compatible.
Also, if anyone has any suggestions/ideas to a better system feel free to comment. Thanks in advance!
Re: Some Coding Questions
Posted: Thu Apr 23, 2009 6:36 am
by Teancum
Nope. The max is two playable teams. Past that you can have lots more AI teams, but a human player can't be on team 1 or 2 then go to team 3.
Re: Some Coding Questions
Posted: Thu Apr 23, 2009 3:02 pm
by [RDH]Zerted
You should be able to do it but it will be a hack. You will have to force spawn the temp prisoner team members.
Re: Some Coding Questions
Posted: Thu Apr 23, 2009 3:16 pm
by Teancum
Yeah, I guess he could do the team 0 thing you did in deathmatch mode.
Re: Some Coding Questions
Posted: Thu Apr 23, 2009 6:11 pm
by Fiodis
It sounds like all he wants to do is punish the player by sending him to jail if he kills an Imperial or Civilian. He doesn't need a "criminal" team for this, though; he could just use an OnCharacterDeath line, check to see if the killer is human, not AI, and if so teleport him to a node placed in a jailhouse. Completely possible this way.
Re: Some Coding Questions
Posted: Fri Apr 24, 2009 1:39 pm
by da_great_ghost
Ok that sounds a lot simpler but can I define what team goes to jail and what team qualifies as a murder(I don't want people going to jail over killing a tusken raider). Also, I kinda wanted to add a way to break out. Is there a way to prevent people from killing themselves?
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 3:32 pm
by Fiodis
There is an easy way to check what the victim of the murder was. Then, if it was a Tusken, you can rig it so that there is no teleport - possibly even a reward.
There is no simple way I know of to prevent people suiciding (or, for that matter, teleoprting out via Online Host's Player Lobby "teleport" command). However, you can rig it so that there are severe penalties for suiciding, to discourage people from doing it.
How good are you at LUA coding? The things I'm describing aren't very hard, but they aren't too basic, either.
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 4:43 pm
by da_great_ghost
What about just removing the button from the HUD?
And as far as lua coding goes I've done the basics, but no missions scripting or anything. But from what looked at it seems simple enough.
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 8:16 pm
by Fiodis
I'm not sure how easy that HUD thing would be. You'd have to make a new ingame.lvl and edit the HUD...I've never done that before.
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 8:33 pm
by [RDH]Zerted
Code: Select all
ScriptCB_PlayerSuicide = function() print("Haha, no death for you") end
is all you need to do to prevent anyone from being manually killed through the menus. However, this won't stop someone from falling long distances or blowing themselves up.
You can detect suicides using OnCharacterDeath. I think it doesn't have a killer when a player suicides... If this happens, you can just force spawn the player right back into jail.
Can a fusion cutter damage objects if its given a negative repair rate?
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 8:44 pm
by RED51
Yes, a fusion cutter can damage objects if givin a negative number.
Re: Criminal System in a Map
Posted: Fri Apr 24, 2009 10:37 pm
by Maveritchell
[RDH]Zerted wrote:I think it doesn't have a killer when a player suicides...
Killer should be "0" or the player.
Re: Criminal System in a Map
Posted: Sat Apr 25, 2009 11:27 am
by Teancum
When they're killed why not set them to a unit class that has no weapons, then spawn them in jail. That way you don't have to check for suicides in jail.
Re: Criminal System in a Map
Posted: Sat Apr 25, 2009 7:29 pm
by da_great_ghost
Well all I wanted to accomplish was taking away the menu suicide. Also i wanted to add a jailbreak feature to the map to make it fun.
So what is possible is to teleport a player to jail once he kills another unit on a list of things not to kill. Seems pretty foolproof.
Re: Criminal System in a Map
Posted: Sat Apr 25, 2009 7:47 pm
by Fiodis
It won't work, of course, if the victim is, say, pushed into a death region. But it will work if the the victim is killed by any weapon that does damage. Push, in this example, does no damage, therefore this code will not register it as an attack and it will go unpunished. But otherwise yes, it is rather good.
Re: Criminal System in a Map
Posted: Tue Apr 28, 2009 4:25 pm
by da_great_ghost
One last question, is it possible to limit this function to a specific region of the map? As in you can kill outside a city but inside you will get teleported or a pvp arena.
Re: Criminal System in a Map
Posted: Tue Apr 28, 2009 4:33 pm
by Fiodis
As in, check if the player is within a region? Eh...I think its possible. Is "IsCharacterInRegion" a valid statement? I know there's one to check for flyers....
Re: Criminal System in a Map
Posted: Wed Apr 29, 2009 1:42 pm
by [RDH]Zerted
IsCharacterInRegion() is the correct function.
Re: Criminal System in a Map
Posted: Wed Apr 29, 2009 4:08 pm
by Fiodis
[RDH]Zerted wrote:IsCharacterInRegion() is the correct function.
Goody, I guessed right! I assume it's IsCharacterInRegion(character, region)?
Re: Criminal System in a Map
Posted: Wed Apr 29, 2009 4:11 pm
by Frisbeetarian
Are the docs really so hard to look at? Go check the scripting system document, it's in there.