 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Raekuul Delicious!

Joined: 31 Mar 2004 Posts: 641 Location: Nowhere
|
Posted: Wed Nov 04, 2009 4:38 pm Post subject: |
|
|
Bagne wrote: | "lock hero (who, other arguments)", and it never directly says that "who" refers to the hero's ID number. All it says is that you should use the constants defined in the HSI file. |
This is standard practice and makes cutscenes easier to handle.
Nobody said you couldn't be a rebel.
Quote: | But if I was a total n00b, or if I was as confused as I was a few days ago, I might not realize that HSI constants include hero ID numbers ... in fact, I'm still not completely sure this is true! lol!
|
When you look at the HSI File, it looks like
hero 0:The Main Character
hero 1:The Love Interest
hero 2:This Guy
hero 3:That Guy
and so on and so forth as they're laid out in the hero menu in custom. Same goes for attacks, items, song names, etc.
The numbers are the constants, everything after the : is just an Ease-Of-Use string for scripting purposes. You can change everything in the HSI file (except the numbers and type indicators) to make them all easier to remember. If I had internet on my laptop, I'd give an example from the game I'm working on. _________________ A broken clock is still right twice a day. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Nov 04, 2009 5:33 pm Post subject: |
|
|
Bagne wrote: | Hey, when a hero is swapped in,
are they swapped to the highest empty slot? |
Yes, if I recall correctly, swapped in heroes go into the first empty slot. (Unless of course you swap them using "swap by name" or "swap by position")
Raekuul wrote: |
The numbers are the constants, everything after the : is just an Ease-Of-Use string for scripting purposes. You can change everything in the HSI file (except the numbers and type indicators) to make them all easier to remember. If I had internet on my laptop, I'd give an example from the game I'm working on. |
The only trouble with editing your HSI file is that if you re-export it, you lose your changes :( |
|
Back to top |
|
 |
ShakeyAir
Joined: 27 Apr 2004 Posts: 93
|
Posted: Wed Nov 04, 2009 6:58 pm Post subject: |
|
|
offtopic maybe a little bit, but why don't we have proper arrays in plotscripting? |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Wed Nov 04, 2009 7:35 pm Post subject: |
|
|
Okay, so what's happening when I swap a hero out, and the guy behind him gets bumped up in the caterpillar?
I've done a few experiments and come to the conclusion that bumped hero didn't change slots - the only thing that changed was his sprite location.
I have a vague memory of a bitset that disabled this ... but maybe my memory likes to make stuff up?
MAN.
These scripts are hard!
Yeah, I'm asking all these questions because I'm doing this:
I'm trying to create a system where the player can define and switch between groups of heros.
There's three important functions to this system:
1) Split:
Whenever the player has more than one hero in the active party, the player can "split" the party, which causes the caterpillar's tail to bud into a new group, while the leader remains in the active group.
2) Join:
If the active group contains less than 4 heros, the player can speak with the inactive heros (actually NPCs) to absorb them into the active group.
3) Cycle:
At any time, the player can cycle control between any existing group.
I'm writing the scripts to handle up to 12 heros, although I'm more likely to get something like 8.
There's so many details to figure out! Maybe another day, and It will work ... ha! Maybe that's naive of me. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Nov 04, 2009 8:59 pm Post subject: |
|
|
Rank in caterpillar is different from hero slot. The caterpillar will never have gaps. _________________
|
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Nov 04, 2009 10:15 pm Post subject: |
|
|
http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Ways_to_refer_to_a_hero_in_a_script
Check that link for hopefully some clarification. In short, there are three ways to refer to a hero.
(1)ID number is basically the hero's name, and corresponds to the hero:NAME constants in the hsi file. These are used in commands rarely because of the need to allow the player to have multiple heroes with the same ID (like enlisting four Fighters in Final Fantasy 1, say - it wouldn't do to refer them all by the name 'Fighter').
(2)Party Slot is basically the hero's address in the player's party. Only slots 0-3 are considered 'active', but Party Slot doesn't care whether the hero is active or not. It also does not care if there are empty slots in front of the hero in question - if slots 0 and 1 are empty, and Bob is in slot 2, he may be considered in 'front of the line' but he is still in slot 2.
(3)rank in Caterpillar is the hero's rank if empty slots are NOT counted. In the previous example, Bob may be in slot 2, but since he is at the 'front of the line' his rank is considered 0 (first is zero, second is 1, and so on). Since the cateripllar only ever shows the active party, the only ranks that matter are 0-3. _________________ 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 |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Nov 04, 2009 10:58 pm Post subject: |
|
|
(Edit: msw beat me to it. Also, wow, I never noticed that Jameswrote that article, and recently too!)
Yes, portions of the dictionary are really bad. I'm pretty sure the documentation for most of those commands is still the same as it was 10 years ago (10th anniversary of plotscripting is the 9th of November! Let's have a party!) All of those commands need to be changed to something like "who is a [party slot (link)] specifying...". Unfortunately, I don't know if this is even possible for our xml file format (I'll have a look now)
James Paige wrote: | Yes, if I recall correctly, swapped in heroes go into the first empty slot. (Unless of course you swap them using "swap by name" or "swap by position") |
Which means that if you swap in a hero, they might not necessarily go to the end of the caterpillar party. Example:
Code: | Starting party:
Party Slot 0 1 2 3 4 5
Hero ID 6 2 3 - 1 - (hero by slot(slot), -1 is returned for empty slots)
Caterpillar Slot 0 1 2 - - - (rank in caterpillar(heroid), -1 for empty slots)
After swapbyposition(1, 5)
Party Slot 0 1 2 3 4 5
Hero ID 6 - 3 - 1 2
Caterpillar Slot 0 - 1 - - -
After swapinhero(1)
Party Slot 0 1 2 3 4 5
Hero ID 6 1 3 - - 2
Caterpillar Slot 0 1 2 - - - |
I just checked and found that when you swap out a hero, it's put into the highest available slot, starting at 40 and going down. Strange!
ShakeyAir wrote: | offtopic maybe a little bit, but why don't we have proper arrays in plotscripting? |
'Why didn't HS have arrays' is a difficult question for me to answer, but it is probably something like: because James created a *very* simple language, and originally there was very little need for them. To 'Why do we still not have arrays' the answer is mostly: because the first time I planned to add arrays, years back, I realised the plan sucked, and dropped it. Second time through, I expanded it into a complete rewrite of the language and the interpreter, which took forever to plan and start, but has finally been put in writing this year at 'Plan for dynamic types in HamsterSpeak'. Although design is incomplete, programming has begun! My guess is that you can expect arrays second quarter '10 or earlier. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Nov 05, 2009 9:17 am Post subject: |
|
|
ShakeyAir wrote: | offtopic maybe a little bit, but why don't we have proper arrays in plotscripting? |
When I first implemented plotscripting, I simply didn't have the skill to know how to do arrays properly.
More recently we threw around some ideas for somewhat tacky hacks (as TMC mentioned) but none of them seemed clean enough.
But now TMC has developed a great plan for eventually adding real arrays and other data types too, so we will get them sooner or later, and when we get them they will be good.
msw188 wrote: | http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Ways_to_refer_to_a_hero_in_a_script
Check that link for hopefully some clarification. In short, there are three ways to refer to a hero.
|
Yay! THIS.
I could remember writing that, but I couldn't remember where. I thought it was in some thread here and not on the wiki, which explains why I couldn't find it. :)
EDIT: and I finished the unfinished stuff at the end of it, and fixed a big mistake about the "leader" command |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Thu Nov 05, 2009 3:57 pm Post subject: |
|
|
Um,
is there a way of wrapping the "team order" thing on the menu?
It can either show the "special screen" or execute a script.
Is there a script command that calls the special screen?
EDIT: I'm looking at the menu commands ... I can't seem to find one which forces the player to "pick" a particular item. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Nov 05, 2009 4:10 pm Post subject: |
|
|
Bagne wrote: | Um,
is there a way of wrapping the "team order" thing on the menu?
It can either show the "special screen" or execute a script.
Is there a script command that calls the special screen? |
Yes. You want the "team menu" command. And make sure that your menu is configured to allow gameplay & scripts.
Bagne wrote: | EDIT: I'm looking at the menu commands ... I can't seem to find one which forces the player to "pick" a particular item. |
There isn't one yet. I have been working on cleaning up the items menu, so I might be able to add such a command soon. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Thu Nov 05, 2009 5:25 pm Post subject: |
|
|
I must be doing something wrong ...
The first script is from my split script.
When you split your party into two groups, some NPCs are created in place of the heros that were split into the non-active group.
I'm trying to create NPCs, and store their references.
When you speak with the NPC, the 2nd script is triggered, and the NPC should disappear ... that is, I destroy them using their reference #.
Verily, they refuse!
O Why???
Why me?
EDIT: Oh, by the way, I'm storing the NPC references in pseudo arrays using global variables.
Code: |
# Place the NPCs over the caterpillar tail
for (slot,1,3) do(
# Convert between identifiers and check for empty slots
set variable (ID, hero by slot(slot))
if ( ID == -1 ) then(
continue
end
set variable (rank ,rank in caterpillar (ID))
# Create NPC in hero's place, and record it's positioning
write global ( NPC_ref + ID, create npc( ID, hero X (rank), hero Y (rank), hero direction (rank)) )
set NPC frame ( read global (NPC_ref + ID), hero frame(rank) )
)
|
Code: |
Plotscript,joinParty,ID,begin
# ID is the hero ID, which is given by the NPC
destroy NPC (read global (NPC_ref + ID))
|
MOAR EDIT:
Ok, I tried doing this without references ...
Code: |
Plotscript,joinParty,ID,begin
# ID is the hero ID, which is given by the NPC
destroy NPC (ID)
|
I would have thought this should work too... but it doesn't.
For some reason, I have to talk to the NPC's twice to destroy them.
Why?
I really don't understand this NPC identification system. _________________ Working on rain and cloud formation
Last edited by Bagne on Thu Nov 05, 2009 5:41 pm; edited 2 times in total |
|
Back to top |
|
 |
Baconlabs PURPLE IS MANLY

Joined: 15 Mar 2009 Posts: 335 Location: Tennessee
|
Posted: Thu Nov 05, 2009 5:30 pm Post subject: |
|
|
The growing size of this thread never ceases to amaze me. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Thu Nov 05, 2009 5:33 pm Post subject: |
|
|
It's because I ask any question that pops into my head.
I'd start a new thread, but they're all vaguely related to the last ...
Baby Sloths!
Awwww .... aren't they cute? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Nov 05, 2009 6:04 pm Post subject: |
|
|
Quote: |
Ok, I tried doing this without references ...
Code: |
Plotscript,joinParty,ID,begin
# ID is the hero ID, which is given by the NPC
destroy NPC (ID)
|
|
Try this instead:
Code: | plotscript,joinParty,argument,reference,begin
destroy NPC(reference)
end |
The first argument of an NPC-invoked script is always the "script argument" from the NPC editor. The second argument is always the NPC reference of the NPC that invoked the script. _________________
|
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Thu Nov 05, 2009 6:22 pm Post subject: |
|
|
AHAHAHAHAHAHA!
They diiiieeeee!
Thank you a thousand.
That worked magnificently.
Erm ... sorry, another question :-S
Is there any documentation of debug mode?
It would be cool if I could observe values of certain state variables.
(See? I really am trying to solve my own problems!!)
I'm mostly interested in global variables that I have defined...
All I'm using so far is "Show value", and it only shows one value at a time...
If there isn't another way, I might have to make a debug script or something.
I'm lovin' these baby sloths. _________________ Working on rain and cloud formation |
|
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
|