I'm working on an update for Dreg Sector that addresses some of the community's complaints, but I need some help.
I want to make a spell that disables random encounters for certain number of steps. I've found the "suspend random enemies" command, but I'm not quite sure how to create a loop that counts a certain number of steps before activating "resume random enemies".
I've come into another problem. How do I make a spell that can only be triggered outside of combat? Is this even possible?
Likewise, I don't think I can make a spell that triggers a script. I would prefer to have this effect be a spell rather than an item if at all possible.
Likewise, I don't think I can make a spell that triggers a script. I would prefer to have this effect be a spell rather than an item if at all possible.
Custom menu is the only thing I can think of. Eliminate the normal spell menu, and have a custom spell menu driven by plotscripting. I've wanted this sort of functionality for awhile as well, although I haven't really had the time to do much of anything OHR related this past year.
I am Srime
I am Srime
Spells can't directly trigger scripts, and you can't set a spell to only be usable out of batle.
But I can think of really convoluted ways to achieve both: for the first, set aside one of the stats and have the spell increase that stat (this means the hero target picker comes up though). Have a script run after using the spells menu and check that stat. For the other, have the spell cost an item and use an instead of battle script to remove that item for the duration of each battle.
I'm not expecting you to follow this crazy plan. A much much better idea is to implement this in the engine. (I am not promising anything)
But I can think of really convoluted ways to achieve both: for the first, set aside one of the stats and have the spell increase that stat (this means the hero target picker comes up though). Have a script run after using the spells menu and check that stat. For the other, have the spell cost an item and use an instead of battle script to remove that item for the duration of each battle.
I'm not expecting you to follow this crazy plan. A much much better idea is to implement this in the engine. (I am not promising anything)
I guess I'm doing this as an item rather than a spell. Here is the script I came up with.
The script "step" is run each time the hero moves. The script "radar" is done when the hero activates the item. Unfortunately, the script "radar" freezes when it runs, because it's stuck inside of its do loop infinitely. When I wrote the script, I assumed the hero could still be moved while the loop operated. How do I make this work?
plotscript, radar, begin
suspend random enemies
stepcount := 0
while (stepcount <= 29) do (
)
show text box (382)
wait for text box
resume random enemies
end
plotscript, step, begin
increment (stepcount,1)
end
The script "step" is run each time the hero moves. The script "radar" is done when the hero activates the item. Unfortunately, the script "radar" freezes when it runs, because it's stuck inside of its do loop infinitely. When I wrote the script, I assumed the hero could still be moved while the loop operated. How do I make this work?
plotscript, radar, begin
suspend random enemies
stepcount := 0
while (stepcount <= 29) do (
)
show text box (382)
wait for text box
resume random enemies
end
plotscript, step, begin
increment (stepcount,1)
end
I'd decrement instead, and put the work in the stepping script. Here's quick pseudo code before bed:
[pseudocode]
UNTESTED! WRITTEN IN <10min!! But this general approach should work out, I'm pretty certain.
I am Srime
[pseudocode]
Code:
plotscript,radar,begin
suspendrandomenemies
stepcount:=29
end
plotscript,step,begin
if(stepcount==0),then
(exitscript) #don't risk interfering with other scripts that might suspend enemies
if(stepcount==1),then
begin
text
resumerandomenemies
end
decrement(stepcount)
end
suspendrandomenemies
stepcount:=29
end
plotscript,step,begin
if(stepcount==0),then
(exitscript) #don't risk interfering with other scripts that might suspend enemies
if(stepcount==1),then
begin
text
resumerandomenemies
end
decrement(stepcount)
end
UNTESTED! WRITTEN IN <10min!! But this general approach should work out, I'm pretty certain.
I am Srime



