Criminal System in a Map

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

User avatar
da_great_ghost
Corporal
Corporal
Posts: 141
Joined: Sat Feb 02, 2008 3:40 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: , Location, Location, Location

Criminal System in a Map

Post 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!
Last edited by da_great_ghost on Fri Apr 24, 2009 1:41 pm, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Some Coding Questions

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Some Coding Questions

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Some Coding Questions

Post by Teancum »

Yeah, I guess he could do the team 0 thing you did in deathmatch mode.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Some Coding Questions

Post 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.
User avatar
da_great_ghost
Corporal
Corporal
Posts: 141
Joined: Sat Feb 02, 2008 3:40 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: , Location, Location, Location

Re: Some Coding Questions

Post 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?
User avatar
Fiodis
Master of the Force
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

Post 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.
User avatar
da_great_ghost
Corporal
Corporal
Posts: 141
Joined: Sat Feb 02, 2008 3:40 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: , Location, Location, Location

Re: Criminal System in a Map

Post 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.
User avatar
Fiodis
Master of the Force
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

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Criminal System in a Map

Post 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?
User avatar
RED51
Jedi
Jedi
Posts: 1024
Joined: Sun Sep 07, 2008 6:25 pm
Games I'm Playing :: SWBFII

Re: Criminal System in a Map

Post by RED51 »

Yes, a fusion cutter can damage objects if givin a negative number.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Criminal System in a Map

Post by Maveritchell »

[RDH]Zerted wrote:I think it doesn't have a killer when a player suicides...
Killer should be "0" or the player.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Criminal System in a Map

Post 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.
User avatar
da_great_ghost
Corporal
Corporal
Posts: 141
Joined: Sat Feb 02, 2008 3:40 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: , Location, Location, Location

Re: Criminal System in a Map

Post 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.
User avatar
Fiodis
Master of the Force
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

Post 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.
User avatar
da_great_ghost
Corporal
Corporal
Posts: 141
Joined: Sat Feb 02, 2008 3:40 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: , Location, Location, Location

Re: Criminal System in a Map

Post 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.
Last edited by da_great_ghost on Tue Apr 28, 2009 4:34 pm, edited 1 time in total.
User avatar
Fiodis
Master of the Force
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

Post 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....
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Criminal System in a Map

Post by [RDH]Zerted »

IsCharacterInRegion() is the correct function.
User avatar
Fiodis
Master of the Force
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

Post by Fiodis »

[RDH]Zerted wrote:IsCharacterInRegion() is the correct function.
Goody, I guessed right! I assume it's IsCharacterInRegion(character, region)?
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Criminal System in a Map

Post by Frisbeetarian »

Are the docs really so hard to look at? Go check the scripting system document, it's in there.
Post Reply