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

Swtich betweean hero and npc

 
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: Mon Mar 24, 2008 2:19 am    Post subject: Swtich betweean hero and npc Reply with quote

I would like to switch between an Npc and a hero in the active party but NOTHING has to be noticed on screen.

Would somoene had any advise about how to do that ?

As always thank you for your help and for answering so quickly!
_________________
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: Thu Mar 27, 2008 4:59 am    Post subject: Reply with quote

That should be quite simple. Replace the hero with an NPC with identical walkabout sprite, walkabout palette, frame, direction, and (pixel) position, and move the hero, all without a wait command.
Perhaps you don't know about the 'plot:NPC frame' and 'plot:Set NPC frame' commands?

Then the only potential graphic difference could be to do with whether the hero/NPC is drawn under or over other heroes or NPCs.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Thu Mar 27, 2008 7:29 am    Post subject: Reply with quote

If I'm understanding you correctly, then I'd suggest you just 'suspend catapillar (caterpillar)' and treat the hero as a hero.
Back to top
View user's profile Send private message Send e-mail AIM Address
bis_senchi




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

PostPosted: Thu Mar 27, 2008 10:35 pm    Post subject: Let's use npc 4 and hero 1 Reply with quote

The Mad Cacti wrote:
Replace the hero with an NPC with identical walkabout sprite, walkabout palette, frame, direction, and (pixel) position, and move the hero, all without a wait command.


That's exactly what I want to do but the only problem is that I would like that the player don't notice what happens.

Set NPC frame command seems to be a good idea but I don't know precisely how to use it.

Let's say that I want want to switch between hero 1 and npc 4. Npc 4 has the same walkabout picture and palette than hero1.

Hero 1 is on the map. How shall I start switching process?

As always, thanks for the help! Good luck in making your games everyone!
_________________
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: Sat Mar 29, 2008 9:42 pm    Post subject: Re: Let's use npc 4 and hero 1 Reply with quote

bis_senchi wrote:
The Mad Cacti wrote:
Replace the hero with an NPC with identical walkabout sprite, walkabout palette, frame, direction, and (pixel) position, and move the hero, all without a wait command.


That's exactly what I want to do but the only problem is that I would like that the player don't notice what happens.

Set NPC frame command seems to be a good idea but I don't know precisely how to use it.


You get the hero's stepping frame with the 'plot:hero frame' command. So you will write
Code:
set NPC frame (4, hero frame (1))


You then do the same thing for direction and pixel position (using 'plot:hero pixel X' and 'plot:hero pixel Y').
_________________
"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: Wed Apr 02, 2008 11:24 am    Post subject: Nighly updated version required Reply with quote

I need the nighly updated version of hspeak.exe don't I?

I don't understand very well how the command works, I key in

Code:

get hero frame (my frame, hero1:name) # store infos in a global variable
get hero pixel X (my pixel X, hero1:name)
get hero pixel Y (my pixel Y, hero1:name)



So? Is it the right way to use this command?
_________________
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: Wed Apr 02, 2008 8:01 pm    Post subject: Reply with quote

In pretty much any scenario where you are using any command with the word "get" in it, you will need to use a variable to store whatever you are 'getting'. The variable doesn't have to be global, but you need to store it with a ":=" command, I'm pretty sure. For this example, you need to have something like

Code:
variable(HF)   #I'm naming the local variable HF for 'hero frame'
HF:= get hero frame (hero:name)


and similarly for any 'get' command.
_________________
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 Apr 06, 2008 5:06 am    Post subject: Reply with quote

No, the names of the commands are hero frame, hero pixel x and hero pixel y.

msw188 wrote:
In pretty much any scenario where you are using any command with the word "get" in it, you will need to use a variable to store whatever you are 'getting'. The variable doesn't have to be global, but you need to store it with a ":=" command, I'm pretty sure.


Right. All commands return their value, with the exception of string commands. Hopefully in close future, even (replacements for the) string commands will return their results instead of requiring an id.

msw188 wrote:
Code:
variable(HF)   #I'm naming the local variable HF for 'hero frame'
HF:= get hero frame (hero:name)


and similarly for any 'get' command.

hero frame takes the position in the caterpillar party as argument (like all other commands that deal with heroes on the map), not a hero id (hero:X).

bis_senshi wrote:
So? Is it the right way to use this command?

Use them in the way I showed:
Code:
set NPC frame (4, hero frame (1))

Obviously this is the same as writing
Code:
frame := hero frame (1)
set NPC frame (4, frame)

_________________
"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: Wed Apr 09, 2008 12:17 am    Post subject: could somoene confirm that?? Reply with quote

Thanks! I managed to do what I wanted. Now next question: could somoene confirm (or not) a basic inn with the default option gives back hp and mp, and make alive dead heroes?
_________________
It's time to make games!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Calehay
...yeah.
Class B Minstrel



Joined: 07 Jul 2004
Posts: 549

PostPosted: Wed Apr 09, 2008 9:22 am    Post subject: Reply with quote

If I'm understanding you right, that depends on the Bitsets you choose in General Game Data -> Preference Bitsets.

Inns will always give HP and MP, but if you want them to revive dead heroes, you have to make sure the "Inns don't revive dead heroes" is off.
_________________
Calehay
Back to top
View user's profile Send private message AIM Address
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