 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Sun Jul 24, 2011 9:00 am Post subject: Of outfits and statistics... |
|
|
Here are my two questions.
1. How would I script an item to change a heroes hero sprites and walkabout sprites?
2. How would I make something that could track how many spells you've casted, how many battles you've won, how long you've been playing, your level, and your gold. |
|
Back to top |
|
 |
mswguest Guest
|
Posted: Sun Jul 24, 2011 12:05 pm Post subject: |
|
|
1. There are plotscripting commands specifically for this. Get and Set Hero Picture (and Palette) should take care of what you need. See the plotdictionary: http://rpg.hamsterrepublic.com/ohrrpgce/Plot:Set_hero_picture
2. Some of this is going to be very difficult, maybe impossible. There are plotscripting commands for time of play (days, hours, minutes, seconds), as well as getting hero levels and gold. Battles won could be tracked with a global variable and an after-battle script that will have to check to make sure that the player did actually win rather than run away. But spells cast is going to be borderline impossible if you plan on using the standard OHR battle system. My first idea is to have all magic use levelMP instead of regular MP, and track uses that way. If you don't have many spells, you might be able to do this with a LOT of tags. If any of these sound like possibilities, we can try to get this started. If not, you're probably best off waiting for battlescripting to be implemented. |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Sun Jul 24, 2011 7:17 pm Post subject: |
|
|
1. Alright. I need some more help. Check Tag hates me.
Code: | plotscript, update outfit, begin
if (check tag(9, OFF)) then
guy outfits
if (check tag(9, ON)) then
girl outfits
end |
Here is the script. The error is that checktag is at most 1 arguments but is being passed as 2.
If I need further help, I shall post up the other part of the script. My outfit changes are clones of the original. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Jul 25, 2011 7:16 am Post subject: |
|
|
yes, tracking spell castings is currently impossible.
Tracking battles won is easy with an after-battle script. Tracking playtime, level, and gold are easy because there are simple commands for those things.
As for your check tag problem, this is wrong
Code: | if (check tag(9, OFF)) then |
it should be written like this instead.
Code: | if (check tag(9) == OFF) then |
|
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Mon Jul 25, 2011 9:35 am Post subject: |
|
|
Alright, could you help me with this script:
Code: | if (check equipment(who,3) == Blue) or
check equipment(who,3:= Enchant) or
check equipment(who,3:= Sorcery) or
check equipment(who,3:= Wizard) or
check equipment(who,3:= Arch) then
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle) |
This is basically my script for all outfit changing. There is an error in the red one (Which is exactly like this, except changed names and such) saying it found builtin command or. It says maybe there is an extra end or ). Is there any other errors with this script? I'm new to changing a heroes pictures with items.
Also, the way I have this script sorted, I have all 5-6 parts like above into one script, seperated by commentary lines breaking it up into parts, so I can easily sort it. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Jul 25, 2011 9:53 am Post subject: |
|
|
Code: | if (check equipment(who,3) == Blue) or
check equipment(who,3:= Enchant) or
check equipment(who,3:= Sorcery) or
check equipment(who,3:= Wizard) or
check equipment(who,3:= Arch) then
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle) |
You are doing if/then wrong. This should not compile (if this is compiling without an error message, that is a bug)
Code: | if (condition) then(
actions
) |
What you have here is:
Code: | if (condition) or
condition, or
condition, or,
condition, or,
condition then()
action
action
action
action |
If you write it like this, it will work like you expect:
Code: | if (check equipment(who,3) == Blue ||
check equipment(who,3:= Enchant) ||
check equipment(who,3:= Sorcery) ||
check equipment(who,3:= Wizard) ||
check equipment(who,3:= Arch) ) then (
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle)
) |
The important thing that I changed was the parenthesis for the "if" and the "then"
I also changed "or" to "||". I suggest you always use "||" instead of "or" and use "&&" instead of "and". They are better because they never need commas. (and they are also better for more complicated reasons that involve bitwise math) |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Mon Jul 25, 2011 10:25 am Post subject: |
|
|
My god, a new error. Here is the new script:
Code: | if (check equipment(who,3) == Blue) ||
check equipment(who,3:= Enchant) ||
check equipment(who,3:= Sorcery) ||
check equipment(who,3:= Wizard) ||
check equipment(who,3:= Arch) then
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle) |
Now, the error is in the script after this one. It expected top level declaration, but found operator ||. Perhaps there is an extra ) or end earlier in the file. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Jul 26, 2011 8:31 am Post subject: |
|
|
You've ignored most of James' fixes -- read his post again!
However, he missed one thing: he only fixed your first use of := and not the rest. := assigns a value to a variable:
Code: | variable (var)
var := 5 |
whereas == compares two values for equality and returns true (1) or false (0):
Code: | check equipment(who,3) == Blue |
You sued := instead of ==, and placed a bracket in the wrong place. The corrected script is
Code: | if (check equipment(who,3) == Blue ||
check equipment(who,3) == Enchant ||
check equipment(who,3) == Sorcery ||
check equipment(who,3) == Wizard ||
check equipment(who,3) == Arch ) then (
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle)
) |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Tue Jul 26, 2011 9:55 am Post subject: |
|
|
GAH! More errors! Here is the ENTIRE script.
Code: | #-----------------------
plotscript, guy outfits, begin
variable(who)
who:= find hero(hero: Siruis)
#--------Basic Robes-----
if (check equipment(who,3) == Blue ||
check equipment(who,3 == Enchant ||
check equipment(who,3 == Sorcery ||
check equipment(who,3 == Wizard ||
check equipment(who,3 == Arch ) then
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle)
)
#--------Red Robes-----
if (check equipment(who,3) == Red ||
check equipment(who,3 == Smokey ||
check equipment(who,3 == Blazing ||
check equipment(who,3 == Pyro ||
check equipment(who,3 == Conflar ) then
set hero picture(who, 3, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 3, outside battle)
set hero palette(who, 18, outside battle)
)
#--------Black Robes-----
if (check equipment(who,3) == Black ||
check equipment(who,3 == Murky ||
check equipment(who,3 == Shadow ||
check equipment(who,3 == Tenebro ||
check equipment(who,3 == Necro ) then
set hero picture(who, 5, inside battle)
set hero palette(who, 6, inside battle)
set hero picture(who, 15, outside battle)
set hero palette(who, 6, outside battle)
(
#--------White Robes-----
if (check equipment(who,3) == White ||
check equipment(who,3 == Shine ||
check equipment(who,3 == Illumi ||
check equipment(who,3 == Lumeno ||
check equipment(who,3 == Heavnly ) then
set hero picture(who, 9, inside battle)
set hero palette(who, 8, inside battle)
set hero picture(who, 11, outside battle)
set hero palette(who, 8, outside battle)
)
#--------Light Blue Robes-----
if (check equipment(who,3) == Liblue ||
check equipment(who,3 == Chilly ||
check equipment(who,3 == Polar ||
check equipment(who,3 == Cryo ||
check equipment(who,3 == Arctic ) then
set hero picture(who, 15, inside battle)
set hero palette(who, 9, inside battle)
set hero picture(who, 9, outside battle)
set hero palette(who, 9, outside battle)
)
#--------Yellow Robes-----
if (check equipment(who,3) == Yellow ||
check equipment(who,3 == Static ||
check equipment(who,3 == Crackle ||
check equipment(who,3 == Dyna ||
check equipment(who,3 == Storm ) then
set hero picture(who, 13, inside battle)
set hero palette(who, 11, inside battle)
set hero picture(who, 5, outside battle)
set hero palette(who, 11, outside battle)
)
#--------Green Robes-----
if (check equipment(who,3) == Green ||
check equipment(who,3 == Grass ||
check equipment(who,3 == Flower ||
check equipment(who,3 == Geo ||
check equipment(who,3 == Nature ) then
set hero picture(who, 11, inside battle)
set hero palette(who, 10, inside battle)
set hero picture(who, 7, outside battle)
set hero palette(who, 10, outside battle)
end
#-----------------------
plotscript, girl outfits, begin
variable(who)
who:= find hero(hero: Sybil)
#--------Basic Robes-----
if (check equipment(who,3 == Blue ||
check equipment(who,3 == Enchant ||
check equipment(who,3 == Sorcery ||
check equipment(who,3 == Wizard ||
check equipment(who,3 == Arch ) then
set hero picture(who, 2, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 2, outside battle)
set hero palette(who, 1, outside battle)
)
#--------Red Robes-----
if (check equipment(who,3 == Red ||
check equipment(who,3 == Smokey ||
check equipment(who,3 == Blazing ||
check equipment(who,3 == Pyro ||
check equipment(who,3 == Conflar ) then
set hero picture(who, 4, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 4, outside battle)
set hero palette(who, 18, outside battle)
)
#--------Black Robes-----
if (check equipment(who,3 == Black ||
check equipment(who,3 == Murky ||
check equipment(who,3 == Shadow ||
check equipment(who,3 == Tenebro ||
check equipment(who,3 == Necro ) then
set hero picture(who, 6, inside battle)
set hero palette(who, 6, inside battle)
set hero picture(who, 16, outside battle)
set hero palette(who, 6, outside battle)
)
#--------White Robes-----
if (check equipment(who,3:= White ||
check equipment(who,3 == Shine ||
check equipment(who,3 == Illumi ||
check equipment(who,3 == Lumeno ||
check equipment(who,3 == Heavnly ) then
set hero picture(who, 10, inside battle)
set hero palette(who, 8, inside battle)
set hero picture(who, 12, outside battle)
set hero palette(who, 8, outside battle)
)
#--------Light Blue Robes-----
if check equipment(who,3:= Liblue ||
check equipment(who,3 == Chilly ||
check equipment(who,3 == Polar ||
check equipment(who,3 == Cryo ||
check equipment(who,3 == Arctic ) then
set hero picture(who, 16, inside battle)
set hero palette(who, 9, inside battle)
set hero picture(who, 10, outside battle)
set hero palette(who, 9, outside battle)
)
#--------Yellow Robes-----
if (check equipment(who,3 == Yellow ||
check equipment(who,3 == Static ||
check equipment(who,3 == Crackle ||
check equipment(who,3 == Dyna ||
check equipment(who,3 == Storm ) then
set hero picture(who, 14, inside battle)
set hero palette(who, 11, inside battle)
set hero picture(who, 6, outside battle)
set hero palette(who, 11, outside battle)
)
#--------Green Robes-----
if (check equipment(who,3 == Green ||
check equipment(who,3 == Grass ||
check equipment(who,3 == Flower ||
check equipment(who,3 == Geo ||
check equipment(who,3 == Nature ) then
set hero picture(who, 12, inside battle)
set hero palette(who, 10, inside battle)
set hero picture(who, 8, outside battle)
set hero palette(who, 10, outside battle)
end |
The error is: Declaration plotscript is not permitted in a script. Perhaps guyoutfits has an extra begin or (. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jul 26, 2011 11:44 am Post subject: |
|
|
Several problems.
First, most of your "check equipment" commands are missing the closing parenthesis.
This is wrong:
Code: | check equipment(who,3 == |
This is right:
Code: | check equipment(who,3) == |
Next, the open parenthesis after "then" is not optional. You have to use it.
This is wrong:
Code: | then
set hero picture(who, 3, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 3, outside battle)
set hero palette(who, 18, outside battle)
)
|
This is right:
Code: | then (
set hero picture(who, 3, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 3, outside battle)
set hero palette(who, 18, outside battle)
)
|
Third, your item names need to start with item:
Code: | #--------Basic Robes-----
if (check equipment(who,3) == item:Blue ||
check equipment(who,3) == item:Enchant ||
check equipment(who,3) == item:Sorcery ||
check equipment(who,3) == item:Wizard ||
check equipment(who,3) == item:Arch ) then (
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle)
)
|
That is everything I can see right now. When those are fixed, let me know if it works. |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Tue Jul 26, 2011 12:09 pm Post subject: |
|
|
New error! Reposting the new script.
Code: | #-----------------------
plotscript, guy outfits, begin
variable(who)
who:= find hero(hero: Siruis)
#--------Basic Robes-----
if (check equipment(who,3) == item:Blue ||
check equipment(who,3) == item:Enchant ||
check equipment(who,3) == item:Sorcery ||
check equipment(who,3) == item:Wizard ||
check equipment(who,3) == item:Arch ) then (
set hero picture(who, 1, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 1, outside battle)
set hero palette(who, 1, outside battle)
)
#--------Red Robes-----
if (check equipment(who,3) == item:Red ||
check equipment(who,3) == item:Smokey ||
check equipment(who,3) == item:Blazing ||
check equipment(who,3) == item:Pyro ||
check equipment(who,3) == item:Conflar ) then (
set hero picture(who, 3, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 3, outside battle)
set hero palette(who, 18, outside battle)
)
#--------Black Robes-----
if (check equipment(who,3) == item:Black ||
check equipment(who,3) == item:Murky ||
check equipment(who,3) == item:Shadow ||
check equipment(who,3) == item:Tenebro ||
check equipment(who,3) == item:Necro ) then (
set hero picture(who, 5, inside battle)
set hero palette(who, 6, inside battle)
set hero picture(who, 15, outside battle)
set hero palette(who, 6, outside battle)
)
#--------White Robes-----
if (check equipment(who,3) == item:White ||
check equipment(who,3) == item:Shine ||
check equipment(who,3) == item:Illumi ||
check equipment(who,3) == item:Lumeno ||
check equipment(who,3) == item:Heavnly ) then (
set hero picture(who, 9, inside battle)
set hero palette(who, 8, inside battle)
set hero picture(who, 11, outside battle)
set hero palette(who, 8, outside battle)
)
#--------Light Blue Robes-----
if (check equipment(who,3) == item:Liblue ||
check equipment(who,3) == item:Chilly ||
check equipment(who,3) == item:Polar ||
check equipment(who,3) == item:Cryo ||
check equipment(who,3) == item:Arctic ) then (
set hero picture(who, 15, inside battle)
set hero palette(who, 9, inside battle)
set hero picture(who, 9, outside battle)
set hero palette(who, 9, outside battle)
)
#--------Yellow Robes-----
if (check equipment(who,3) == item:Yellow ||
check equipment(who,3) == item:Static ||
check equipment(who,3) == item:Crackle ||
check equipment(who,3) == item:Dyna ||
check equipment(who,3) == item:Storm ) then (
set hero picture(who, 13, inside battle)
set hero palette(who, 11, inside battle)
set hero picture(who, 5, outside battle)
set hero palette(who, 11, outside battle)
)
#--------Green Robes-----
if (check equipment(who,3) == item:Green ||
check equipment(who,3) == item:Grass ||
check equipment(who,3) == item:Flower ||
check equipment(who,3) == item:Geo ||
check equipment(who,3) == item:Nature ) then (
set hero picture(who, 11, inside battle)
set hero palette(who, 10, inside battle)
set hero picture(who, 7, outside battle)
set hero palette(who, 10, outside battle)
)
end
#-----------------------
plotscript, girl outfits, begin
variable(who)
who:= find hero(hero: Sybil)
#--------Basic Robes-----
if (check equipment(who,3) == item:Blue ||
check equipment(who,3) == item:Enchant ||
check equipment(who,3) == item:Sorcery ||
check equipment(who,3) == item:Wizard ||
check equipment(who,3) == item:Arch ) then (
set hero picture(who, 2, inside battle)
set hero palette(who, 1, inside battle)
set hero picture(who, 2, outside battle)
set hero palette(who, 1, outside battle)
)
#--------Red Robes-----
if (check equipment(who,3) == item:Red ||
check equipment(who,3) == item:Smokey ||
check equipment(who,3) == item:Blazing ||
check equipment(who,3) == item:Pyro ||
check equipment(who,3) == item:Conflar ) then (
set hero picture(who, 4, inside battle)
set hero palette(who, 18, inside battle)
set hero picture(who, 4, outside battle)
set hero palette(who, 18, outside battle)
)
#--------Black Robes-----
if (check equipment(who,3) == item:Black ||
check equipment(who,3) == item:Murky ||
check equipment(who,3) == item:Shadow ||
check equipment(who,3) == item:Tenebro ||
check equipment(who,3) == item:Necro ) then (
set hero picture(who, 6, inside battle)
set hero palette(who, 6, inside battle)
set hero picture(who, 16, outside battle)
set hero palette(who, 6, outside battle)
)
#--------White Robes-----
if (check equipment(who,3) == item:White ||
check equipment(who,3) == item:Shine ||
check equipment(who,3) == item:Illumi ||
check equipment(who,3) == item:Lumeno ||
check equipment(who,3) == item:Heavnly ) then (
set hero picture(who, 10, inside battle)
set hero palette(who, 8, inside battle)
set hero picture(who, 12, outside battle)
set hero palette(who, 8, outside battle)
)
#--------Light Blue Robes-----
if check equipment(who,3) == item:Liblue ||
check equipment(who,3) == item:Chilly ||
check equipment(who,3) == item:Polar ||
check equipment(who,3) == item:Cryo ||
[b] check equipment(who,3) == item:Arctic ) then ([/b]
set hero picture(who, 16, inside battle)
set hero palette(who, 9, inside battle)
set hero picture(who, 10, outside battle)
set hero palette(who, 9, outside battle)
)
#--------Yellow Robes-----
if (check equipment(who,3) == item:Yellow ||
check equipment(who,3) == item:Static ||
check equipment(who,3) == item:Crackle ||
check equipment(who,3) == item:Dyna ||
check equipment(who,3) == item:Storm ) then (
set hero picture(who, 14, inside battle)
set hero palette(who, 11, inside battle)
set hero picture(who, 6, outside battle)
set hero palette(who, 11, outside battle)
)
#--------Green Robes-----
if (check equipment(who,3) == item:Green ||
check equipment(who,3) == item:Grass ||
check equipment(who,3) == item:Flower ||
check equipment(who,3) == item:Geo ||
check equipment(who,3) == item:Nature ) then (
set hero picture(who, 12, inside battle)
set hero palette(who, 10, inside battle)
set hero picture(who, 8, outside battle)
set hero palette(who, 10, outside battle)
)
end
#-----------------------
|
The error is on the bolded line. The error is: Expected top level declaration, but found flow control then. Perhaps there is an extra end or ) earlier in the file. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jul 26, 2011 12:41 pm Post subject: |
|
|
in the "girl outfits" script, the Light Blue Robes "if" command is missing an open parenthesis ( |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Tue Jul 26, 2011 12:47 pm Post subject: |
|
|
Thanks, but another error has popped up!
Code: | if (check equipment(who,3) == item:Blue || |
The error: Unrecongnized name item:blue. It has not been defined as script, constant, variable or anything else. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Tue Jul 26, 2011 4:14 pm Post subject: |
|
|
Nope, I am pretty sure I got a HSI file. I just checked. |
|
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
|