Criminal System in a Map
Moderator: Moderators
- da_great_ghost
- Corporal

- Posts: 141
- Joined: Sat Feb 02, 2008 3:40 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: , Location, Location, Location
Criminal System in a Map
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!
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!
Last edited by da_great_ghost on Fri Apr 24, 2009 1:41 pm, edited 1 time in total.
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Some Coding Questions
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.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Some Coding Questions
You should be able to do it but it will be a hack. You will have to force spawn the temp prisoner team members.
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Some Coding Questions
Yeah, I guess he could do the team 0 thing you did in deathmatch mode.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Some Coding Questions
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.
- da_great_ghost
- Corporal

- Posts: 141
- Joined: Sat Feb 02, 2008 3:40 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: , Location, Location, Location
Re: Some Coding Questions
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?
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Criminal System in a Map
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.
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.
- da_great_ghost
- Corporal

- Posts: 141
- Joined: Sat Feb 02, 2008 3:40 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: , Location, Location, Location
Re: Criminal System in a Map
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.
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.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Criminal System in a Map
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.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Criminal System in a Map
Code: Select all
ScriptCB_PlayerSuicide = function() print("Haha, no death for you") endYou 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?
- RED51
- Jedi

- Posts: 1024
- Joined: Sun Sep 07, 2008 6:25 pm
Re: Criminal System in a Map
Yes, a fusion cutter can damage objects if givin a negative number.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Criminal System in a Map
Killer should be "0" or the player.[RDH]Zerted wrote:I think it doesn't have a killer when a player suicides...
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Criminal System in a Map
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.
- da_great_ghost
- Corporal

- Posts: 141
- Joined: Sat Feb 02, 2008 3:40 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: , Location, Location, Location
Re: Criminal System in a Map
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.
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.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Criminal System in a Map
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.
- da_great_ghost
- Corporal

- Posts: 141
- Joined: Sat Feb 02, 2008 3:40 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: , Location, Location, Location
Re: Criminal System in a Map
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.
Last edited by da_great_ghost on Tue Apr 28, 2009 4:34 pm, edited 1 time in total.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Criminal System in a Map
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....
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Criminal System in a Map
IsCharacterInRegion() is the correct function.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Criminal System in a Map
Goody, I guessed right! I assume it's IsCharacterInRegion(character, region)?[RDH]Zerted wrote:IsCharacterInRegion() is the correct function.
- Frisbeetarian
- Jedi

- Posts: 1233
- Joined: Wed Sep 12, 2007 3:13 pm
Re: Criminal System in a Map
Are the docs really so hard to look at? Go check the scripting system document, it's in there.
