pqqqqq / DirectScript

A scripting system for Sponge
2 stars 1 forks source link

Specifics of hurt #5

Open AsylumDreams opened 8 years ago

AsylumDreams commented 8 years ago

Is it possible to limit the trigger by specific types of damage / damage by weapons / mobs?

I've tried a few if statements but I'm not exactly au fait with the language.

script("DamageVariantsTest"){ trigger("hurt") if(hurt by arrow){ if(arrow){ if(damaged by arrow){

Not a direct CP of the script obviously, but that's a few of my format attempts at determining and limiting by damage types.

Is there a repo of sample scripts anywhere that can be nosed through to learn the more intermediary basics of this? :p

G1R-Productions commented 8 years ago

There isn't a repo of sample scripts that I know of but I have written quite a few myself. I haven't messed around with causes as during the time of when I was actively using DS it wasn't fully implemented but I contacted the Dev again about this and I am waiting for a response. In the meantime if you have any other questions feel free to ask and if I have the knowledge to answer them I will.

EDIT: Well I looked over some of my damage scripts and I see there is if(<"type"> ~ "attack"){ if(<"type"> ~ "hunger"){

Perhaps you could try if(<"type"> ~ "arrow"){

but I didn't test this and I don't expect it to work but its worth a try.

EDIT 2: I created an example repository since you requested it and included a few scripts I am going to use on my server.

https://github.com/pqqqqq/DirectScript/wiki/Script-Example-Repository

AsylumDreams commented 8 years ago

Thanks once again, although I feel that I may overload you ^_^ I'm seeking to shift my Denizen scripts over into Sponge - I'm slightly too impatient to await their actual Sponge release.

Where did you learn that <"type"> would modify the damage? Is that an aspect of coffeescript? I read in one of the comments that this is similar to a mashup of javascript and that, and I don't recognize it from javascript.

Would it be worth my while to study the basics of coffee and attempt to apply them to this to try to figure things out alone?

I do appreciate the help, but I'm aware that I'll need a lot of it, and of course it's always better for people to know how to help themselves :p

G1R-Productions commented 8 years ago

Everything I learned is from pqqqqq the developer. If you have discord we can chat there whether voice or text since it will be easier and faster to help you that way. I don't know any coding languages really and I've just been picking things from by bug testing the plugin and having lengthy conversations with pqqqqq.

This is a link to my discord channel: https://discord.gg/0YXPDUTjufe8h7I9

AsylumDreams commented 8 years ago

Cool. Added. I'll try to keep notes / document things as I learn to throw into your repository.