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 Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
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 1:05 pm    Post subject: Reply with quote

You probably need to add 1000 after reversing the sign. So, 1016, 1017, and so on.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Sep 05, 2007 8:45 pm    Post subject: Reply with quote

Well, the sign was already reversed. You only need to add 1000

The script should look like this:

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


Incidently, now that I look at it, turning tag 1000 on will make all non-single-use NPCs disappear! Maybe there's some possible use. So there's no reason to check tag >> 1000
_________________
"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 8:51 pm    Post subject: Reply with quote

The Mad Cacti wrote:
Well, the sign was already reversed. You only need to add 1000

The script should look like this:

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


Incidently, now that I look at it, turning tag 1000 on will make all non-single-use NPCs disappear! Maybe there's some possible use. So there's no reason to check tag >> 1000


This works great so far. Thanks so much to everyone putting for effort to help me figure this out.

The only other question I have is this: Is there any way to put a time limit on this script. For instance, you trigger it, and you must wait five minutes until you can trigger it again. I've been toying with some ideas but I don't think I will be able to get it exactly how I need it. I made a script that makes you wait a few minutes, but it resets the time to wait if you activate it when it is already activated and I dont think it carries over maps....

If this is what I'm stuck with, then i'll still be completely satified.
_________________
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 9:07 pm    Post subject: Reply with quote

The Mad Cacti wrote:
Incidently, now that I look at it, turning tag 1000 on will make all non-single-use NPCs disappear! Maybe there's some possible use.


That sounds like a bug :P
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 9:07 pm    Post subject: Reply with quote

Glad to be able to help. And I think this shows that it would be very helpful to have constants for read NPC for the tags that affect it. Seems simple enough to add, no?

You can use timers (in the nightly) to put a time limit on this, but I haven't used them yet, so I don't feel confident in my abilities to construct it properly. In a general sense, the script ought to look like:

[pseudoscript]
script, reset map, begin

if (timer is not set), then
begin
#all the stuff you currently have, then...
set timer (how long, should it run during battles?...)
end

end
[/pseudoscript]
_________________
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: Wed Sep 05, 2007 9:12 pm    Post subject: Reply with quote

Since you seem to be using Ubersetzung RCs/nightlies, use timers. Something like:

Code:

script, try respawn NPCs, begin
 # if 0 seconds left on timer
 if (read timer (0) == 0) then (
   respawn onetime NPCs
   # run timer 0 for 300 seconds (triggers nothing when it finishes)
   set timer (0, 300, timer: default, timer: default, timer: default, timer flag: battle)
 )
end

This will count down in and out of battles, but not inside menus. If you want it to do that too, replace timer flag: battle with timer flag: battle + timer flag: menu

I just realised though, loading a saved game would reset it. Oh dear. Maybe that should be counted as a bug. You could use game time instead, which actually might have been easier?

EDIT: Upon reading msw's pseudocode, I realised I could simplify the script.
_________________
"It is so great it is insanely great."


Last edited by TMC on Thu Sep 06, 2007 7:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Sep 06, 2007 6:20 am    Post subject: Reply with quote

That's not what he wants anyway. He wants it not to be called within 300 seconds.

Try the Scripts:Counter. Call start counter every time you reset the NPCs, and before resetting them, check the total elapsed minutes.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Sep 06, 2007 6:52 am    Post subject: Reply with quote

That's exactly what the script I posted does.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Sep 06, 2007 7:19 am    Post subject: Reply with quote

Oh, I see that now. The comment is misleading.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Meatballsub
Divine Bovine




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

PostPosted: Thu Sep 06, 2007 8:08 am    Post subject: Reply with quote

Thanks. Seems to work great so far!
_________________
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: Thu Sep 06, 2007 7:26 pm    Post subject: Reply with quote

Whoops! I forgot to change the comment after I rewrote the script.
_________________
"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: Thu Sep 06, 2007 8:03 pm    Post subject: Reply with quote

Current script:

Code:
script,resetmine,begin
if (read timer (0) == (0)) then (
variable (i,tag)
for (i,0,35) do,begin
tag:=read npc(i,11) + 1000
if (tag >> 1000) then, begin
set tag (tag,off)
end
end
set timer (0,60,timer:default,timer:default,1,timer flag:battle)
$2="Ores reset in "
show string at (2,150,190)
show string at (1,280,190)
)
end


Okay I take it back, you can only run the script once, even if it is set on an npc that can be used repeatedly. So my question is:

Am I doing something wrong to make it not run infinite times?

Also, I have a string that says "Ores reset in (timer)". How can I get it to disappear after it reaches 0?

Again, thanks for all of the help!
_________________
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: Fri Sep 07, 2007 7:08 am    Post subject: Reply with quote

Right now this script can only be used once, and then cannot be used again until the timer runs out (60 seconds). Isn't that what you wanted? Then again, on second look, I see you've changed one of the "timer:default" arguments in TMC's script to a 1. Could this be the problem? Or maybe there is a separate command to actually start the timer (separate from setting it)? As for the string, do we have a "wait for timer (ID)" command? This would make what MBSub wants pretty easy.

If we don't have such a command, it can still be done like so:

Code:

#everything you have now
#the following should be INSIDE the if's parentheses, at the end
while(read timer(0) <> 0),do
 begin
  wait(1)
 end
#use a command to clear and remove string here
) #ending parenthesis for if

_________________
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: Fri Sep 07, 2007 7:19 am    Post subject: Reply with quote

The one is just saying that i'm binding the timer to a string.

Yeah, it works exactly how it needs to except I thought I would be able to run it again after the timer reaches 0....but you cant.

Actually now that I think about it, the only thing that really works is the timer. It will count down to 0 but then do nothing to the npcs. I hate to keep bringing it up, and I am also testing the script in every way I know. Eventually this will work!
_________________
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: Fri Sep 07, 2007 8:17 am    Post subject: Reply with quote

Wait, so the NPCs are not being reset the first time you trigger this script? Does the string ever appear?

As it is written right now, the script should reset the NPCs first, THEN start counting down. While counting down it should be impossible to trigger the script. Are you saying you want the script to count down first, and then reset the NPCs?

What happens when you attempt to trigger the script after the timer has reached zero? Anything at all? Does the timer still stay on zero, or does it get reset to 60?
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page Previous  1, 2, 3  Next
Page 2 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