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

Reset Map State
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
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Tue Sep 04, 2007 1:07 pm    Post subject: Reset Map State Reply with quote

I'm having trouble getting this command to work. Here is the code:

Code:
script,resetmine,begin
suspend player
reset map state (mapstate:all)
wait for all
resume player
end


Supposed to be simple and to the point. The player can walk over an infinite use npc and it triggers this script, which in turn resets all of the npcs on the map.

However, it does NOTHING. What am I doing wrong?
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
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 9:36 pm    Post subject: Reply with quote

I just tested your script, and it works for me. Check that it's actually being triggered. And if it is... testcase?

Also why suspend player, resume player and wait for all. They probably won't do anything.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Wed Sep 05, 2007 6:59 am    Post subject: Reply with quote

The Mad Cacti wrote:
I just tested your script, and it works for me. Check that it's actually being triggered. And if it is... testcase?

Also why suspend player, resume player and wait for all. They probably won't do anything.


I don't know why I have that stuff in there. I took it out.

The script still isn't working for me. Maybe I am doing wrong. Here is how I am testing it:

On the map that needs reset is an npc that shows "Test" textbox and then is supposed to run the resetmine script. I am assuming that that would bring back all of the npcs on the map, even if they were one time use npcs, but it doesn't do anything.
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Sep 05, 2007 7:26 am    Post subject: Reply with quote

Meatballsub wrote:
On the map that needs reset is an npc that shows "Test" textbox and then is supposed to run the resetmine script. I am assuming that that would bring back all of the npcs on the map, even if they were one time use npcs, but it doesn't do anything.


there is the problem. No, it will not bring back one-time-use NPCs.

One-time-use NPCs actually have a tag which gets changed when you use them. Resetting the map state will have no effect on tags.
Back to top
View user's profile Send private message Send e-mail 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: Wed Sep 05, 2007 7:31 am    Post subject: Reply with quote

You can of course reset that tag yourself. The NPC has not actually been deleted, so clearing the tag will cause it to reappear.

Which tag exactly should be cleared is displayed on the NPC editing page. The one-time NPC tags start at 1000 and go up.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Sep 05, 2007 7:43 am    Post subject: Reply with quote

Hmmm...
I just realized that "alter NPC" and "read NPC" are capable of accessing NPC tag data, but there are no pre-defined constants for it, so you have to use the numbers 9 and 10 for the regular tags, and 11 for the one-time-usability tag

Code:

script, respawn onetime NPCs, begin
  variable(i, tag)
  for(i, 0, 35) do, begin
    tag := read NPC(i, 11)
    if (tag >> 1) then, begin
      set tag(tag, OFF)
    end
  end
end


The above code should re-generate all the one-time-usable NPCs on the current map. Try it, and let me know how it works.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Wed Sep 05, 2007 7:48 am    Post subject: Reply with quote

Shouldn't that be tag>=1? Or is 1 not used as "on" for tags ever?
_________________
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: Wed Sep 05, 2007 8:12 am    Post subject: Reply with quote

Tag 1 is always off (I think, maybe it's on).
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Wed Sep 05, 2007 8:20 am    Post subject: Reply with quote

Gosh, I just got the thing mixed up. Do NOT use my suggestion, I was thinking that the variable tag was being set as the value of the tag in question (as in, true or false) and we were checking to set it false if it were true. Now I see that tag is just being set as the tag number, and this all makes much more sense. I'm sorry for the confusion.

I wonder if game would explode if a script tried to turn tag 1 off...
_________________
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
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Wed Sep 05, 2007 8:23 am    Post subject: Reply with quote

Doesn't seem to work. I'd use a one time npc and then talk to the npc that runs this script and it doesn't reset the one timer....
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Wed Sep 05, 2007 8:27 am    Post subject: Reply with quote

You might also have to refresh the map. Calling reset map state after James' script has run through might be what you need.
_________________
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
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Wed Sep 05, 2007 8:46 am    Post subject: Reply with quote

Don't know if this is exactly what you meant but I tried this and it didn't work:

Code:
script,resetmine,begin
variable (i,tag)
for (i,0,35) do,begin
tag:=read npc(i,11)
if (tag >=1000) then, begin
set tag (tag,on)
end
end
reset map state (mapstate:all)

end

_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Wed Sep 05, 2007 9:53 am    Post subject: Reply with quote

Hmm, that is what I meant. Right now the only thing I can think of is that maybe James is forgetting something, and 11 is the wrong number for read NPC? Could it be an off-by-one thing?

Actually I just looked at plotscr.hsd, and 11 seems like it should be the right number. But now I'm realizing that there may be a chance that the number in that data slot is not the actual tag number, but may be 1000 less (thus allowing 0 or whatever to mean no tag, but pressing left increments the data to 1 which corresponds to tag 1001). Try this. In that script, add the line

show value (tag)
wait(15)

right before the if check. This will show us what data the script is getting from reading the NPC's info. We might need to add 1000 (or possibly 999) to this number to get the actual tag we are trying to turn off. Tell us what kinds of numbers show up when you call the script, and what tag numbers custom says for the one-time NPCs on the current map.

PS: This is all just guesswork on my part, James is the real person to ask about this.
_________________
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
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Sep 05, 2007 10:43 am    Post subject: Reply with quote

msw's guesswork is good. use a "show value" tag to find out what numbers we are actually dealing with here.... the tag number might actually be a negative, now that I think about it, so you might need to say:

Code:

tag := read NPC(i, 11) * -1


Also, you should not need reset map state. NPCs should automatically re-appear in response to tag changes (unless I implemented one-time-usable tags very differently than I implemented regular tags, which is possible, although a bit unlikely)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Wed Sep 05, 2007 1:03 pm    Post subject: Reply with quote

Okay, so it said:

0
-11
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-27
0

Or something close to that. When I removed the -1 it would say the same thing just in positive numbers.
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database


Last edited by Meatballsub on Wed Sep 05, 2007 1:05 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
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