ID:167709
![]() Feb 8 2006, 3:08 am
|
|
Is it posible to make for people in a team to collect one gold amount and if someone spends it it will go off everyones money it could be stored in a chamber/bank or something
|
![]() Feb 8 2006, 3:22 am
|
|
....It is possible but i do not know how to do it so i cant show you...
|
The best way to go about this is to have a team object that keeps track of who is in it, and give that team object the variable that keeps track of shared team resources. Teams have been discussed many times before, but I will scratch the surface of it once again.
team Then when you want a certain player to join a team, you can just all SwitchTeam for it, passing the team you want to join as an argument. Alright, now that I have recapped the basics of teams, I'll get right to the important part, the gold you mentioned. Just give the team object a gold variable, and add/subtract from that instead of the players'. team Show that to players instead of a personal gold variable. If you want players to also be able to have their own, personal stores of gold, you could leave them with a gold variable of their own, then when you display gold you could display gold+team.gold instead. Either way, you can also do this with other things besides gold. You could give the team object its own inventory list and have a shared stash of equipment too, or if it's a cabal of ritualistic mages that share their spell power you could have a central spell list on the team object. There's plenty you can do with this concept. |
Thanks i hope i can do it now and already got somekinda team code in but its just wich side you wish to be on
|
You just create more instances of the team object. If you want to have a bunch that people can choose from, you'll also want to give the team object a name variable.
team Then, if all teams are available to people to choose from, just keep a global list of them.
var/list/teams[0]
And if the game starts with a couple teams already formed, just make them in world/New world/New() Then, if you want to allow the creation of more teams, just add them in the same way. And to let people choose a team to join, just give them an input. team = input("","Join what team?")in teams That should list the team names. I recall seeing somewhere that if you define a name variable for non-atomic datums it should treat them the same way name-wise in input lists as it does with normal objects derived from /atom. If that's not the case you could still select a team, but it would just require a small amount more code. When you add teams to the teams list, instead of doing "teams += team" you would do "teams[team.name] = team", then where the player selects a team you would do something more like the following. team = input("","Join what team?")in teams But if I remember correctly, and the datums show properly in the input list in the first place, then you shouldn't require this. |
mob Problem how do i get every team to start somewhere else i did all the coding in you did now there is no error or something |
First let me say that I made a mistake. Well, almost...
I made that SwitchTeam function for a reason, then I forgot to use it. Use SwitchTeam(team) after they choose their team to have it set it up (that is, the team object recognises that player as part of the team). BBDragoon wrote: how do i get every team to start somewhere else i did all the coding in you did now there is no error or something There are several ways. The best would probably be to give teams a startpoint and set the location equal to that. team You could set the team's start location either at compiletime or runtime. If the teams will be static, you can probably do it easily enough at compile-time. team |