Post new topic    
Liquid Metal Slime
Send private message
Back, with Some Minor Script Issues 
 PostSat Mar 15, 2014 4:30 pm
Send private message Reply with quote
Hey guys,

It's been awhile (I do this a lot, don't I)! I took a break from working on games back in November and finally started back last night. I think what really inspired me to get back to work on my game was paying $5 for a game on Steam that was seriously inferior in comparison to many games that have been made on the OHRRPGCE.

I mean, it seriously amazes me that an OHRRPGCE game hasn't made it onto Steam yet, considering some of the inferior games that have been greenlighted that aren't near the caliber work of many OHR games.

Regardless, my purchase inspired me to get back to work on my game again in hopes of selling it one day. I'm undecided whether I will attempt the Steam route, but that's neither here nor there. Onto my question!

****This was resolved. Skip down a few posts to my newest problem****

I have a script that simulates the character "climbing" up a ladder. It collapses the caterpillar, climbs up the ladder, then turns the caterpillar back on at the top. I have it set so the heros stack at the top because it would show some heros on the ladder even at the top.

The stack works fine, but the game still thinks that the characters are on the ladder. So even though they are stacked on top of each other, as soon as you move, it moves the characters back to their regular position. It's kind of hard to explain, so I tried to get a screenshot of it.

Fred is the #1 position and Gluep is #2. This is a photo of me moving to the right, right after everyone stacked. Gluep should be right behind Fred, but instead it's as if he's climbing up the ladder again. This happens to each hero every time you try to move, until they are in a straight line again.

Ultimately if there isn't a solution for it, I'll just use a different script. I'd really like to use it if at all possible, but it just doesn't look right given its current state.

Here's the script:

Code:
plotscript,ladder7up,begin
suspend player
suspend random enemies
set caterpillar mode (off)
set hero direction (find hero(hero:Fred),up)
set hero picture (find hero(hero:Fred),190,outside battle)
walk hero (0,up,7)
wait for hero (0)
set hero picture (find hero (hero:Fred),54,outside battle)
set hero position (1,(hero x(0)),(hero y(0)))
set hero position (2,(hero x(0)),(hero y(0)))
set hero position (3,(hero x(0)),(hero y(0)))
wait for all
set caterpillar mode (on)
resume player
resume random enemies
end

Cornbread Chemist
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 6:41 pm
Send private message Reply with quote
Personally, in my game I use two separate "each step scripts" scripts and don't do anything to collapse the caterpillar party:

1) MOUNT LADDER - this script works using a zone. If zone 10 is stepped on, then the hero's sprite changes in to the hero climbing sprite. Simply place zone 10 everywhere along the ladder.

2) DISMOUNT LADDER - this script uses a zone as well. If zone 11 is stepped on, then the hero's sprite changes back to the hero walking sprite. Simply place zone 11 on either end of the ladder.

Note: This will make all heroes change to "hero climbing" at the same time. If you want each individual hero to look like their climbing as they touch the ladder, then you'll have to keep track of their (x,y) coordinates and compare those coordinates to the zone.

If you want to do your code this way and don't understand, let me know and I'll show my code as an example. It should look something like this once it's done:

https://www.youtube.com/watch?v=J6Tvmn_b6Jc

By the way, those graphics of yours are awesome!
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 8:47 pm
Send private message Reply with quote
You sir, are a genius. I've actually never messed with zones before, but now I can say that I have! Your idea behind the ladder script is way more efficient than what I was trying to do. Not to mention it also looks way cooler.

Thanks for help and kind words!
Cornbread Chemist
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 9:11 pm
Send private message Reply with quote
Meatballsub wrote:
You sir, are a genius. I've actually never messed with zones before, but now I can say that I have! Your idea behind the ladder script is way more efficient than what I was trying to do. Not to mention it also looks way cooler.

Thanks for help and kind words!


Thanks. Also I should mention this as it may not be evident. This type of zone related code can be used for much more things.

Some examples:

-It can be used to make your character look like they are partially submerged in water, by placing a zone in the waters edge. (I'll be doing this in my game sooner or later)

-It can be used to change how bright/dark your character looks as they approach/leave a light source. Though I think there are less tedious ways of doing this.

-It can be used to change your characters "z" elevation each step. This is perfect for making ramps within your game. (This is something I have just made another video on since I did it in my game)

Really there's endless things that can be done, it's just up to your imagination.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 10:29 pm
Send private message Reply with quote
Good ideas, thanks!

There's another cosmetic issue I'm dealing with now. Things like this used to not bother me, but it's driving me crazy now.

The video will show exactly what is happening. It's happening right after a script is ran and I resume a caterpillar formation.

http://mocbjsoftware.com/problem.avi
Cornbread Chemist
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 10:43 pm
Send private message Reply with quote
Meatballsub wrote:
Good ideas, thanks!

There's another cosmetic issue I'm dealing with now. Things like this used to not bother me, but it's driving me crazy now.

The video will show exactly what is happening. It's happening right after a script is ran and I resume a caterpillar formation.

http://mocbjsoftware.com/problem.avi


Unfortunately my browser is not letting me open that video for some reason. Maybe could you describe the issue?

If you'd like to refer to my code to see what I did here it is:
Code:


#THIS DISMOUNTS LADDER
If (read zone (1, x, y)) then(
   set hero picture(0, 37) #Hero 1
 )

 If (read zone (1, a, b)) then(
   set hero picture(1, 10) #Hero 2
 )


#THIS MOUNTS LADDER
 If (read zone (2, x, y)) then(
    set hero picture(0, 36) #Hero 1
 )

 If (read zone (2, a, b)) then(
    set hero picture(1, 16) #Hero 2
 )


Note: This only is written for two heros, but can easily be written for more. Also notice that Hero 1 uses variables (x,y) in order to check if the zone is read, while Hero 2 uses variables (a,b).... This makes it look like one character is still climbing while the other has dismounted. I suspect this may be the problem you're running in to but I'm not sure. Let me know.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 10:46 pm
Send private message Reply with quote
Thanks, but the problem isn't with the ladder script. I actually did get that working properly thanks to your advice. The issue in the video is entirely different.

I'll see if I can upload it in a different format shortly.
Cornbread Chemist
Liquid Metal Slime
Send private message
 
 PostSat Mar 15, 2014 10:48 pm
Send private message Reply with quote
Meatballsub wrote:
Thanks, but the problem isn't with the ladder script. I actually did get that working properly thanks to your advice. The issue in the video is entirely different.

I'll see if I can upload it in a different format shortly.


Sounds good.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Blubber Bloat
Send private message
 
 PostSun Mar 16, 2014 1:30 am
Send private message Reply with quote
To quote everyone in the sonic universe, long time no see.
I hope you stay around, maybe write a thing or two in that blohrg of yours.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x V
Metal King Slime
Send private message
 
 PostSun Mar 16, 2014 1:36 am
Send private message Reply with quote
Unfortunately that's a hard problem to fix. I believe the only way to do so properly is to walk the other heroes onto the last 3 tiles that the leader stepped on before resuming the caterpillar. You might have to walk the leader for 3 tiles in order to know what those 3 tiles are (in case they didn't move much while the caterpillar was suspended and you don't know which direction the player approached from).

I think we should do something about it, but I'm not sure what. Probably the ideal solution is to rewrite the caterpillar trailing so that the other heroes path-find to the leader rather than dumbly following exactly 5 ticks behind (which is also a problem if the hero speed isn't 4). We'd like to add pathfinding anyway, so...
Liquid Metal King Slime
Send private message
 
 PostSun Mar 16, 2014 2:00 am
Send private message Reply with quote
When you turn caterpillar back on, it will re-calculate the mid-steps between each hero in the order they are positioned in the caterpillar.

Would it be possible if right before you turn caterpillar back on, you could walk the heroes so they are standing next to each other in caterpillar order. In effect, you would be re-assembling the caterpillar manually. It looks like this could work in the scene you showed in the video, but I imagine it could be harder in some other scenes.

And what TMC mentioned about pathfinding is true. We do really need some pathfinding commands. It would make such things easier.
Metal King Slime
Send private message
 
 PostSun Mar 16, 2014 8:13 am
Send private message Reply with quote
Ah, I'd forgotten about that. That's not nearly as bad as I thought.
Liquid Metal Slime
Send private message
 
 PostSun Mar 16, 2014 5:14 pm
Send private message Reply with quote
Bob the Hamster wrote:
Would it be possible if right before you turn caterpillar back on, you could walk the heroes so they are standing next to each other in caterpillar order. In effect, you would be re-assembling the caterpillar manually. It looks like this could work in the scene you showed in the video, but I imagine it could be harder in some other scenes.


Possibly an alternative solution would be to add the "set hero speed" to 4, for the ladder being climbed, then set it back to whatever you have it defaulted to during dismount. I'm not certain that this would work. Although it would look better anyways because people don't climb as fast as they walk.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal Slime
Send private message
 
 PostSun Mar 16, 2014 8:39 pm
Send private message Reply with quote
Thanks guys. Was able to correct it with some of the suggestions you gave Smile
Cornbread Chemist
Display posts from previous: