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

command that returns hero position
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Tue Aug 21, 2007 11:03 pm    Post subject: command that returns hero position Reply with quote

I would like to know if there is a command that returns one heroe's position in active party. I would be something like

"get hero position" or may be a string. Someting like get global string (ID, global)

If anybody knows, feel free to let an answer here.
Thanks in advance for the help!
_________________
It's time to make games!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Ysoft_Entertainment
VB Programmer




Joined: 23 Sep 2003
Posts: 810
Location: Wherever There is a good game.

PostPosted: Wed Aug 22, 2007 4:23 am    Post subject: Reply with quote

Quote:
find hero (who)
Searches through your party to see if the specified hero is there, and returns the position where the hero was found, or -1 if the hero was not found. Use the names defined in your HSI file in the format hero:name. Not only does this tell you if a hero is in your party, but you can also use it to tell whether or not the hero is in your active party. find hero will return 0,1,2 or 3 if the hero is in the active party, but it will return a number 4 or higher if the hero is in the reserve.


also

Quote:
rank in caterpillar (who)
Searches through your active party to see if the specified hero is there, and returns the position int the walkabout caterpillar where the hero was found, or -1 if the hero was not found. Use the names defined in your HSI file in the format hero:name. This is particularaly useful if you need to use a command like walk hero but you are not sure which position the hero is in.


hope this helps
_________________
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
View user's profile Send private message Send e-mail Visit poster's website
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Thu Aug 23, 2007 11:03 pm    Post subject: Yes I think that's what I need but... Reply with quote

I think that "rank in caterpillar" is what I need but I would like to store the name and references of the heroes in the current party in global variable.

Could somoene confirm that
Code:

hero1:= rank in caterpillar (hero:minako)


will search for minako in the active party and store the information in hero1?
_________________
It's time to make games!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Fri Aug 24, 2007 2:30 am    Post subject: Reply with quote

Yes.

Make sure that you want rankincaterpillar and not findhero: the first is used for the heroes on the map (eg. walking), and the second is for heroes in the battle party (eg. swapping in/out and reading stats)
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Sat Sep 01, 2007 3:37 am    Post subject: and once more... but this time it's really serious Reply with quote

Ok! I'm implement the system for my npcs to follows the hero using the article I've posted a long time ago http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/How_do_I_make_one%2C_two%2C_or_three_NPCs_follow_the_hero%3F

My problem is the following: I would like to adapt the system so that the npcs are place as in the picture above (extract from a yugioh game on game boy advance).



As you can see the main difference is that the npcs are not following the hero in rank just like with the OHRRPGCE. I've modified the X,Y location so that it places the npcs just like on the picture. The only thing that left is that the keypress is not adapted. It does not seem to detect the npcs.

If you can't see what I want or if you don't understand some parts of my post: feel free to ask further quesions!

Code:

script, keypress script, begin

if(checktag(tag: jono follows me),xor,checktag(tag:honda follows me)) then, begin
hero is walking (0) #substitute this for the hero you want
hero direction (0) #=direction
npcplace #(*,*,direction,*)
end

end #end of plotscript
#--------------------------------------------------------------------
script,npc place, begin
 
if(check tag(tag:jono follows me)==on, and, jono moves==false), then, begin

if (herodirection(me)==left) , then, begin
jono moves:=true,
suspend npcs
set npc position (17, herox+1, heroy+1),
set npc frame (17, 0),
wait(2),
set npc frame (17, 1),
set npc direction (17, left),
resume npcs
jono moves:=false,
wait(1))

else,begin
if (herodirection(me)==right) , then, begin
jono moves:=true,
suspend npcs
set npc position (17, herox--1, heroy--1),
set npc frame (17, 0),
wait(2),
set npc frame (17, 1),
set npc direction (17, right),
resume npcs
jono moves:=false,
wait(1))

else,begin
if (herodirection(me)==up) , then, begin
jono moves:=true,
suspend npcs
set npc position (17, herox+1, heroy+1),
set npc frame (17, 0),
wait(2),
set npc frame (17, 1),
set npc direction (17, up),
resume npcs,
jono moves:=false,
wait(1))

else, begin
if (herodirection(me)==down) ,then, begin
jono moves:=true,
suspend npcs,
set npc position (17, herox--1, heroy--1) ,
set npc frame (17, 0),
wait(2),
set npc frame (17, 1),
set npc direction (17, down),
resume npcs,
jono moves:=false,
wait(1))

end
end
end
end

# Le Npc 4 est Honda. Ce peut être aussi Théa.
if(check tag(tag:honda follows me)==on, and, honda moves==false) then, begin

if (herodirection(me)==left) , then, begin
honda moves:=true,
suspend npcs,
set npc position (4, herox+1, heroy+1) ,
set npc frame (4, 0),
wait(2),
set npc frame (4, 1),
set npc direction (4, left),
resume npcs,
honda moves:=false,
wait(1))

else,begin
if (herodirection(me)==right) , then, begin
honda moves:=true,
suspend npcs,
set npc position (4, herox--1, heroy--1) ,
set npc frame (4, 0),
wait(2),
set npc frame (4, 1),
set npc direction (4, right),
resume npcs,
honda moves:=false,
wait(1))

else,begin
if (herodirection(me)==up), then, begin
honda moves:=true,
suspend npcs,
set npc position (4, herox+1, heroy+1) ,
set npc frame (4, 0),
wait(2),
set npc frame (4, 1),
set npc direction (4, up),
resume npcs,
honda moves:=false,
wait(1))

else,begin
if (herodirection(me)==down), then, begin
honda moves:=true,
suspend npcs,
set npc position (4, herox--1, heroy--1) ,
set npc frame (4, 0),
wait(2),
set npc frame (4, 1),
set npc direction (4, down),
resume npcs,
honda moves:=false,
wait(1))

end
end
end
end

end #end of the plotscript
#---------------------------------------------------------------------


As always thanks for helping and answering.[/img]
_________________
It's time to make games!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Sep 02, 2007 8:39 pm    Post subject: Reply with quote

Well, the main problem might be the first line in the keypress script:

Code:
if(..., xor, ...)


Should probably be "or" instead of "xor". With "xor", if both people are trying to follow the hero, the script does not get run.

Otherwise, I can't see anything wrong, although I can't imagine this looking correct onscreen. The code makes it seem like the following NPCs don't really walk, they just 'teleport' to the correct space next to the hero and then show a walking animation while standing in place there. Are you sure you don't want to redo this script using walking commands? The commands "walk NPC to x" and "walk NPC to y" may be helpful to you in this regard.

EDIT: Actually I just looked at your wiki post a little more carefully, and I realized that the problem would be the usage of doors. I'm still pretty sure that there is a better way to set this up (I'd be thinking along the lines of having the keypress script check what direction I pressed and then commanding all NPCs to walk a step in this direction, and then check after the walk is over concerning whether a door was used).

Another problem I thought of with the NPCs not directly behind is, what if you are walking next to a wall? My suggestion would be just to keep the NPCs directly behind at all times...
_________________
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
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Sep 02, 2007 9:03 pm    Post subject: Re: and once more... but this time it's really serious Reply with quote

What you're trying to do isn't easily possible. Even if you get the NPCs to walk behind the hero, what happens when the hero walks around a corner or next to a wall? Unless you set up your wallmap so that walking over it is ok.

Quote:
Code:

script, keypress script, begin

if(checktag(tag: jono follows me),xor,checktag(tag:honda follows me)) then, begin
hero is walking (0) #substitute this for the hero you want
hero direction (0) #=direction
npcplace #(*,*,direction,*)
end

end #end of plotscript


I don't understand what heroiswalking and herodirection are doing here.

What do you mean you can't activate the NPCs? If they walk behind the hero, you'll never be able to face and activate them.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Sep 02, 2007 9:20 pm    Post subject: Reply with quote

If Bis is willing to let the NPCs follow behind the hero rather than on the sides, I think it could be not too bad. You could have a set of global variables keeping track of what direction everyone should step on the next step, and it would operate the same as a caterpillar party (so walls would not be a problem). NPCs should also be okay, except for step-ons. Doors could also possibly be taken care of using a map autorun script.

I'm a bit surprised the original script was satisfactory to begin with. I think this needs rewritten from scratch. If you, Bis Senchi, insist on having the NPCs flank the hero like in that picture, this could be a long process I'm afraid. If you're willing to let the NPCs follow behind, then I think this will not be anywhere near as difficult...
_________________
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
View user's profile Send private message Visit poster's website
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Sun Sep 02, 2007 9:56 pm    Post subject: Reply with quote

If he wanted the NPCs to follow behind, he wouldn't need a plotscript for that.

I remember some RPG where the party members flanked except when going through a narrow corridor and stuff, where they lined up instead. That wouldn't be exceedingly difficult to do.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Sep 03, 2007 12:13 am    Post subject: Reply with quote

I never noticed that msw got a post in while I was replying. I don't see dors as being much of a problem (unless you want some fancy walk-off animation)

There's no reason to use suspend/resume npcs while animating the trailing npcs.

It wouldn't be totally impossible, but it certainly wouldn't be a quick script. The NPCs would have to merge together into a column. Also, what happens when you walk past another NPC? They act as moving walls.
But I'm thinking of doing just this someday, if I actually make an RPG (but with pixel based movement, and maybe 2 tile high walkabouts)
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Sep 03, 2007 8:39 am    Post subject: Reply with quote

Quote:
If he wanted the NPCs to follow behind, he wouldn't need a plotscript for that.


False. I'm not sure if you are referring to either a caterpillar party or follow you type NPCs, but both present problems. I'm guessing Bis does not want the followers to be considered part of the 'party' from a menu standpoint, (in his wiki script he refers to the followers as pets), which effectively rules out using heroes to accomplish this (consider the player's ability to change the order of the heroes in the walkabout party, and the possibility of having four heroes plus the pets). As for the follow you type NPCs, in my experience their behavior is iffy at best. Corners in particular could cause problems.

I still believe that the flanking behavior will be a serious pain to get right. Walking NPCs are definitely a problem, and step-ons. And what does one do in hallways that are only one tile wide? The first thing I think of is something like the wagon in Dragon Warrior IV, but this allows character overlapping. Since we do not have NPC-specific obstruction commands, we cannot do this without risking serious consequences for other NPCs on the map. We could perhaps have an every step script to put the followers in file everytime the hero is next to a wall, but this does not help for wandering NPCs. The only thing I can think of right now is a terribly complicated keypress script that walks everyone in the desired direction, waits, checks to see if they ended up where they should be, and if not it 'tries' something else. None of that besides the initial walking is going to be easy. The discrete distance script that TMC put up a while back may be helpful here...
_________________
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
View user's profile Send private message Visit poster's website
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Mon Sep 03, 2007 9:06 am    Post subject: Reply with quote

I was referring to caterpillar. If that's what he needs, then he could still use caterpillar, though he would need a (much simpler) plotscript.

The flanking would actually not be so complicated if you allowed the other party members to occupy the same space. When you go into a narrow corridor, they squeeze together behind you.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Mon Sep 03, 2007 9:54 am    Post subject: After some reflexion Reply with quote

Well. I've never had so many answer in so little time. Thanks a million for your interest!

msw188 said
Quote:
Are you sure you don't want to redo this script using walking commands? The commands "walk NPC to x" and "walk NPC to y" may be helpful to you in this regard.
Make be I can try a redo script and see what happens. Could somoene post a redo script?


The Mad Cacti said
Quote:
What happens when the hero walks around a corner or next to a wall?


Well when the npc is near a wall it just stay on it but when a npc is on the
x,y location of a door: it disappears.

Then Msw188 said
Quote:
I'm guessing Bis does not want the followers to
be considered part of the 'party' from a menu standpoint, (in his wiki script he refers to the followers as pets), which effectively rules out using heroes to accomplish this


Msw188 I'm using all those scripts and if combinations precisely not
to see a "pet hero" appears in the menu.

Anyway I think that the main problem is how to make start the whole thing. The part with the set npc position is ok because it places the npcs on the map on the correct x,y location when the player uses a arrow.

I've made some tests and it nearly works: especially when I start. Problems appears when I change map and/or add a second npc.

But if we use a string to detect the npc and combine it with a tag
we may get to something. The question is: what coordonates should I put
so that the npcs keeps on been detected after being placed behind the hero...

what would be great would be to say: in a 2 tiles part all around the hero,
if you detect the npc and if the tag npc follows is turned on then
launch npc place.

Does somoene knows if it is possible to make something like that?

If it is possible I may also split npc place in 2 script to prevent
conflicts and problems due to overloading

Code:



switch(NPC at spot (Xcheck,Ycheck)) do
 begin
  case(17) do, npc place17
  case(4) do, npc place4
  #etc
 
end


Anyway thanks one more time for your answers. Feel free to ask several questions if there's something you don't understand.
_________________
It's time to make games!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Sep 03, 2007 10:22 am    Post subject: Reply with quote

Okay, if you are willing to let the NPCs appear on walls, then we're very close to a solution already, as you say. First of all, adding the second NPC will make the "xor" in your keypress script act incorrectly. You should change that "xor" to an "or".

Secondly, I can imagine there being an issue with all of the waits, and the fact that players will usually walk around holding the arrow keys down. I think the script will need to be rearranged so that the setnpcposition commands for both NPCs both occur before any wait commands (this will also look better, most likely).

As for doors, I think your keypress script, or something very close to it, should also be called as a map autorun script. That way when a door is used, the map is reloaded and the npcs are put in place just like if you had used an arrow.

I'd say try these suggestions and see if it helps anything.
_________________
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
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Sep 04, 2007 7:19 am    Post subject: Reply with quote

Actually, the script bis senshi gave used tags to deal with the player holding down the arrow keys.

Quote:
Well when the npc is near a wall it just stay on it but when a npc is on the
x,y location of a door: it disappears.


You want the NPC to go through the door if it happens to walk onto it? .... why?

Quote:
Msw188 I'm using all those scripts and if combinations precisely not
to see a "pet hero" appears in the menu.


There is a much easier way to do this! Set the pets as heroes and put them in the party. Then use an onkeypress script which checks if the player presses alt or esc. If they do, swap the pets out of the party and lock them. Then use wait(1). After the menu, put them back into the party.

To prevent the pets disappearing for a moment, you could replace them with NPCs.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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