greenkid Posted September 19, 2009 Author Share Posted September 19, 2009 Hey, Im trying to make a red vs blue game. Its pretty much just red vs blue pvp for me and a few friends, and I was wondering if the scipt for team pvp was to complex for me(Im new to Eclipse :P). Help would be greatly apreciated! Link to comment Share on other sites More sharing options...
Godlord Posted September 19, 2009 Share Posted September 19, 2009 http://www.touchofdeathforums.com/smf/index.php/topic,49497.0.htmlAs for scripting:http://www.touchofdeathforums.com/smf/index.php/topic,48978.0.htmlhttp://www.touchofdeathforums.com/smf/index.php/board,70.0.htmlYou might want to request a full script, although a lot of details should be given or you can use my pointers once you know a bit of Sadscript.To get and set the team, you'll have to write some functions:```Function GetPlayerTeam(Index) If IsConnected(Index) = False or IsPlaying(Index) = False Then GetPlayerTeam = 0 Exit Function End If If GetVar("Accounts\" & GetPlayerLogin(Index) & "\Char" & GetPlayerCharNum(Index) & ".ini", "Account", "Team") = vbNullString GetPlayerTeam = 0 Exit Function End If GetPlayerTeam = CInt(GetVar("Accounts\" & GetPlayerLogin(Index) & "\Char" & GetPlayerCharNum(Index) & ".ini", "Account", "Team"))End FunctionFunction SetPlayerTeam(Index, Team) If IsConnected(Index) = False or IsPlaying(Index) = False Then SetPlayerTeam = False Exit Function End If Call PuttVar("Accounts\" & GetPlayerLogin(Index) & "\Char" & GetPlayerCharNum(Index) & ".ini", "Account", "Team", CStr(Team)) SetPlayerTeam = TrueEnd Function```Preventing team members from attacking each other is quite simple, you just check if the target is from the same team as the attacker in OnAttack:```Sub OnAttack(Index) If GetPlayerTeam(Index) = GetPlayerTeam(GetPlayerTarget(Index)) And GetPlayerTeam(Index) <> 0 Then Call BattleMsg(Index, "You cannot attack a team member!", BRIGHTRED, 1) Exit Sub End If```Getting yourself in a team isn't really hard, it's just using SetPlayerTeam:```Call SetPlayerTeam(Index, 1) ' Get into team 1.```Or if you want to validate your setting:```If SetPlayerTeam(Index, 1) = False ' It failed...End If```The problem is mainly that there are various ways, you can set it the first time somebody joins your game using a custom menu, but you can also just get a NPC to set it for you. There are various ways to do it, but the key is using SetPlayerTeam.You can also implement points and kills, which is just rewriting GetPlayerTeam and SetPlayerTeam.Regards, Godlord. Link to comment Share on other sites More sharing options...
greenkid Posted September 20, 2009 Author Share Posted September 20, 2009 Thank you so much! Although, being the young noob that I am, is there any specific order I have to put it into the main.txt file?Thanks!EDIT- I tryed using a spell, but then I realized you could just convert someone from the other team without there consent… How could I make it so that when you start out you just choose red team or blue team, and then you go on your little way. My game is just using like dynmic classes I think the term is, where your class depends on the armor your wearing. Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now