OHRRPGCE feature requests/suggestions
Moderators: Bob the Hamster, marionline, SDHawk
- The Wobbler
- A Scrambled Egg
- Posts: 2817
- Joined: Mon Oct 15, 2007 8:36 pm
- Location: Underwater
- Contact:
Re: OHRRPGCE feature requests/suggestions
Can we have a way to duplicate entire new menus (or copy them over like we can with items)? Thanks!!
- Hedera
- Slime Knight
- Posts: 175
- Joined: Tue May 17, 2011 11:38 am
- Location: a dying forest (all forests are dying)
Re: OHRRPGCE feature requests/suggestions
would it be possible to add optional arguments to after battle scripts, like how autorun scripts in maps have them
also would it be possible to have a way for custom to check where tags are used, like how it can check where scripts are used
also would it be possible to have a way for custom to check where tags are used, like how it can check where scripts are used
- Bob the Hamster
- Lord of the Slimes
- Posts: 7684
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Re: OHRRPGCE feature requests/suggestions
After battle scripts automatically receive one argument which is true or false based on whether you won the battle.
What value do you need for your after battle argument? Maybe there is another way to get it.
I think checking tag usage would be possible-- just quite difficult, since there are so many places a tag can be used
What value do you need for your after battle argument? Maybe there is another way to get it.
I think checking tag usage would be possible-- just quite difficult, since there are so many places a tag can be used
- Hedera
- Slime Knight
- Posts: 175
- Joined: Tue May 17, 2011 11:38 am
- Location: a dying forest (all forests are dying)
Re: OHRRPGCE feature requests/suggestions
I was using it in the script shown in the odwmyltf dev thread, to make it so that after going through a door or fighting a battle, the light scroll effect wouldn't disappear. The argument I wanted passed through is the map layer that covers up secret passages; if the variable becomes a 0 or 1 from how a battle ends, that explains why it was map layer 1 that glitched out.Bob the Hamster wrote: ↑Fri Jul 22, 2022 10:34 am After battle scripts automatically receive one argument which is true or false based on whether you won the battle.
What value do you need for your after battle argument? Maybe there is another way to get it.
Since each map would, in theory, have its own layer set aside for covering up secret passages, I needed it to find what it is for the current map. A switch (current map) replaced the variable, and it works fine now.
Re: OHRRPGCE feature requests/suggestions
We already show all places that tags are autoset, but showing all places a tag is used is far more work because they're used everywhere, so seems like low benefit for the effort.
Also it would be trivial to pass the formation as the 2nd arg to the afterbattle script so we should do that regardless, and could also pass the formation set unless triggered from a textbox or script.
It is absolutely crazy that fighting a battle still reloads the tilemap/passmap/zonemap and other map data too. I believe it does that because back in the real-mode DOS days there wasn't enough memory to have the 64KB of map data loaded during battles. I keep forgetting add a backcompat bit to disable that nonsense, but wanted to be cautious because so much reloading happens after battle. However there is a workaround: if you set the map (in General Map Settings) to remember Tile Data state when leaving, then it won't reload the tilemap (well, actually it saves and immediately reloads it!) Either way, map layer slices aren't modified after a battle.
Also it would be trivial to pass the formation as the 2nd arg to the afterbattle script so we should do that regardless, and could also pass the formation set unless triggered from a textbox or script.
Oh! Programmers should always ask what people *actually* want to do, which often is very different from what they requested.
It is absolutely crazy that fighting a battle still reloads the tilemap/passmap/zonemap and other map data too. I believe it does that because back in the real-mode DOS days there wasn't enough memory to have the 64KB of map data loaded during battles. I keep forgetting add a backcompat bit to disable that nonsense, but wanted to be cautious because so much reloading happens after battle. However there is a workaround: if you set the map (in General Map Settings) to remember Tile Data state when leaving, then it won't reload the tilemap (well, actually it saves and immediately reloads it!) Either way, map layer slices aren't modified after a battle.
Sure, took a look and it should be easy, I'll do that.The Wobbler wrote: ↑Thu Jul 21, 2022 11:43 pm Can we have a way to duplicate entire new menus (or copy them over like we can with items)? Thanks!!
- The Wobbler
- A Scrambled Egg
- Posts: 2817
- Joined: Mon Oct 15, 2007 8:36 pm
- Location: Underwater
- Contact:
Re: OHRRPGCE feature requests/suggestions
Cool thanks!
A couple other (hopefully small!) things:
When a spell costs MP, the battle menu displays cost vs. current total. If a spell costs HP, it just shows the cost. Could this be updated to show the current value too?
Also, could we have a bitset to disable victory animations?
- Bob the Hamster
- Lord of the Slimes
- Posts: 7684
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Re: OHRRPGCE feature requests/suggestions
I think adding HP total in the cost display would work fine
For the option to disable the victory dance, are you thinking per-hero or per-formation?
For the option to disable the victory dance, are you thinking per-hero or per-formation?
- The Wobbler
- A Scrambled Egg
- Posts: 2817
- Joined: Mon Oct 15, 2007 8:36 pm
- Location: Underwater
- Contact:
Re: OHRRPGCE feature requests/suggestions
Per hero would be great! Some of my dudes just look really weird in their victory animations.
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
Re: OHRRPGCE feature requests/suggestions
any chance of getting subpixel movement, with velocity accel/decel (with e.g, clamping to an upper bound), friction, and wallchecking? and taking into account reduced x/y values for diagonal movement? asking for a friend.
please regard my awful rudimentary attempt to implement such.
it's really rough, but nicely simulates something like Binding of Isaac which I've been playing a lot recently.
you can comment out "put slice" and uncomment "move slice with wallchecking", however i did not account that "move slice.." is relative x/y while "put slice" is absolute. :P
(yes i used 2 and 3 for the diagonal:orthogonal ratio, when it should be something like 1 and 1.4)
roughly in order, first get x and y inputs. if both, then reduce them to account for diagonals
apply the input as acceleration to velocity.
if neither x or y, apply friction. i guess there will be some error when moving diagonally and then orthogonally.
clamp velocity to an upper bound
if both x and y velocity, this upper bound is less. i think there will be some error when moving orthogonally then moving diagonally?
apply this velocity to x and y subpixel position
then place the slice appropriately using your preferred method?
i should really have written an increment/decrement thing for array
i also forget to add in the subpixel constant
impulse is intended for resolution of multiple forces on an object, like being pushed by multiple forces. I guess it would be nice to measure the magnitude of forces as well as their direction!
i'm not sure how i would write it all succinctly. Ideas are appreciated. As well as anything I've missed.
I guess I should use wrappers and also store the array data in local variables rather than constantly accessing the array? I would extend it for NPCs if it were not too intensive.
also I think I will potentially experience problems with trying to divide 0, because there is no special case to avoid that.
I noticed in Binding of Isaac that a lot of enemies have rudimentary pathing, and will get stuck behind walls when chasing the player, but that they will slide off and around corners.
Binding of Isaac seems to use circular hitboxes. I have no idea how I would handle circular hitboxes.
I guess it's a pretty big ask, I really should use Godot or something, or improve my coding skill.
please regard my awful rudimentary attempt to implement such.
it's really rough, but nicely simulates something like Binding of Isaac which I've been playing a lot recently.
you can comment out "put slice" and uncomment "move slice with wallchecking", however i did not account that "move slice.." is relative x/y while "put slice" is absolute. :P
(yes i used 2 and 3 for the diagonal:orthogonal ratio, when it should be something like 1 and 1.4)
roughly in order, first get x and y inputs. if both, then reduce them to account for diagonals
apply the input as acceleration to velocity.
if neither x or y, apply friction. i guess there will be some error when moving diagonally and then orthogonally.
clamp velocity to an upper bound
if both x and y velocity, this upper bound is less. i think there will be some error when moving orthogonally then moving diagonally?
apply this velocity to x and y subpixel position
then place the slice appropriately using your preferred method?
i should really have written an increment/decrement thing for array
i also forget to add in the subpixel constant
impulse is intended for resolution of multiple forces on an object, like being pushed by multiple forces. I guess it would be nice to measure the magnitude of forces as well as their direction!
i'm not sure how i would write it all succinctly. Ideas are appreciated. As well as anything I've missed.
I guess I should use wrappers and also store the array data in local variables rather than constantly accessing the array? I would extend it for NPCs if it were not too intensive.
also I think I will potentially experience problems with trying to divide 0, because there is no special case to avoid that.
I noticed in Binding of Isaac that a lot of enemies have rudimentary pathing, and will get stuck behind walls when chasing the player, but that they will slide off and around corners.
Binding of Isaac seems to use circular hitboxes. I have no idea how I would handle circular hitboxes.
Code: Select all
global variable(1, psl)
# players position in subpixel (100/px)
define constant(10,sbpx) # subpixel ratio to pixel
global variable(2, px)
global variable(3, py)
# sum of impulses on player position
global variable(4, wx)
global variable(5, wy)
define constant(10, impX)
define constant(11, impY)
define constant(30, velX)
define constant(31, velY)
define constant(20, posX)
define constant(21, posY)
plotscript, main, begin,
psl:=load walkabout sprite(2)
resize extra(psl,1000)
set sprite frame(psl,3)
put slice(psl,40,40)
while(true)do(
get input
wait
)
end
plotscript, get input, begin
variable(ix,iy)
if(key is pressed(key:W))then(iy-=3)
if(key is pressed(key:A))then(ix-=3)
if(key is pressed(key:S))then(iy+=3)
if(key is pressed(key:D))then(ix+=3)
if(ix<>0 && iy<>0)then(ix:=sign(ix)*2,iy:=sign(iy)*2) # IF DIAGONAL
set extra(psl,velX,get extra(psl,velX)+iX)
set extra(psl,velY,get extra(psl,velY)+iY)
if(abs(get extra(psl,velX))>30)then(set extra(psl,velX,30*sign(get extra(psl,velX)))) # CLAMP XVEL
if(ix==0)then( # X FRICTION
if(get extra(psl,velX))then(
set extra(psl,velX,get extra(psl,velX)--sign(get extra(psl,velX)))
))
if(abs(get extra(psl,velY))>30)then(set extra(psl,velY,30*sign(get extra(psl,velY)))) # CLAMP YVEL
if(abs(get slice extra(psl,velX))==30 && abs(get slice extra(psl,velY))==30)then(set slice extra(psl,velX,sign(get slice extra(psl,velX))*20),set slice extra(psl,velY,sign(get slice extra(psl,velY))*20)
)
if(iy==0)then( # Y FRICTION
if(get extra(psl,vely))then(
set extra(psl,velY,get extra(psl,velY)--sign(get extra(psl,velY)))
))
# APPLY VELOCITY TO SUBPIXEL POSITION
set extra(psl,posX,get extra(psl,posX)+get extra(psl,velX))
set extra(psl,posY,get extra(psl,posY)+get extra(psl,velY))
put slice(psl,get extra(psl,posX)/10,get extra(psl,posY)/10) # i wrote divided by 10, should've used the subpixel constant :P
#MOVE SLICE WITH WALLCHECKING(psl,get extra(psl,velX)/10,get extra(psl,velY)/10,0)
$1="posx:"
append number(1,get extra(psl,posx))
$1+", velx:"
append number(1,get extra(psl,velx))
show string(1)
end
"Imagination. Life is your creation."
Re: OHRRPGCE feature requests/suggestions
I won't go much into detail now because it's too hot here these days. But I just want to give you a couple of pointers.
10 as the fixed point constant is too small. Choose 256 instead.
Code: Select all
define constant(10,sbpx) # subpixel ratio to pixel
In the general case you want to normalize the acceleration vector and then multiply it by some constant to represent walking and running. You can cheat by scaling the acceleration vector to 70% if it's diagonal.first get x and y inputs. if both, then reduce them to account for diagonals
The friction has to be applied always. The combination of acceleration and friction will determine the terminal velocity and the stopping time. If you set it up correctly you should have no need to do any clamping.if neither x or y, apply friction.
A circle-circle collision consists of taking the center of the two circles and measuring the distance using Pythagora's theorem. If the distance is less than the sum of the radiuses, then the circles overlap. Most of the time however you're going to have to collide circles against rectangles or rectangles against rectangles.I have no idea how I would handle circular hitboxes.
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
Re: OHRRPGCE feature requests/suggestions
Thank you Lenny. Very much appreciated.
"Imagination. Life is your creation."
Re: OHRRPGCE feature requests/suggestions
in any other engine, you'll have to code all of that anyway, silly
used circle collision in dungeon friends,
as lenny said, though usually i'd say make it easy and check against a single x/y point
enemy x := abs( enemy sl x -- tower x pos)
enemy y := abs( enemy sl y -- tower y pos )
enemy distance := sqrt( (enemy x^2) + (enemy y^2) )
if ( enemy distance <= tower range ) then (
you're in range bro, tower range is the radius of its collision circle
)
used circle collision in dungeon friends,
as lenny said, though usually i'd say make it easy and check against a single x/y point
enemy x := abs( enemy sl x -- tower x pos)
enemy y := abs( enemy sl y -- tower y pos )
enemy distance := sqrt( (enemy x^2) + (enemy y^2) )
if ( enemy distance <= tower range ) then (
you're in range bro, tower range is the radius of its collision circle
)
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
Re: OHRRPGCE feature requests/suggestions
I think Godot has everything I mentioned, and more.
anyway the problem is not checking for collision, but treating it as a wall or solid object that will be impassable, and that will allow smooth sliding off/around it
"Imagination. Life is your creation."
Re: OHRRPGCE feature requests/suggestions
Let's take two circles for example. One is static and the other one moves towards it. At some point they'll touch. When that happens you'll need to find the shortest path out of the collision. It's easy because Pythagora's theorem tells you how far the moving circle went into the static one, so then you just force-move the moving circle back along the vector that connects the centers by that amount and the issue is solved.treating it as a wall or solid object that will be impassable
Well... Not really solved because sometimes when you apply the corrective move, you may also cause another collision.
Re: OHRRPGCE feature requests/suggestions
Is it possible to up the amount of conditional tags on an NPC? Doing the work with scripting is possible, but it's messier than it probably needs to be if there's an easier way to achieve this goal.
http://www.redtrianglegames.com
RMZ#4181
RMZ#4181