• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Special Effect Roll] How do I alter the roll for the SFX using Chopinski's Missile System?

Level 7
Joined
Sep 16, 2016
Messages
185
JASS:
            set missile = Slash.create(x, y, z, tx, ty, tz)
            set missile.source = u
            set missile.model = "BladeBeamFinalLarger.mdx"
            set missile.speed = 2500
            set missile.damage = 100
            set missile.collision = 275
            set missile.owner = GetOwningPlayer(u)
            set missile.scale = 2.5
            call missile.color(255, 0, 35)
            call missile.launch()

I know roll is in radians, but I can't seem to change the roll for the missile. I tried using the Blz native, but it expects an "effect" but the missile here is not of type "effect" so I couldn't find a way to use it like that
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
JASS:
            set missile = Slash.create(x, y, z, tx, ty, tz)
            set missile.source = u
            set missile.model = "BladeBeamFinalLarger.mdx"
            set missile.speed = 2500
            set missile.damage = 100
            set missile.collision = 275
            set missile.owner = GetOwningPlayer(u)
            set missile.scale = 2.5
            call missile.color(255, 0, 35)
            call missile.launch()

I know roll is in radians, but I can't seem to change the roll for the missile. I tried using the Blz native, but it expects an "effect" but the missile here is not of type "effect" so I couldn't find a way to use it like that
I'm no expert on the Jass version but I would check/do the following:
1) Check if the model of the special effect can actually support the orientations you want. I know certain models won't play nice.
2) Create an onPeriod function which does the following:
vJASS:
set missile.roll = GetRandomReal(0.0, 2.0)
set missile.pitch = GetRandomReal(0.0, 2.0)
set missile.yaw = GetRandomReal(0.0, 2.0)
Surely there are examples and API for this on the thread / demo map.
 
Last edited:
Level 7
Joined
Sep 16, 2016
Messages
185
I'm no expert on the Jass version but I would check/do the following:
1) The model of the special effect can actually support the orientations you want. I know certain models won't play nice.
2) Create an onPeriod function which does the following:
vJASS:
set missile.roll = GetRandomReal(0.0, 2.0)
set missile.pitch = GetRandomReal(0.0, 2.0)
set missile.yaw = GetRandomReal(0.0, 2.0)
Surely there are examples and API for this on the thread / demo map.

Thanks Uncle I love you, I will go ahead and try it right away and see how it will go, and report back
 
Level 7
Joined
Sep 16, 2016
Messages
185
I'm no expert on the Jass version but I would check/do the following:
1) Check if the model of the special effect can actually support the orientations you want. I know certain models won't play nice.
2) Create an onPeriod function which does the following:
vJASS:
set missile.roll = GetRandomReal(0.0, 2.0)
set missile.pitch = GetRandomReal(0.0, 2.0)
set missile.yaw = GetRandomReal(0.0, 2.0)
Surely there are examples and API for this on the thread / demo map.

I got an error

JASS:
        static method onPeriod takes nothing returns nothing
            
            set missile.roll = GetRandomReal(0.0, 2.0)
            set missile.pitch = GetRandomReal(0.0, 2.0)
            set missile.yaw = GetRandomReal(0.0, 2.0)
        endmethod

"pitch is not a member of Missiles___MissileEvents". But yaw says the same and for roll its "can't convert real to boolean". I tried doing this instead:

JASS:
        static method onPeriod takes nothing returns nothing
            
            set missile.effect.roll = GetRandomReal(0.0, 2.0)
            set missile.effect.pitch = GetRandomReal(0.0, 2.0)
            set missile.effect.yaw = GetRandomReal(0.0, 2.0)
        endmethod

But the effect was completely unchanged
 
Level 39
Joined
Feb 27, 2007
Messages
5,016
.roll is a boolean value, not a real. .pitch and .yaw do not exist as struct members of a Missile. From the documentation:
roll -> If true, the missile will roll as well (1.31+ only) (read and write)
//...
curve -> The curve of the missile (read and write)
arc -> The Arc of the missile (read and write)
I am not familiar with Relativistic Missiles, but as I understand you are supposed to set .curve and .arc which will determine the missile's orientation throughout its trajectory. There is no way to set p/r/y specifically because the system determines what those should be at each step. As Uncle said: read the documentation or examples when you are confused.
 
Level 7
Joined
Sep 16, 2016
Messages
185
.roll is a boolean value, not a real. .pitch and .yaw do not exist as struct members of a Missile. From the documentation:

I am not familiar with Relativistic Missiles, but as I understand you are supposed to set .curve and .arc which will determine the missile's orientation throughout its trajectory. There is no way to set p/r/y specifically because the system determines what those should be at each step. As Uncle said: read the documentation or examples when you are confused.

I'm already aware of reading the documentation and I already have 2 example maps I'm using as reference, I'm also aware that .roll is a boolean value but I mentioned it to showcase it as such. If said examples or documentations had an answer this thread wouldn't have existed. Moving on, curve or arc is not the solution (arguably, pitch and arc could be deemed the same), but they are sadly not something I could use for this particular ability.

I was not aware it was not possible to adjust the roll sadly using this system, thanks for letting me know, wish I knew it sooner.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
I'm already aware of reading the documentation and I already have 2 example maps I'm using as reference, I'm also aware that .roll is a boolean value but I mentioned it to showcase it as such. If said examples or documentations had an answer this thread wouldn't have existed. Moving on, curve or arc is the solution (arguably, pitch and arc could be deemed the same), but they are sadly not something I could use for this particular ability.

I was not aware it was not possible to adjust the roll sadly using this system, thanks for letting me know, wish I knew it sooner.
You could always edit the system to be able to do so. I imagine it wouldn't be too difficult to inject a few lines of code that modify those properties, even if done in a janky way.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
I'm already aware of reading the documentation and I already have 2 example maps I'm using as reference, I'm also aware that .roll is a boolean value but I mentioned it to showcase it as such. If said examples or documentations had an answer this thread wouldn't have existed. Moving on, curve or arc is the solution (arguably, pitch and arc could be deemed the same), but they are sadly not something I could use for this particular ability.

I was not aware it was not possible to adjust the roll sadly using this system, thanks for letting me know, wish I knew it sooner.
That wasn't too difficult, all of the necessary code was in the Missiles script. I added two new variables to the core system, newRoll and newRollRate. I also added a GUI variable called MissileNewRoll which sets newRollRate if you want to use it in GUI.

newRoll is what the Roll starts at and newRollRate is how much it increases every interval. A rate of 0.01 is a good amount for experimenting purposes.

I added comments labeled "UNCLE" to all of the edited code, so if you open the code in Visual Studio you can Control + Find that exact text to quickly find my changes.

Note that this is a "trimmed fat" version of Chopinski's original demo map. I deleted a lot of the optional systems, hopefully nothing important. My GUI tests seem to work fine.
 

Attachments

  • Missile Roll 1.w3m
    78.2 KB · Views: 1
Last edited:
Level 7
Joined
Sep 16, 2016
Messages
185
That wasn't too difficult, all of the necessary code was in the Missiles script. I added two new variables to the core system, newRoll and newRollRate. I also added a GUI variable called MissileNewRoll which sets newRollRate if you want to use it in GUI.

newRoll is what the Roll starts at and newRollRate is how much it increases every interval. A rate of 0.01 is a good amount for experimenting purposes.

I added comments labeled "UNCLE" to all of the edited code, so if you open the code in Visual Studio you can Control + Find that exact text to quickly find my changes.

Note that this is a "trimmed fat" version of Chopinski's original demo map. I deleted a lot of the optional systems, hopefully nothing important. My GUI tests seem to work fine.

Wow this is fire, I will go test it out right away
 
Level 7
Joined
Sep 16, 2016
Messages
185
That wasn't too difficult, all of the necessary code was in the Missiles script. I added two new variables to the core system, newRoll and newRollRate. I also added a GUI variable called MissileNewRoll which sets newRollRate if you want to use it in GUI.

newRoll is what the Roll starts at and newRollRate is how much it increases every interval. A rate of 0.01 is a good amount for experimenting purposes.

I added comments labeled "UNCLE" to all of the edited code, so if you open the code in Visual Studio you can Control + Find that exact text to quickly find my changes.

Note that this is a "trimmed fat" version of Chopinski's original demo map. I deleted a lot of the optional systems, hopefully nothing important. My GUI tests seem to work fine.

It's perfect, thank you so much. The trimmed version works perfect, as I was not using the optional systems anyway. Thank you <3
 
Top