Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Swapping between tons of hero pictures/palettes

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Thu Oct 22, 2009 2:18 am    Post subject: Swapping between tons of hero pictures/palettes Reply with quote

This is all theoretical stuff that I'm not going to be attempting for another month, but I figured it'd be good to collect insights well beforehand.

Project SHiIDA features a single protagonist (Katrina), and as such would normally only feature 1 string of hero pictures and walkabouts. What I want to do is change these sprites according to certain variables - weapon held, robe worn, and current status.
For simplicity's sake I'm going to ignore the status variable and focus on the other two, which combine into this chart (actually a checklist):

Robes are listed horizontally, weapons vertically.
In total this will make 30 sets of battle sprites and 5 sets of walkabouts (which ignore weapons).

Theoretically this is easy to pull off - just assign each robe and weapon an individual tag. But I need to know when and how to make these changes happen every time the player changes equipment.
Back to top
View user's profile Send private message
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Thu Oct 22, 2009 4:57 am    Post subject: Reply with quote

The best way would probably be to have a custom equipment menu that is filled pretty much with 'force equip' and the sprite-swapping immediately following.

An alternatively slower method is to have a each-step script check for this stuff (ewww).
Back to top
View user's profile Send private message Send e-mail AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Oct 22, 2009 9:28 am    Post subject: Reply with quote

Or this as an on-keypress script:

Code:
script, onkeypress, begin
 if (key is pressed(key:alt) || key is pressed(key:esc)) then (
  main menu
  # do equipment check
  # prevent re-triggering
  while (key is pressed(key:alt) || key is pressed(key:esc)) do (wait(1))
 )
end


That's not foolproof, but it's good enough.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Thu Oct 22, 2009 12:11 pm    Post subject: Reply with quote

This is cool.

Triggering the picture changes after equipment changes should be easier than you think.

Just edit your main menu so that the "Equip" menu is wrapped in a script.

Code:

plotscript, equip wrapper, begin
  equip menu
  enforce equipment sprite
end


No need to use each-step, no need to use on-keypress.

Your menu should be configured to allow scripts to run while it is open.

The only catch is that you can't enable "Equip" in shop menus (unless you don't mind wrapping every single shop in a script)

Also, this reminds me of 'Plan for hero sprite overlays' but I won't be ready to tackle that one anytime soon...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Oct 23, 2009 10:30 am    Post subject: Reply with quote

I found a bug in my plan. the equip menu does not update the bitsets when you exit. They were not getting updated until the main menu closed.

I fixed that in the latest nightlies, and I also tweaked the "equip menu" command so it can easily equip the first hero regardless of whether they are in the first slot.

I like the idea of changing hero graphics in this way well enough that I am going to try it in the next release of Wandering Hamster. Here is the script I am using:

Code:

plotscript, wrapped equip menu, begin
  if(room in active party == 3) then(
    # only one hero
    equip menu
    update hero sprites
    exit script
  )
 
  # more than one hero, pick one
  variable(who)
  who := pick hero
  if(who >= 0) then(
    equip menu(who)
    update hero sprites
  )
end


I am not hardcore enough to draw graphics for every single combination of equipment, but I am going to do it for a few things, namely James's hat and Havoc's mask. Maybe Dusty's trousers too. I am not sure if I want wiener dog nudity in the game ;)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Fri Oct 23, 2009 4:25 pm    Post subject: Reply with quote

James Paige wrote:
I fixed that in the latest nightlies, and I also tweaked the "equip menu" command so it can easily equip the first hero regardless of whether they are in the first slot.

Whoa! Super service! I'm going into overtime just for this.
Back to top
View user's profile Send private message
Fenrir-Lunaris
WUT




Joined: 03 Feb 2003
Posts: 1747

PostPosted: Sat Oct 24, 2009 12:10 pm    Post subject: Reply with quote

James Paige wrote:
I am not hardcore enough to draw graphics for every single combination of equipment, but I am going to do it for a few things, namely James's hat and Havoc's mask. Maybe Dusty's trousers too. I am not sure if I want wiener dog nudity in the game Wink


That's what we call fan-service. Wiener dog nudity can easily be fixed by using black bars (ha ha) or boxer shorts with bones on them. I suggest the latter. Also Bob's been walking around nekkid the whole time, and NOBODY has said a thing?
Back to top
View user's profile Send private message
NeoSpade
Of course!




Joined: 23 Sep 2008
Posts: 249
Location: Wales GB

PostPosted: Sun Oct 25, 2009 1:10 am    Post subject: Reply with quote

I really have been good to resist the "wiener" dog joke for a whole day :p (and I'm quite surprised no-one has made it)

...

Well I'll say it now;

lol he really would be a wiener dog then!

...tasteless...xD
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Wed Oct 28, 2009 6:17 am    Post subject: Reply with quote

I just realized a fatal flaw with my plan. Switching around weapon types would switch around the animation, but NOT the hand positions!
And to my knowledge there is no way to change hand positions or weapon handles through plotscripting.

My best solution: Scrap weapon graphics altogether and just draw the weapons on the hero sprites. 6 weapon types really should be more than enough for one character, and 2 of them are one-of-a-kind anyway.
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Oct 28, 2009 7:46 am    Post subject: Reply with quote

You wouldn't need to change handle positions, because that comes from the weapon data... but the hero hand positions is indeed a problem. I didn't think of that...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Wed Oct 28, 2009 4:39 pm    Post subject: Reply with quote

Hmm. I suppose I could try and set both the hand position and the weapon handle to (0,0) and carefully draw them together from there.
In fact, using this technique, I could theoretically expand the hero's attacking frame.
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Oct 28, 2009 4:55 pm    Post subject: Reply with quote

Is the hero's hand position really going to need to be different for each spriteset? You are just having one hero with different costume changes, right?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Wed Oct 28, 2009 5:35 pm    Post subject: Reply with quote

Costume change with robes is half of it, the other part is making a visual difference in attack animations with weapons. This only affects the Attack A and Attack B frames, by the way.

What I have are knives, swords, staves, wands, and two specialty weapons.
Knives and swords are swung in an arc, but there's a definite weight difference between the two that I want to draw. Staves are for whacking, not cutting; usually swung at a different angle, too.
The wand animation is basically spell-casting with an instrument, making it the most unusual of all the weapons.

The last two are your "ultimate" weapons, and I think having separate animations just makes them more special.
The two knives (Fury Daggers) are swung around like mad, for players who enjoy all-out offense. The shining sword (Katana) is the exact opposite in animation and execution, imitating the smooth, controlled Iaidō style; it's draining, but keeps the players' options open.

This may be excessive, but it's a little detail that I know I'd appreciate in a game. I noticed while working on Viridia that the main character, who could wield a sword or bow, would be impossible to animate with the same hand positions and sprites. The Final Fantasy route seems cheap to me; a hero attacking with a bow will just swing his arms and the bow magically manipulates itself to fire.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group