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

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Jun 01, 2007 9:02 pm Post subject: Use the information given by hero by slot |
|
|
I'm currently working on the battle system of Saiyuki game.
I would like know for a given hero, what is position in the active party indeed so that the fated guys can appear on the right order (the position choosen by the player) on the battlefield.
I've checked the plotscript dictionnary and find out
Code: |
hero by slot (where)
|
I've made some test and it appears that
Code: |
hero by slot (0)
hero by slot (1)
hero by slot (2)
hero by slot (3)
|
is a possible way of using the command. Could somoene tell me it's the
right one?
The only thing that left how to manipulate the data next.
How shall I put in plotscript language, if hero in slot 1 is Sanzo then, create npc 1 at 4, 5
As always thank you very much fo your help! _________________ It's time to make games! |
|
Back to top |
|
 |
Ysoft_Entertainment VB Programmer

Joined: 23 Sep 2003 Posts: 810 Location: Wherever There is a good game.
|
Posted: Sat Jun 02, 2007 8:06 am Post subject: |
|
|
That would be correct.
You would have something like this
Code: |
If(herobyslot(0)==0)then(
#put hero code here
)
#repeat the above code as much as needed
|
if you know how to use yourgame.hsi then you can do this
Code: |
If(herobyslot(0)==hero:mario)then( #assuming mario is hero number 0
#put hero code here
)
#repeat the above code as much as needed
|
If you read the plotdictionary you would notice that if the given slot is empty, herobyslot would return -1.
If you do not know how to use hsi files then let me know, I will try to explain it to you. _________________ Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Jun 04, 2007 3:59 am Post subject: I've made some tests and... |
|
|
Ok! I've made some tests and when the battle starts; no hero appears.
This is due to a wrong use of the command "hero by slot".
Indeed the command return the number of the hero stored in the hsi file, and I've used a variable to store it but, no at the end no npcs are created. Here is the version of the script
Code: |
script, in battle, begin
suspend player
suspend npcs
suspend caterpillar
fade screen out ( 255, 255, 255)
set hero picture (me, 17) # main hero became the cursor
set hero palette (me, 1)
set variable (hero 0, hero by slot (0))
set variable (hero 1, hero by slot (1))
set variable (hero 2, hero by slot (2))
set variable (hero 3, hero by slot (3))
if (hero 0 ==hero:sanzo sama) then, begin
create npc (0, 7, 6) #npc 0 is Sanzo
wait for npc (0)
end, else, begin
if (hero 0 ==hero:Sha Gojyo) then, begin
create npc (1, 7, 6) #npc 1 is Gojyo
wait for npc (1)
end, else, begin
if (hero 0 ==hero:Hakkai) then, begin
create npc (2, 7, 6) #npc 2 is Hakkai
wait for npc (2)
end, else, begin
if (hero 0 ==hero:Goku) then, begin
create npc (3, 7, 6) #npc 3 is Son Goku
wait for npc (3)
end
end
end
end
if (hero 1 == hero:sanzo sama) then, begin
create npc (0, 7, 7) #npc 0 is Sanzo
set npc position (0, west)
wait for npc (0)
end, else, begin
if (hero 1 ==hero:Sha Gojyo) then, begin
create npc (1, 7, 7) #npc 1 is Gojyo
set npc position (1, west)
wait for npc (1)
end, else, begin
if (hero 1 ==hero:Hakkai) then, begin
create npc (2, 7, 7) #npc 2 is Hakkai
set npc position (2, west)
wait for npc (2)
end, else, begin
if (hero 1 ==hero:Goku) then, begin
create npc (3, 7, 7) #npc 3 is Son Goku
set npc position (3, west)
wait for npc (3)
end
end
end
end
if (hero 2 ==hero:sanzo sama) then, begin
create npc (0, 7, 8) #npc 0 is Sanzo
wait for npc (0)
end, else, begin
if (hero 2 ==hero:Sha Gojyo) then, begin
create npc (1, 7, 8) #npc 1 is Gojyo
wait for npc (1)
end, else, begin
if (hero 2 ==hero:Hakkai) then, begin
create npc (2, 7, 8) #npc 2 is Hakkai
wait for npc (2)
end, else, begin
if (hero 2 ==hero:Goku) then, begin
create npc (3, 7, 8) #npc 3 is Son Goku
wait for npc (3)
end
end
end
end
if (hero 3 ==hero:sanzo sama) then, begin
create npc (0, 7, 9) #npc 0 is Sanzo
wait for npc (0)
end, else, begin
if (hero 3 ==hero:Sha Gojyo) then, begin
create npc (1, 7, 9) #npc 1 is Gojyo
wait for npc (1)
end, else, begin
if (hero 3 ==hero:Hakkai) then, begin
create npc (2, 7, 9) #npc 2 is Hakkai
wait for npc (2)
end, else, begin
if (hero 3 ==hero:Goku) then, begin
create npc (3, 7, 9) #npc 3 is Son Goku
wait for npc (3)
end
end
end
end
set hero picture (hero: Hakkai, 0)# all other heroes became invisible
set hero picture (hero: Goku, 0)
set hero picture (hero: Sha Gojyo, 0)
teleport to map (15, 14, 83)
fade screen in # the battle can start from now on
resume caterpillar
resume player
resume npcs
end #end of plotscript
|
As always thanks very much for help and suggestions! _________________ It's time to make games! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Mon Jun 04, 2007 8:24 am Post subject: |
|
|
The teleport to map command should occur BEFORE all of the NPC making. Right now, you are making the NPCs on the original map, and they are getting thrown away as soon as the player is teleported to map 15. Other than that, this script looks correct, although I'm quite certain that there is probably a faster and cleaner way to do this. Still, you've got the idea.
Oh wait, just found something else. In your 'set hero picture' commands at the end, you should use 1, 2 and 3 instead of the hero names, I'm pretty sure. Just as you used 'me' earlier to designate slot zero to turn into a cursor. _________________ 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 |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Jun 04, 2007 8:54 am Post subject: |
|
|
get rid of the "wait for NPC" commands. They are pointless. You only need "wait for NPC" for NPC movement, not for "create NPC" |
|
Back to top |
|
 |
Ysoft_Entertainment VB Programmer

Joined: 23 Sep 2003 Posts: 810 Location: Wherever There is a good game.
|
Posted: Mon Jun 04, 2007 10:39 am Post subject: |
|
|
Are the hero's in the actual slots? _________________ Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Jun 05, 2007 6:40 am Post subject: After some tests... |
|
|
James Paige said
Quote: | You only need "wait for NPC" |
Yes that's true! The npcs are not moving in this script but put on the map.
I've deleted the command lines with "wait for npc" in it
Quote: | Are the hero's in the actual slots? |
Yes, the 4 Saiyuki boys are all in the current active party. A good proove of that is when they became invisible at the end of the script.
The goal of the script, I've posted is making an original battle system. I've started with a fade screen out and transformed hero:me into cursor.
Caterpillar is turned on and will be on nearly all along the game.
Then the script detects the order of the hero and make appear npcs
that look like the heroes (so that controls will be easier)
And then the hero are made invisible (a cursor followed by npcs
would be strange) before the play screen came back to normal.
I've also change the place of the teleport to map command so that
the npcs may be more likely to be created on map 15.
My problem is the following: when I test the script, no npcs appears at the
given x,y coordonates. What could be the explanation for that?
Thanks for answers and advices! _________________ It's time to make games! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue Jun 05, 2007 6:56 am Post subject: |
|
|
The first thing that comes to mind for me is that you have teleported to a place in the map far beyond where the npcs are being created. All of your create npc commands are making the NPCs appear around (7,8) or so in (x,y) coordinates, but you have teleported your hero (now a cursor) to (14,83). This is not even close, and since the camera is still following the hero (cursor), there is no way you could see your NPCs from over 70 tiles away.
Other than that, I would double check that the NPCs are correctly defined on map 15 in custom, not on the map where you started. Let us know if any of this helps. _________________ 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 |
|
 |
Chenzi User was banned for this post

Joined: 02 Aug 2003 Posts: 190 Location: Grand Rapids, MI
|
Posted: Wed Jun 06, 2007 6:45 am Post subject: |
|
|
A saiyuki game eh? Sounds hawt. Keep me updated. _________________ Allow me to preemptively disclose that I probably hate the person posting below, including myself. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Jun 08, 2007 10:57 pm Post subject: double check npcs seems to be a good idea |
|
|
I've made some more tests and adding some wait command make npc place on map but not at the right x,y coordonates.
Anyway, msw188 said
Quote: |
I would double check that the NPCs are correctly defined on map 15
|
I think it's the right thing to do. Could tell me how to double check npcs?
As always thanks very much for the help! _________________ It's time to make games! |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sat Jun 09, 2007 3:07 am Post subject: |
|
|
Double-check NPCs by checking what numbers they have in the NPC editor on that map, then compare that with the numbers you're using in your script. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Jun 12, 2007 6:20 am Post subject: |
|
|
After some tests, I've decided to change of strategy. Now the npcs are placed on map (with default walkabout) and when the battle starts hero by slot detecte the order and give the correct appearance
Code: |
script, in battle, begin
suspend player
suspend npcs
suspend caterpillar
#fade screen out (255, 255, 255)
set hero picture (me, 17) # main hero became the cursor
set hero palette (me, 1)
teleport to map (15, 14, 83)
wait (15)
set variable (hero 0, hero by slot (0))
set variable (hero 1, hero by slot (1))
set variable (hero 2, hero by slot (2))
set variable (hero 3, hero by slot (3))
if (hero 0 ==hero:sanzo sama) then, begin
set npc position (0, west) #npc 0 is Sanzo
end, else, begin
if (hero 0 ==hero:Sha Gojyo) then, begin
Alter NPC (0,NPCstat:picture,4) #npc 1 is Gojyo
Alter NPC (0,NPCstat:palette,3)
set npc position (0, west)
end, else, begin
if (hero 0 ==hero:Hakkai) then, begin
Alter NPC (0,NPCstat:picture,5) #npc 2 is Hakkai
Alter NPC (0,NPCstat:palette,4)
set npc position (0, west)
end, else, begin
if (hero 0 ==hero:Goku) then, begin
Alter NPC (0,NPCstat:picture,7) #npc 3 is Son Goku
Alter NPC (0,NPCstat:palette,7)
set npc position (0, west)
end
end
end
end
if (hero 1 == hero:sanzo sama) then, begin
Alter NPC (1, NPCstat:picture,6) #npc 0 is Sanzo
Alter NPC (1, NPCstat:palette,6)
set npc position (1, west)
end, else, begin
if (hero 1 ==hero:Sha Gojyo) then, begin
set npc position (1, west) #npc 1 is Gojyo
end, else, begin
if (hero 1 ==hero:Hakkai) then, begin
Alter NPC (1,NPCstat:picture,5) #npc 2 is Hakkai
Alter NPC (1,NPCstat:palette,4)
set npc position (1, west)
end, else, begin
if (hero 1 ==hero:Goku) then, begin
Alter NPC (1 ,NPCstat:picture,7) #npc 3 is Son Goku
Alter NPC (1 ,NPCstat:palette,7)
set npc position (1, west)
end
end
end
end
if (hero 2 ==hero:sanzo sama) then, begin
Alter NPC (2,NPCstat:picture,6) #npc 0 is Sanzo
Alter NPC (2,NPCstat:palette,6)
set npc position (2, west)
end, else, begin
if (hero 2 ==hero:Sha Gojyo) then, begin
Alter NPC (2,NPCstat:picture,4) #npc 1 is Gojyo
Alter NPC (2,NPCstat:palette,3)
set npc position (2, west)
end, else, begin
if (hero 2 ==hero:Hakkai) then, begin
set npc position (2, west) #npc 2 is Hakkai
end, else, begin
if (hero 2 ==hero:Goku) then, begin
Alter NPC (2,NPCstat:picture,7) #npc 3 is Son Goku
Alter NPC (2,NPCstat:palette,7)
set npc position (2, west)
end
end
end
end
if (hero 3 ==hero:sanzo sama) then, begin
Alter NPC (3,NPCstat:picture,6) #npc 0 is Sanzo
Alter NPC (3,NPCstat:palette,6)
set npc position (3, west)
end, else, begin
if (hero 3 ==hero:Sha Gojyo) then, begin
Alter NPC (3,NPCstat:picture,4) #npc 1 is Gojyo
Alter NPC (3,NPCstat:palette,3)
set npc position (3, west)
end, else, begin
if (hero 3 ==hero:Hakkai) then, begin
Alter NPC (3,NPCstat:picture,5) #npc 2 is Hakkai
Alter NPC (3,NPCstat:palette,4)
set npc position (3, west)
end, else, begin
if (hero 3 ==hero:Goku) then, begin
set npc position (3, west) #npc 3 is Son Goku
end
end
end
end
set hero picture (hero: Hakkai, 0)# all other heroes became invisible
set hero picture (hero: Goku, 0)
set hero picture (hero: Sha Gojyo, 0)
#fade screen in # screen came back to normal. The battle can start from now on.
resume caterpillar
resume player
resume npcs
end #end of the script
|
My problem is the following the npcs disappear as the script goes on. Would somoene had an idea to solve this problem? _________________ 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 Jun 12, 2007 7:47 am Post subject: |
|
|
"set hero picture" takes caterpillar position, not hero name. _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jun 12, 2007 8:51 am Post subject: |
|
|
Moogle1 wrote: | "set hero picture" takes caterpillar position, not hero name. |
It takes party position (find hero), not caterpillar position (rank in party) |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Jun 12, 2007 10:30 am Post subject: |
|
|
Oh, right.
You know, I've always felt the distinction between those three was the most confusing part of plotscripting. It would be *very nice* if there were some way to clear that up. I always have to refer to plotdict to know if I should be using hero:name, findhero, or rankinparty. _________________
|
|
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
|