OHRRPGCE feature requests/suggestions

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
The Wobbler
A Scrambled Egg
Posts: 2817
Joined: Mon Oct 15, 2007 8:36 pm
Location: Underwater
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by The Wobbler »

Can we have a way to duplicate entire new menus (or copy them over like we can with items)? Thanks!!
User avatar
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

Post by Hedera »

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
User avatar
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

Post by Bob the Hamster »

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
User avatar
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

Post by Hedera »

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.
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.

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.
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: OHRRPGCE feature requests/suggestions

Post by TMC »

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.
Hedera wrote: Fri Jul 22, 2022 10:59 pm 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.
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.
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!!
Sure, took a look and it should be easy, I'll do that.
User avatar
The Wobbler
A Scrambled Egg
Posts: 2817
Joined: Mon Oct 15, 2007 8:36 pm
Location: Underwater
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by The Wobbler »

TMC wrote: Sat Jul 23, 2022 2:23 pm Sure, took a look and it should be easy, I'll do that.
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?
User avatar
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

Post by Bob the Hamster »

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?
User avatar
The Wobbler
A Scrambled Egg
Posts: 2817
Joined: Mon Oct 15, 2007 8:36 pm
Location: Underwater
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by The Wobbler »

Per hero would be great! Some of my dudes just look really weird in their victory animations.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by SwordPlay »

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.

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
I guess it's a pretty big ask, I really should use Godot or something, or improve my coding skill.
"Imagination. Life is your creation."
lennyhome
Slime Knight
Posts: 115
Joined: Fri Feb 14, 2020 6:07 am

Re: OHRRPGCE feature requests/suggestions

Post by lennyhome »

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.

Code: Select all

define constant(10,sbpx) # subpixel ratio to pixel
10 as the fixed point constant is too small. Choose 256 instead.
first get x and y inputs. if both, then reduce them to account for diagonals
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.
if neither x or y, apply friction.
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.
I have no idea how I would handle circular hitboxes.
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.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by SwordPlay »

Thank you Lenny. Very much appreciated.
"Imagination. Life is your creation."
User avatar
charbile
Metal Slime
Posts: 609
Joined: Tue Jun 21, 2011 6:18 am

Re: OHRRPGCE feature requests/suggestions

Post by charbile »

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
)
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by SwordPlay »

charbile wrote: Tue Aug 09, 2022 2:27 am in any other engine, you'll have to code all of that anyway, silly
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."
lennyhome
Slime Knight
Posts: 115
Joined: Fri Feb 14, 2020 6:07 am

Re: OHRRPGCE feature requests/suggestions

Post by lennyhome »

treating it as a wall or solid object that will be impassable
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.

Well... Not really solved because sometimes when you apply the corrective move, you may also cause another collision.
User avatar
RMZ
King Slime
Posts: 1721
Joined: Tue Oct 16, 2007 12:39 am
Contact:

Re: OHRRPGCE feature requests/suggestions

Post by RMZ »

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.
Post Reply