 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri May 04, 2007 10:27 pm Post subject: Two of my heroes get the same grafics |
|
|
When the battle starts two of my heroes get the same grafics. I precise that I'm talking about 2 different heroes and that there have correctly joined the party through plotscripting.
What is strange is that it does not happen all the time.
Has anyone saw something like this? _________________ It's time to make games! |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat May 05, 2007 10:47 pm Post subject: I've made some reasearch and... |
|
|
Ok! I've made some reasearch and it appears that my hero (sailor jupiter) does not get the good battle grafics after saving. She gets
the battle grafics of Sailor Mercury. (As you may remember, I'm working on a Sailor Moon game.
But the number of palette and pictures grafics are correct. This "bug"
may happen because
1) tag makoto is unactive
2) script ends too early (but then why would jupiter get new battle grafics.
Code: |
script, save game, begin #extract only
if(check tag (tag: Usagi)==ON) then, begin #Sailor Moon
find hero (hero: usagi chan)
set hero picture (me,10,inside battle)
set hero palette (me,11,inside battle)
end
if (check tag (tag: Minako)==ON) then, begin #Sailor Venus
find hero (hero: minako chan)
set hero picture (hero:minako chan,4,inside battle)
set hero palette (hero: minako chan,22,inside battle)
end
if(check tag (tag: Ami)==ON) then, begin #Sailor Mercury
find hero (hero: ami chan)
set hero picture (hero:ami chan,5,inside battle)
set hero palette (hero:ami chan,26,inside battle)
end
if (check tag (tag: Makoto)==ON) then, begin #sailor Jupiter
find hero (hero: makoto chan)
set hero picture (hero: makoto chan,9,inside battle)
set hero palette (hero: makoto chan,8,inside battle)
end
end #end for the script
|
As always help and suggestions ar welcomed! _________________ It's time to make games! |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun May 06, 2007 2:39 pm Post subject: |
|
|
You are not using "find hero" correctly. The position of the hero is just thrown away and then you use the hero's ID number where you should be using the position. Instead, store the position in a variable
Code: |
script, save game, begin #extract only
variable(hero)
if(check tag (tag: Usagi)==ON) then, begin #Sailor Moon
hero := find hero (hero: usagi chan)
set hero picture (hero,10,inside battle)
set hero palette (hero,11,inside battle)
end
if (check tag (tag: Minako)==ON) then, begin #Sailor Venus
hero := find hero (hero: minako chan)
set hero picture (hero,4,inside battle)
set hero palette (hero,22,inside battle)
end
if(check tag (tag: Ami)==ON) then, begin #Sailor Mercury
hero := find hero (hero: ami chan)
set hero picture (hero,5,inside battle)
set hero palette (hero,26,inside battle)
end
if (check tag (tag: Makoto)==ON) then, begin #sailor Jupiter
hero := find hero (hero: makoto chan)
set hero picture (hero,9,inside battle)
set hero palette (hero,8,inside battle)
end
end #end for the script
|
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun May 06, 2007 9:14 pm Post subject: wrong use of the command "find hero" |
|
|
So I was wrongly use the command "find hero"... Well it's a very
interesting to know...
I've put all the "if check tag" commands in the same script (the save game script). How can I prevent the scripts from ending too early.
For example the tag minako and ami are on but the script ends after Minako's tag has been checked turned on...
Any idea?
As always thanks for help and suggestion! _________________ It's time to make games! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue May 08, 2007 9:48 am Post subject: |
|
|
I think we need a bit more info. How exactly is this script called? Is it a load-game script? Or does it just get called when a hero saves? Does Usagi get his (or her, I don't know anything about Sailor Moon) pictures changed correctly? Are there any other scripts trying to run in the background (a map autorun script perhaps, or maybe a looping keypress script)? _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue May 08, 2007 10:29 am Post subject: my problem with the saved game script |
|
|
The script is the save game script. There is a problem with only one hero
Makoto chan. She gets Amy's grafics after the player saved the game.
msw188 wrote
Quote: |
Does Usagi get his (or her, I don't know anything about Sailor Moon) [...]
|
Almost all heroes in Sailor Moon are girls. Usagi is a japanese given name for girls and she can transform into SailorMoon. _________________ It's time to make games! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue May 08, 2007 8:09 pm Post subject: |
|
|
That is very odd. If I understand you right, you are saying that everyone's pictures change (as they should), but in the case of the final hero, it changes to the wrong picture and palette. The only thing I can think of right now is you may have a problem where you have more than one hero named the same thing in custom (as in having various copies of the same hero). This might be causing your problem. To help debug, I would suggest changing the order of your heroes in the party and seeing if that changes who is getting the wrong picture. Similarly, try changing the order of your plotscript (check sailor jupiter first, and then sailor moon, and so forth). Let us know if any of this changes anything, or if you do in fact have heroes assigned the same name in custom. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Onlyoneinall Bug finder
Joined: 16 Jul 2005 Posts: 746
|
Posted: Tue May 08, 2007 9:04 pm Post subject: |
|
|
Thought I'd throw this in. If you have several sets of heroes with the same name, things can get a bit confusing if you swap out heroes and unequip.
Let's say you have three copies of Jackson. The HSI file reads it as Jackson, Jackson2, and Jackson3.
So say you unequip Jackson, then add Jackson2, swap out and lock Jackson, so only Jackson2 is in your party.
Now when you try to unequip Jackson2, if you say unequip Jackson2, it does not work. It reads Jackson2 as simply Jackson. But adding Jackson3 and swapping out Jackson2, you can say to swap out and lock Jackson2.
But when unequipping, you have to say Jackson. Weird? _________________ http://www.castleparadox.com/gamelist-display.php?game=750 Bloodlust Demo 1.00
 |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu May 10, 2007 10:04 pm Post subject: Some more information |
|
|
Onlyoneinall wrote
Quote: | If you have several sets of heroes with the same name, things can get a bit confusing if you swap out heroes and unequip. |
I don't have named two heros the same way. Each sailor has its own name, skills, powers... which are very different one from another. So, I don't think confusing because of swaping out heroes that have the same name may not be the problem.
I'm going to make some more tests.
Another interesting thing that may help you: the tags I use in the script are the hero bitsets tag 'have in party" (Before you ask I've already checked that makato chan has in its bitset tag have in party " makoto")
Another strange thing: Makoto is the only one that has this problem.
One more thing and I will end with this: the fact that I change the order of heroes in the party doesn't change anything. Makoto chan still get the wrong grafics whatever is her position in the party.
Anyway thanks once more for helping! _________________ It's time to make games! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat May 12, 2007 8:49 pm Post subject: |
|
|
I'm sorry, but I want to make sure we all understand exactly what is going on. Tell me if any of the following is incorrect:
1. This script is called ONLY when a player saves their game, and is ALWAYS called when they save their game (I'm not sure if this is even possible. Are you sure you don't mean it is called when they load a previously saved game?).
2. You have used James Paige's script EXACTLY as he typed it.
3. When the script is called, all of the heroes change to the correct picture and palette, EXCEPT Makoto Chan. Makoto Chan changes to picture 5, palette 26 (just like Ami).
4. None of this is noticable until you enter a battle (because all of the pictures and palettes involved are for inside battle).
This may be some kind of bug, but I think we need to be sure all of 1-4 is true first, and it might help to see the entire script. If (1.) is true, I am also interested in how you did that. There is no 'save-game' script in custom that I am aware of. Do you only allow the player to save at save points, and then have those save point NPCs link to this script? That is the only method I can think of off the top of my head. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat May 12, 2007 10:45 pm Post subject: Some answers and explanations |
|
|
Ok some answers.
1 The save game script is called one time when I speak to the npc that looks like a save point
2 I've tested the script that James wrote but nothing change when I test. Moreover, hspeak says that :
Quote: | Local variable hero is never used |
3 When the script is called, all of the heroes battle grafic change to a little portrait of the hero (just like Adrian did for Crescent Dream). Then a shop is used to make the save the game and then, the heroes get their orginal battle grafics. (see above for more details)
As you've understood the script works for all hero (whatever is their order in the active party and their position in the party) except one.
Here is the whole scripts. I've used two script because there are many if lines (2 per hero) but switch commands combined with cases may be more efficient but anyway...
Code: |
# Ce script save gave and give portrait to the heroes
script, save point, begin
Suspend NPCs
Suspend player
set on keypress script (none)
variable(hero)
#Tag give the right portait to the right hero
if (check tag (tag: usagi)==ON) then, begin
#usagi is hero (me) == Sailor Moon
hero := find hero (me)
set hero picture (me,19,inside battle)
set hero palette (me,1,inside battle)
end, then,
if (check tag (tag: minako)==ON) then, begin
hero := find hero (hero: minako chan)
set hero picture (hero: minako chan,19,inside battle)
set hero palette (hero: minako chan,1,inside battle)
end, then,
if (check tag (tag: ami)==ON) then, begin
hero := find hero (hero: ami chan)
set hero picture (hero: ami chan,21,inside battle)
set hero palette (hero: ami chan,82,inside battle)
end, then,
if (check tag (tag:makoto)==ON) then, begin
hero := find hero (hero: makoto chan)
set hero picture (hero: makoto chan,9,inside battle)
set hero palette (hero: makoto chan,8,inside battle)
end, then,
use shop (shop: savepoint)
#shop:savepoint = shop2 is save point
wait for text box
# get back battle grafics from now on in the code
if (check tag (tag: usagi)==ON) then, begin
hero := find hero (me)
set hero picture (me,10,inside battle)
set hero palette (me,11,inside battle)
end , then,
savepoint2
end
#-----------------------------------------------------------------------------
#end of the script save point
script, savepoint2, begin
variable(hero2)
if (check tag (tag: minako)==ON) then, begin
hero2 := find hero (hero: minako chan)
set hero picture (hero: minako chan,4,inside battle)
set hero palette (hero: minako chan,22,inside battle)
end, then,
if (check tag (tag: ami)==ON) then, begin
hero2 := find hero (hero: ami chan)
set hero picture (hero: ami chan,5,inside battle)
set hero palette (hero: ami chan,26,inside battle)
end, then,
if (check tag (tag: makoto)==ON) then, begin
hero2 := find hero (hero: makoto chan)
set hero picture (hero: makoto chan,9,inside battle)
set hero palette (hero: makoto chan,8,inside battle)
end
if (check tag (tag: haruka)==ON) then, begin
hero2 := find hero (hero: haruka san)
set hero picture (hero: haruka san,15,inside battle)
set hero palette (hero: haruka san,60,inside battle)
end
set on key press script (48)
resume NPCs
resume player
end #end of plotscript
#-----------------------------------------------------------------------------
|
Please note that as new heroes will join, I will need to add if line so that the new heroes can get their portrait and then battle grafic back.
Another main issue which left is "What should I tell the script to do when
the hero is not on the active party when the player saves?"
If you don't understand why I put this or this line, just ask for it.
As always thanks you very much for your help! _________________ It's time to make games! |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Sat May 12, 2007 11:20 pm Post subject: |
|
|
That is not what James said to do. You have the following:
Code: | if (check tag (tag: minako)==ON) then, begin
hero := find hero (hero: minako chan)
set hero picture (hero: minako chan,19,inside battle)
set hero palette (hero: minako chan,1,inside battle)
end, then, |
It should be:
Code: | if (check tag (tag: minako)==ON) then, begin
hero := find hero (hero: minako chan)
set hero picture (hero,19,inside battle)
set hero palette (hero,1,inside battle)
end |
Note the use of the hero variable instead of the hero:minakochan constant. _________________
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue May 15, 2007 8:53 pm Post subject: How to use a hero variable? |
|
|
My question may be stupid but : " How do I use a hero variable?"
Where can I find my heroes variable?
Thanks for the help! _________________ It's time to make games! |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue May 15, 2007 9:22 pm Post subject: |
|
|
It's not a "hero variable," it's a variable named "hero."
Stated differently, your (corrected) code might look like this:
Code: | variable(banana)
if (check tag (tag: minako)==ON) then, begin
banana := find hero (hero: minako chan)
set hero picture (banana,19,inside battle)
set hero palette (banana,1,inside battle)
end |
Note how I've changed the hero variable to a banana variable. A variable named "banana." _________________
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Wed May 16, 2007 10:36 pm Post subject: I've made tests with variable (banana) and... |
|
|
Ok! Sorry to ask that but "are you sure it is the right way to write commands?"
I've tested with variable(banana) and when I compile, hspeak.exe says
Quote: |
warning in line 1234 of script save point
local variable banana is never used
|
So? Any ideas that could explain why hspeak.exe complain? (may be the
if check tag commands have something to do with this.) _________________ It's time to make games! |
|
Back to top |
|
 |
|
|
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
|