substitutions (other)

Discussions about the internal structures of the game. You can also post here if you'd like to know how things really work (and don't know how to read C code).
Post Reply
cornflakes4brains
Posts: 5
Joined: Fri Jul 23, 2010 2:39 pm
Location: stuck in wisconsin
Contact:

substitutions (other)

Post by cornflakes4brains »

been picking my brain to try to add in a line to disallow opposing teams from putting players back into play who have been substituted out (since once out, you're done for the day in real games). their being able to reinstate substituted players removes any advantage to getting the other coach to "blink first" and remove a guy he wished he could have back later. any suggestions?
if knowledge is power, why is the government running the show?
gunnar
Site Admin
Posts: 233
Joined: Wed Oct 19, 2005 11:13 am
Contact:

Re: substitutions (other)

Post by gunnar »

hmm, that's a bug that has been in there for a long time. Well, in live_game_struct.h we'll have to add the id of the substituted players. Then in player.c (in player_swap) you'll need to check in the if(stat0 == STATUS_LIVE_GAME_PAUSE) part if the id you're trying to substitute in is already in the substitute list. However the substitute list can only become final when the user clicks resume match as he should be able to undo a wrong change.
cornflakes4brains
Posts: 5
Joined: Fri Jul 23, 2010 2:39 pm
Location: stuck in wisconsin
Contact:

Re: substitutions (other)

Post by cornflakes4brains »

btw...played football manager since it was on paper (i know, i'm an old fart), and just love this more. simple reason is random teams and names...no advantage to knowing players, and no need to change *tons* of files on player stats every year.

if i mess up, i just deliberately make 4 subs and it resets...i was on about how to stop the computer from kinda cheating by playing musical chairs to put, say, an extra attacker in for 5 minutes, then yank him out and put the original defender back in. it'd be simple enough to tell the app to treat a removed player as injured or carded, but the first would reset his health to around 60, the 2nd would (a) add a red card to his history, and (b) reset his yellow count...giving a guy with 4 yellows a clean slate.

the way the game construct goes, it needs a tag to recognize the player as gone, and just trying to come up with a way to tag him without some sanction (other than negative points for having been substituted). if i have a flash of brilliance (ahem...looking at the floor wondering where my shoelaces went...) i'll let you know.
if knowledge is power, why is the government running the show?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: substitutions (other)

Post by gyboth »

The tag idea isn't so bad... You could just add a new boolean attribute (WasSubstituted or somesuch) to the player struct, set it to false for each player at the beginning of the game (e.g. in game_initialize()); check it when the list of suitable players for subbing in is compiled in game_substitute_player(); and set it to true for the substituted player in the same function. And the good thing is, there's no need to save/load the attribute, since it's transient information anyway (can't save the game during a match, after all).
Press any key to continue or any other key to quit.
gunnar
Site Admin
Posts: 233
Joined: Wed Oct 19, 2005 11:13 am
Contact:

Re: substitutions (other)

Post by gunnar »

gyboth wrote:The tag idea isn't so bad... You could just add a new boolean attribute (WasSubstituted or somesuch) to the player struct
Personally I would put it in the live struct and I would save it, so we can show in the match statistics who was substitued.
cornflakes4brains
Posts: 5
Joined: Fri Jul 23, 2010 2:39 pm
Location: stuck in wisconsin
Contact:

Re: substitutions (other)

Post by cornflakes4brains »

since there is "a tag", no new one *should* be needed...but...all i could come up with so far for an idea was to add

float_player_sub_out_ban_1

as with the ban durations for penalties, but the game doesn't even sneeze at that one.

also tried

float_player_sub_out_ban_1...no luck

even tried cheating and adding it as a category of injury...that not only didn't work, the game wouldn't pause, then reset to start the game over. the problem is, there's only mention of sub_in/sub_out as it affects a players rating...and i see no connection with that item to anything else, or how to create one.
if knowledge is power, why is the government running the show?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: substitutions (other)

Post by gyboth »

Not sure what you're trying to tell us here. Have you just fiddled with the constants file, or did you actually change the source code? The former won't work, of course, since we're talking about a new feature here. You definitely need to dive into the code and change things across several files.
Press any key to continue or any other key to quit.
cornflakes4brains
Posts: 5
Joined: Fri Jul 23, 2010 2:39 pm
Location: stuck in wisconsin
Contact:

Re: substitutions (other)

Post by cornflakes4brains »

just trying the files, since i don't have (and can't seem to find where to get) the source code. maybe i've gone senile, but i haven't been able to find a download for the source code, and can't find it in the file system...like i said..."nice shoelaces"...

where exactly would i get my hands on the actual source code? all i've found is the page on writing your own country from scratch and adding it in.
if knowledge is power, why is the government running the show?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: substitutions (other)

Post by gyboth »

The source package is this one:

http://sourceforge.net/projects/bygfoot ... 2/download

You can recognise the source package on the download page by the ending (.tar.bz2, without any other suffix like "binary").
Press any key to continue or any other key to quit.
cornflakes4brains
Posts: 5
Joined: Fri Jul 23, 2010 2:39 pm
Location: stuck in wisconsin
Contact:

Re: substitutions (other)

Post by cornflakes4brains »

that'd be the one...forgot i just installed with yum (and hadn't grabbed the windoze version).i'll pick through and if i have a (useful) idea, i'll pass it along.
if knowledge is power, why is the government running the show?
Post Reply