-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
* 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
There was a problem hiding this 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.
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
engine/src/main/kotlin/world/gregs/voidps/engine/inv/InventoryOperations.kt
Outdated
Show resolved
Hide resolved
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 |
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.
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 |
i found the shadow its npc 8092 and star hitting is object 38659 |
* 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.
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
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/StarDustHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/StarDustHandler.kt
Outdated
Show resolved
Hide resolved
* 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
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStarHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/skill/mining/Mining.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/StarDustHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStarHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStarHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStarHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStarHandler.kt
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
* 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"
There was a problem hiding this 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
game/src/main/kotlin/world/gregs/voidps/world/activity/skill/mining/Mining.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/dnd/shootingstar/ShootingStar.kts
Outdated
Show resolved
Hide resolved
game/src/main/kotlin/world/gregs/voidps/world/activity/skill/mining/Mining.kts
Outdated
Show resolved
Hide resolved
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. " |
* Remove "println()" in favor for "logger" * Remove a print that was no longer need in 'addOre' function in `Mining.kts`
…low Voids code format
The wiki isn't correct, I verified it with Kris who has tested it on osrs. Can't speak for rs3 though
Also went down a rabbit hole of cross referencing osrs and 634 files Here's all the sounds ids (their official jagex names):
There is no identical equivilant for animation 1157 (it looks slightly different on 634 than osrs) but I think 4835 looks close enough |
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:
What if you're a player without a pickaxe? Jagex doesn't typically force players to start actions like mining without them clicking anything. So I'm thinking either:
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`
There was a problem hiding this 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
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 |
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
that's fine, and no i don't have a rune-server account
i thought there would be an areaSound but i couldn't find it so i thought it wasn't implemented yet |
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! |
addAll()
method toInventoryOperations
class this will allow for adding multiple items at once