 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
satyrisci ~guo~

Joined: 28 Feb 2007 Posts: 73
|
Posted: Wed Nov 03, 2010 9:49 pm Post subject: Questions, questions... technical questions... |
|
|
Hello,
My lappy has been out of action for the past 2 weeks so development has consisted of hastily scrawled notes and maps on graph paper. While I'm waiting for my new machine, I have a few questions for the OHR wizards:
* If I have a countdown running via script (eg James' countdown script) and the game is saved... will the countdown resume from it's previous position when the game is loaded at a later date? If not, I'll probably do an "on step" variable decrease instead, as the actual amount of time elapsed isn't particularly important.
* I understand that outside-of-battle attacks that increase a stat beyond it's maximum are permanent, is this correct? Does the stat change remain after a save->exit->reload?
* Any ideas on how to implement/script a basic "security camera" function that triggers encounters?
I know I had more, but I'm at work and I'm tired... More questions forthcoming.
-Thanks =) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 11, 2010 12:28 am Post subject: Re: Questions, questions... technical questions... |
|
|
Opps! This thread got lost in CP's downtime; I actually had a reply typed up just as it went down.
satyrisci wrote: | * If I have a countdown running via script (eg James' countdown script) and the game is saved... will the countdown resume from it's previous position when the game is loaded at a later date? If not, I'll probably do an "on step" variable decrease instead, as the actual amount of time elapsed isn't particularly important. |
Running threads and timers are not saved in saved games. That's what the load-game script in for. Save any state you need to in global variables before saving so that you can resume on loading.
Of course, the on-step counter is a much easier solution.
Quote: | * I understand that outside-of-battle attacks that increase a stat beyond it's maximum are permanent, is this correct? Does the stat change remain after a save->exit->reload? |
Yes and yes. See 'How do I increase the maximum of a stat with an item?' for details.
Quote: | * Any ideas on how to implement/script a basic "security camera" function that triggers encounters? |
Could you give more details? You want to trick a battle whenever you walk into view of a security camera? Do the cameras rotate? If not, step-on NPCs are a simple solution. Otherwise you'd probably have to use scripting. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
satyrisci ~guo~

Joined: 28 Feb 2007 Posts: 73
|
Posted: Fri Nov 12, 2010 8:45 pm Post subject: |
|
|
Thanks for the reply TMC. I was hoping to have cameras similar to the old genesis game "Shadowrun" where they rotated between 3 positions and if you happened to be noticed enemies would spawn and chase you.
Perhaps a timer switching between 3 tags for each "state" of the camera, and appropriately placed "step on" npcs that appear depending on camera state... If step on npc triggered... enemy spawns. Sound like it'll work? I'll try and write a script when I get home from work.
How's the N.I. treating you TMC? Chch here  |
|
Back to top |
|
 |
satyrisci ~guo~

Joined: 28 Feb 2007 Posts: 73
|
Posted: Wed Nov 17, 2010 7:29 pm Post subject: |
|
|
Here's my on-step script for keeping track of time of day etc:
Quote: | include, plotscr.hsd
include, neonoir.hsi
global variable, begin
0, TotalSteps
1, Steps
2, Hours
3, Days
4, Weeks
end
#-----------------------------------------------------
plotscript, Chronology, (
#This should cycle through the hours, days, months. Onstep.
TotalSteps += 1
Steps += 1
if (Steps >= 120) then(
Hours += 1
Steps := 0
)
if (Hours >= 24) then(
Days += 1
Hours := 0
)
if (Days >= 7) then(
Weeks += 1
Days := 0
)
# These next four IF statements check the time of day and turn on tags accordingly
if (Hours==6,and,Checktag(tag:Night)) then, (
set tag (tag:Night, off)
set tag (tag:Morning, on)
)
if (Hours==10,and,Checktag(tag:Morning)) then, (
set tag (tag:Morning, off)
set tag (tag:Day, on)
)
if (Hours==17,and,Checktag(tag:Day)) then, (
set tag (tag:Day, off)
set tag (tag:Evening, on)
)
if (Hours==21,and,Checktag(tag:Evening)) then, (
set tag (tag:Evening, off)
set tag (tag:Night, on)
)
end
#Next to add - colour changes depending on time of day
#----------------------------------------------------- |
No problems with this, but I want the palette to change slightly at each "transition" of time (eg morning to day, day to evening...). How is this done? Tweak palettes.. I know this much, but how do I retain the changes in a save game?
Thanks for reading |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 18, 2010 5:07 am Post subject: |
|
|
Ah, hi! It's been awfully hot here the last few days, felt like the middle of summer for the first time. None of the rain seems to reach us :(
Moogle has a couple good example scripts up here: http://moogle1.castleparadox.com/timeofday.php
Notice that you could update the palette each hour or even each step, changing it smoothly, by interpolating between a few set palettes.
I find that "tweak palette" tends to give pretty bad results because it adds to each component of each colour, which means either you end up with no black in your palette, or lots of black, and same for white. I think you'll have more luck using Moogle's approach, which I'll just rip out into a handy standalone script:
Code: | script, multiply palette, red ratio, green ratio, blue ratio, begin
variable (ctr)
for (ctr,0,255) do (
writecolor(ctr,color:red,(readcolor(color:red)*red ratio)/100)
writecolor(ctr,color:green,(readcolor(color:green)*green ratio)/100)
writecolor(ctr,color:blue,(readcolor(color:blue)*blue ratio)/100)
)
end |
Example use:
Code: | reset palette
mulitply palette(90, 80, 70)
fade palette in |
(I know I would start experimenting with something even more complicated.)
Moogle's script includes a set of ratios which I assume he's at least tried out.
You have to re-apply the palette tweaks after loading the game. For example, your load-game script might look like (if you decide to use just 4 different palettes):
Code: | plotscript, load game, begin
if (check tag(tag:Morning)) then (multiply palette (90, 80, 70))
if (check tag(tag:Day)) then () # do nothing
if (check tag(tag:Evening)) then (multiply palette (70, 60, 55))
if (check tag(tag:Morning)) then (multiply palette (25, 30, 35))
update palette
end |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
satyrisci ~guo~

Joined: 28 Feb 2007 Posts: 73
|
Posted: Thu Nov 18, 2010 1:08 pm Post subject: |
|
|
Thanks TMC I'll get to work and see what I can do with this.
Edit: Ok I've got it to compile and working fine... but the screen just goes black when the palette change kicks in. I've tried this with fade screen in, update palette and with different ratios for the colors.
Edit 2: Fixed:
Quote: | script, multiply palette, red_ratio, green_ratio, blue_ratio, begin
variable (ctr)
for (ctr,0,255) do (
writecolor(ctr,color:red,(readcolor(ctr, (color:red))*red_ratio)/100)
writecolor(ctr,color:green,(readcolor(ctr, (color:green))*green_ratio)/100)
writecolor(ctr,color:blue,(readcolor(ctr, (color:blue))*blue_ratio)/100)
)
end |
The index references for readcolor were missing. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 18, 2010 7:05 pm Post subject: |
|
|
Whoops, sorry! Testing out every script I post is too time consuming. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
satyrisci ~guo~

Joined: 28 Feb 2007 Posts: 73
|
Posted: Thu Nov 18, 2010 7:23 pm Post subject: |
|
|
That's ok, thanks to your input I got much further than I would have on my own. |
|
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
|