Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shooting Star Distractions and Diversion #458

Merged
merged 21 commits into from
Feb 28, 2024
Merged

Shooting Star Distractions and Diversion #458

merged 21 commits into from
Feb 28, 2024

Conversation

Syntax2022
Copy link
Contributor

  • Add Shooting star Distractions and Diversion
  • Add Crashed star objects to objects.yml
  • Add XP values & mining chance to stardust in item.yml
  • Add various locations for Crashed Stars in StarLocationData class
  • Add star_sprite to npcs yml.
  • Add examine text to crashed_star objects in objects yml.
  • Add Prospecting crashed stars that will display progress to the next layer.
  • Add rewards when the star is completed, converting stardust to coins, astral runes, cosmic runes and gold ore. inline with runescape 2011
  • Add dialog to star sprite after star completion
  • Add check to mining to make sure that a player doesn't exceed 200 stardust in inventory and bank (a player will still gain experience)
  • Add addAll() method to InventoryOperations class this will allow for adding multiple items at once

Syntax2022 and others added 5 commits February 21, 2024 23:45
* Add Crashed star objects to objects.yml
* Add Check in Mining class when mining a Crashed Star to make sure the wrong script doesn't get triggered.
* Add xp value & mining chance to stardust in item.yml
* Add various locations for Crashed Stars in StarLocationData class
* Add examine text to crashed_star objects in objects yml.
* Add Prospecting crashed stars that will display progress to the next layer.
* Add rewards when the star is completed, converting stardust to coins, astral runes, cosmic runes and gold ore. inline with runescape
* Add dialog to star sprite after star completion
* Add check to mining to make sure that a player doesn't exceed 200 stardust in inventory and bank (a player will still gain experience)
* Add `addAll()` method to `InventoryOperations` class this will allow for adding multiple items at once
Copy link
Owner

@GregHib GregHib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All very minor comments imo, the biggest things are:

  • Modifying Mining.kts instead of copying it all
  • Damaging players instead of skipping crashing stars in front of players

Let me know if you need a hand with the latter, SpearShove.kts would be a good place to start and gameObject.nearestTile(player) will come in useful.

@Syntax2022
Copy link
Contributor Author

Syntax2022 commented Feb 23, 2024

The reason why i had copied the whole mining action from 'Mining.kts' to 'ShootingStar.kts' was because of this function i call handleMinedStar() to handle when the star needs to be replaced with the lower tier and change star if needed:

fun handleMinedStarDust(currentMinedStar: GameObject) {
    val starPayout = currentMinedStar.def["collect_for_next_layer", -1]
    if(totalCollected >= starPayout){
        val stage = currentMinedStar.id.takeLast(1)
        if(stage.equals("1")){
            currentMinedStar.remove()
            cleanseEvent(false)
            return
        }
        val nextStage = currentMinedStar.id.replace(stage, (stage.toInt() - 1).toString())
        val nextstar = currentMinedStar.replace(nextStage)
        totalCollected = 0
        changeStar(currentMinedStar.id, nextstar.id)
    }
}

I am still pretty new to kotlin scripting and wasn't sure how i would run a func in one script from another script. should i make a class that will act as a middle man between scripts?

did some extra research and you're correct the star casts a shadow a few seconds before landing, i looked through the RS3 Wiki if that was something that was added after the initial release and i can't seem to find anything in the update history that indicated that it was so i will add that before pushing the other requested changes

do you know of any good resources that will allow me to find graphic id's i have searched everywhere for id's for graphics and cannot seem to find the shadow and the star hitting the ground graphic i've searched rune-server, runelocus and various 600+ RSPS source's and i cannot find that graphic

@GregHib
Copy link
Owner

GregHib commented Feb 24, 2024

I am still pretty new to kotlin scripting and wasn't sure how i would run a func in one script from another script. should i make a class that will act as a middle man between scripts?

Yeah no worries, you can just create a regular .kt class/object class with a method in to reference functions inside of scripts. Although as it's a small function and only used in that one place you could just put it inside Mining.kts.

do you know of any good resources that will allow me to find graphic id's i have searched everywhere for id's for graphics and cannot seem to find the shadow and the star hitting the ground graphic i've searched rune-server, runelocus and various 600+ RSPS source's and i cannot find that graphic

Unfortunately there's no sure way, as jagex releases content all at once they tend to be near each other in id, so the general approach I take is get an existing animation/gfx and manually check nearby ids. In your case you could get the animation from one of the star objects (see ObjectDefinitions in tools) and then using GraphicsDefinitions to search for graphics with an animation id +/- 10 or something. Might turn it up. rs3/osrs obj databases: https://chisel.weirdgloop.org/gazproj/ also comes in useful.

It could also be an npc instead of a graphic, so might be worth checking npcs +/- a few ids from the star sprite see if there's any shadows there.

Animations are easier as a lot are here: https://docs.google.com/document/d/1Z_QowXfyvifigviSGWlyQqqnHOsg9pPh3ObaWkx-Wcg/edit

I do have this old list, but again it's a lot of guess work to find what you want: https://rune-server.org/runescape-development/rs2-server/configuration/629747-complete-0-3000-gfx-list.html

@jarryd229
Copy link
Contributor

i found the shadow its npc 8092 and star hitting is object 38659

Syntax2022 and others added 2 commits February 25, 2024 11:10
* Remove `star: true` from crashed star objects in object yml
* Change some star `collect_for_next_layer` values, forgot to change them from testing
* Remove addAll from `InventoryOperations`
* Change initial `currentStarTile` value to `Tile.Empty`
* Move most of the mining code to `Mining.kts`
* Add Star shadow moving to crashing tile before star spawning (missing crashing animation)
* Add check to `mining.kts` if the player is the first to mine the star they will be granted `(miningLevel * 75)` inline with runescape.
@Syntax2022
Copy link
Contributor Author

Syntax2022 commented Feb 25, 2024

i found the shadow its npc 8092 and star hitting is object 38659

You are the best, I never thought it would have been an object, i was looking at npcs, gfx, and a stretch an animation for the shadow NPC I didn't think objects would do that

* Add replacing falling star object with crashed star object
@Syntax2022
Copy link
Contributor Author

media for falling star and falling star with damage.

starfalling
starfallingdamage

* Change name of `StarDustHandler.kt` to `ShootingStarHandler.kt` to better describe the classes purpose
* Moved various methods from `ShootingStar.kts` to `ShootingStarHandler.kt`
* Add player animation when moved due to being under a crashing star
Syntax2022 and others added 3 commits February 26, 2024 16:55
* Add `isPlayerPresent()` function this checks to make sure there no players around the star before starting a new event
* Move cleanseEvent() from ShootingStarHandler.kt to ShootingStar.kts
* Add objectDespawn for when the star object id equals "shooting_star_tier_1"
Copy link
Owner

@GregHib GregHib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! I'll load it up a test it tonight

@GregHib
Copy link
Owner

GregHib commented Feb 27, 2024

I think I've found the real step back animation - 4835?

@Syntax2022
Copy link
Contributor Author

Syntax2022 commented Feb 27, 2024

I think I've found the real step back animation - 4835?

Everything i have found when a star lands on you, you just walk out of the star, there's no set animation for example

"If the shooting star lands on top of the player, you will walk out of the star, then begin mining. Additionally, logging into a world while standing on the spot of the star will allow the player to clip into the star itself, moving out when clicking elsewhere, or attempting to mine the star. "

Source: https://runescape.wiki/w/Shooting_Star

* Remove "println()" in favor for "logger"
* Remove a print that was no longer need in 'addOre' function in `Mining.kts`
@GregHib
Copy link
Owner

GregHib commented Feb 27, 2024

Everything i have found when a star lands on you, you just walk out of the star, there's no set animation for example

"If the shooting star lands on top of the player, you will walk out of the star, then begin mining. Additionally, logging into a world while standing on the spot of the star will allow the player to clip into the star itself, moving out when clicking elsewhere, or attempting to mine the star. "

Source: https://runescape.wiki/w/Shooting_Star

The wiki isn't correct, I verified it with Kris who has tested it on osrs. Can't speak for rs3 though

[2989] 2023-09-23 20:39:52 Player(Blurite Rock, idx: 760, x = 1778, y = 3494, z = 0)                Animation(name = "player_dragged_in", id = 1157)
[2989] 2023-09-23 20:39:52 Area sound, Unknown(Location(x = 1778, y = 3493, z = 0))                 SoundEffect(name = "star_meteor_landing", id = 4930, radius = 15)

Also went down a rabbit hole of cross referencing osrs and 634 files

Here's all the sounds ids (their official jagex names):

star_meteor_landing:5188
star_meteor_change:5189
star_mine1_4:5190
star_mine2_3:5191
star_mine2:5192
star_sprite_shake:5193
star_mine1:5194
star_sprite_appear:5195
star_mine1_2:5196
star_sprite_twinkle:5197
star_mine2_1:5198
star_mine2_4:5199
star_sprite_yawn:5200
star_sprite_wipe:5201
star_sprite_yawn_end1:5202
star_mine2_2:5203
star_mine1_3:5204
star_sprite_blink:5205
star_meteor_falling:5206
star_meteor_despawn:5207
star_mine1_1:5208

There is no identical equivilant for animation 1157 (it looks slightly different on 634 than osrs) but I think 4835 looks close enough

@Syntax2022
Copy link
Contributor Author

mine2

Okay, will change this now, for future reference, when it comes to 1:1 should i used a mix of RS3 and RS2 content, right now i have been only going off what RuneScape had during the era this project is based on.

@GregHib
Copy link
Owner

GregHib commented Feb 27, 2024

Okay, will change this now, for future reference, when it comes to 1:1 should i used a mix of RS3 and RS2 content, right now i have been only going off what RuneScape had during the era this project is based on.

It's complicated 1:1 isn't possible ofc but we can try our best by making assumptions and best guesses. The trouble with the wiki's is the are not always correct, mistakes happen but also they are written by players that don't understand the underlying mechanics (i.e. know the difference between normal walk & force/exact walk).

In this instance the wiki seems inaccurate and I have evidence of exact osrs mechanics, so osrs seems more reliable. I say inaccurate because the quote you showed me doesn't make sense:

"If the shooting star lands on top of the player, you will walk out of the star, then begin mining"

What if you're a player without a pickaxe?
What if your just a player running past who doesn't want to mine?

Jagex doesn't typically force players to start actions like mining without them clicking anything.

So I'm thinking either:

  • rs3 has changed how it works (possible as I haven't played rs3)
  • osrs has changed how it works (possible as it was re-implemented)
  • the writer got confused and is talking about when you click to mine when standing under (same as the following sentence)

To me the later seems the most plausible, I don't have an account to test the mechanics on rs3 today but my gut tells me it'll be similar if not identical to osrs.

That's my line of thinking anyway. The osrs data seems closer to 1:1 than the wiki in this instance.

Generally speaking: Screenshots/videos from the era > current osrs/rs3 behaviour > wiki explainations

But I doubt there will be any videos of it happening because it's such a rare occurance

* Add various sounds for `Star Falling`, `Star despawning`, `Star changing tier`, `Star Sprite spawning`
Copy link
Owner

@GregHib GregHib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codes looking good 👍 I'll test in-game tomorrow before merging

@GregHib
Copy link
Owner

GregHib commented Feb 28, 2024

Looking good! Fixed a few typo's, for future reference you can use areaSound() instead of looping players, and I changed how the calculating players to land on so it can't get the same player twice.

Thank you for your first contribution! 🎉

If it's alright I'll mention you in the thread update later this week, if you have a rune-server account I can link that too

@GregHib GregHib merged commit 074840b into GregHib:main Feb 28, 2024
2 checks passed
@Syntax2022
Copy link
Contributor Author

Thank you for your first contribution! 🎉

thank you, you've done a REALLY good job with this, even though it was a struggle due to needing to learn a lot as i'm going, it's still really fun working on this

If it's alright I'll mention you in the thread update later this week, if you have a rune-server account I can link that too

that's fine, and no i don't have a rune-server account

Looking good! Fixed a few typo's, for future reference you can use areaSound() instead of looping players, and I changed how the calculating players to land on so it can't get the same player twice.

i thought there would be an areaSound but i couldn't find it so i thought it wasn't implemented yet

@GregHib
Copy link
Owner

GregHib commented Feb 28, 2024

thank you, you've done a REALLY good job with this, even though it was a struggle due to needing to learn a lot as i'm going, it's still really fun working on this

Thanks, yeah it always takes bit to pick a new codebase but you've got the hang of it really quickly, it's been super helpful to see how you've approached it as a new-comer and it has highlighted some bits that aren't obvious to those that haven't used the codebase before, plenty more things to improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants