Small code request

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Small code request

Post by zookeeper »

This would be a fairly simple thing to code if you can code, I'd imagine. So, if there's a new coder lurking around somewhere, here's a perfect opportunity to contribute a small but useful feature. :)

The problem is this: the command mode command ":refresh" reloads all graphics files, which is very useful when tweaking and testing graphics in-game. But it only refreshes graphics. I'd like it to reload the sound files (not music though, just the effects) as well, so I could tweak and test sounds without the painful process of quitting and starting the game between every modification.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Re: Small code request

Post by Darth Fool »

zookeeper wrote:This would be a fairly simple thing to code if you can code, I'd imagine. So, if there's a new coder lurking around somewhere, here's a perfect opportunity to contribute a small but useful feature. :)

The problem is this: the command mode command ":refresh" reloads all graphics files, which is very useful when tweaking and testing graphics in-game. But it only refreshes graphics. I'd like it to reload the sound files (not music though, just the effects) as well, so I could tweak and test sounds without the painful process of quitting and starting the game between every modification.
Just a note: this should probably be a seperate command from refresh.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

:resound?

I think a :recache command would be popular too (sorry to derail).
Hope springs eternal.
Wesnoth acronym guide.
rrenaud
Posts: 34
Joined: February 8th, 2006, 5:43 am
Contact:

Post by rrenaud »

Does anyone want to take this on? If no one with experience wants to do this, I'd like to try. I want to start contributing some code to wesnoth, maybe this would be a good start? Can any developers give me some pointers on what files need to be modified? I guess understanding how :refresh works would be useful.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

scott wrote: I think a :recache command would be popular too (sorry to derail).
If by 'recache' you mean reload WML, you should note that this would be difficult to implement the way you probably want it.

The best we could probably do is to do the equivalent of saving the game, reloading all WML, and then reloading the game. However, if you make changes to the scenario this wouldn't have any effect since scenario data is only loaded at the start of a scenario -- after this it is all obtained from the save, which by definition would be using the old version of the scenario.

Reloading sound would be easy though. It might be best to make :refresh refresh everything by default, but support arguments. E.g. :refresh gfx or :refresh sfx or :refresh music or :refresh wml.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Dave wrote: If by 'recache' you mean reload WML, you should note that this would be difficult to implement the way you probably want it.

The best we could probably do is to do the equivalent of saving the game, reloading all WML, and then reloading the game. However, if you make changes to the scenario this wouldn't have any effect since scenario data is only loaded at the start of a scenario -- after this it is all obtained from the save, which by definition would be using the old version of the scenario.
If the hypothetical "recache" command just repeats what the game does at startup, requiring us to use start-of-scenario saves, that by itself would be enough to qualify as very useful.
Hope springs eternal.
Wesnoth acronym guide.
Post Reply