View previous topic :: View next topic |
Author |
Message |
Ronin Catholic Deadliest of Fairies

Joined: 23 Jul 2007 Posts: 530 Location: My Girlfriend
|
Posted: Thu Mar 31, 2011 9:27 am Post subject: De-leveling instead of game over |
|
|
Instead of a normal death, I want to have the hero lose an experience level and get sent through Door 0.
Can this be done? _________________ "I didn't start the flame war;
I don't know what you thought here
'Twas that way when I got here"
"I didn't start the flame war;
I can't understand a word you're saying
nor the game you're playing~" |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Mar 31, 2011 9:36 am Post subject: Re: De-leveling instead of game over |
|
|
Ronin Catholic wrote: | Instead of a normal death, I want to have the hero lose an experience level and get sent through Door 0.
Can this be done? |
Yes, you want to write a script that will be used as the "Game Over" script. (look in "Edit General Game Data" in "Special Plotscripts")
The command you want to use for de-leveling the hero is set hero level |
|
Back to top |
|
 |
Ronin Catholic Deadliest of Fairies

Joined: 23 Jul 2007 Posts: 530 Location: My Girlfriend
|
Posted: Sun Apr 03, 2011 5:41 pm Post subject: |
|
|
I've tried it out, and most of the script seems to work. It compiles correctly and everything, but the hero's level doesn't actually seem to drop.
Code: | plotscript, die, begin
set hero level (me, -1, false)
set hero stat (me, 0, 8, current stat)
use door (0)
end |
Is there anything wrong with this? _________________ "I didn't start the flame war;
I don't know what you thought here
'Twas that way when I got here"
"I didn't start the flame war;
I can't understand a word you're saying
nor the game you're playing~" |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Sun Apr 03, 2011 10:26 pm Post subject: |
|
|
Yes, you are attempting to set the hero's level to -1. _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Apr 04, 2011 1:37 am Post subject: |
|
|
Sorry for not throwing an error if the level is invalid.
It's odd to see you write "0" instead of "Stat:HP". How did you know that HP is stat number 0 without looking in your .hsi file anyway? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Ronin Catholic Deadliest of Fairies

Joined: 23 Jul 2007 Posts: 530 Location: My Girlfriend
|
Posted: Mon Apr 04, 2011 8:36 am Post subject: |
|
|
The Mad Cacti wrote: | Sorry for not throwing an error if the level is invalid.
It's odd to see you write "0" instead of "Stat:HP". How did you know that HP is stat number 0 without looking in your .hsi file anyway? |
My HP stat is named (Heart icon); I figured that HP would be stat 0 because it's the first line of the custom text string menu, and looked in the .hsi file to double-check (stat:Strength was 2, so I logically extrapolated that MP would be 1 and HP would be 0).
Quote: | Yes, you are attempting to set the hero's level to -1. |
How do I make it check what his current level is, subtract one, and make it set his level to that then? _________________ "I didn't start the flame war;
I don't know what you thought here
'Twas that way when I got here"
"I didn't start the flame war;
I can't understand a word you're saying
nor the game you're playing~" |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Apr 04, 2011 11:01 pm Post subject: |
|
|
Ronin Catholic wrote: | My HP stat is named (Heart icon); I figured that HP would be stat 0 because it's the first line of the custom text string menu, and looked in the .hsi file to double-check (stat:Strength was 2, so I logically extrapolated that MP would be 1 and HP would be 0). |
Oooh. OK, carry on.
...
So basically, set the level to "get hero stat (me) -- 1". _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Apr 05, 2011 8:18 am Post subject: |
|
|
The Mad Cacti wrote: | So basically, set the level to "get hero stat (me) -- 1". |
No, no, that would be a bad idea. _________________
|
|
Back to top |
|
 |
Ronin Catholic Deadliest of Fairies

Joined: 23 Jul 2007 Posts: 530 Location: My Girlfriend
|
Posted: Tue Apr 05, 2011 10:15 am Post subject: |
|
|
Moogle1 wrote: | http://rpg.hamsterrepublic.com/ohrrpgce/Plot:Get_hero_level |
Now I've got
Code: | plotscript, die, begin
get hero level (me) # Finds the hero's level
#I'd assume the "subtract" command does somthing here
set hero level (me, ???, false) # I don't know what I'm supposed to do with this
set hero stat (me, 0, 8, current stat)
use door (0)
end |
_________________ "I didn't start the flame war;
I don't know what you thought here
'Twas that way when I got here"
"I didn't start the flame war;
I can't understand a word you're saying
nor the game you're playing~" |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Apr 05, 2011 12:58 pm Post subject: |
|
|
by just putting "get hero level (me)" by itself on a line, you don't do anything with the value. it just gets thrown away. You should store it in a variable.
Code: |
plotscript, die, begin
variable(lev)
lev := get hero level (me) # Finds the hero's level
lev := lev -- 1
if (lev >= 0) then(
set hero level (me, lev, false)
set hero stat (me, 0, 8, current stat) # why?
)
use door (0)
end
|
Also, I have another concern. You are using "me" which means "0". it is really intended for the caterpillar leader which is NOT ALWAYS the same as the battle party leader.
This script will work fine if your leader is always in battle slot 0, and cannot be moved, however if the leader is in some other slot, this script will totally fail.
Here is a version which works for all heroes in the party no matter how many of them there are or what order they are in:
Code: |
plotscript, die, begin
variable(slot, lev)
for(slot, 0, 3) do(
if(hero by slot(slot) >= 0) then(
lev := get hero level (slot)
lev := lev -- 1
if (lev >= 0) then(
set hero level (slot, lev, false)
)
)
)
use door (0)
end
|
Oh! I just noticed another potential problem. "use door(0)" would require you to set up door 0 on every single map. It could be a lot easier if you use the "teleport to map" command. |
|
Back to top |
|
 |
Ronin Catholic Deadliest of Fairies

Joined: 23 Jul 2007 Posts: 530 Location: My Girlfriend
|
Posted: Thu Apr 07, 2011 12:36 pm Post subject: |
|
|
The point is to warp to the exit of the previous map; this game's setup is going to be very linear (there's also going to be a puzzle that requires dying to advance). The team/order menu is outright disabled in this game, and there's only one way to get any additional party members (who are all alike). Still, the one for de-leveling all the optional guys as well looks like a good idea.
Thanks for the help, everyone! _________________ "I didn't start the flame war;
I don't know what you thought here
'Twas that way when I got here"
"I didn't start the flame war;
I can't understand a word you're saying
nor the game you're playing~" |
|
Back to top |
|
 |
|