Hello again SC2Mapter, it's time for another terrible LaurenI question!
I'm trying to give a unit a shooting function similar to one in Asteroids, wherein the unit fires a projectile directly in front of it which damages anything it hits. Naturally, this has already been done for me through The Lost Viking's SS_Fighter Shooting ability. Everything's working well except for one big problem: the missiles fired appear to target a point relative to the ground, which causes them to angle upwards or downwards when the firing unit is near a cliff. Here's some visual examples of what I'm talking about:
What's supposed to happen, and what does happen when the target point is located somewhere on the same cliff height:
What happens when the target point is located on a different cliff height:
I've spent the last day looking at the complicated effect tree for SS_Fighter Shooting and I think the field I need to change is in the "Shooter - SS_Fighter Shooting Straight" Effect. This is an effect of type Create Persistant, which appears to call the two effects to spawn the basic left and right missiles, and assigns them their respective target points relative to the source unit in the Effect: Periodic Offsets field. What confuses me about this is that the Z value of both points ((0.5,-20,0), (-0.5,-20,0)) is 0, which would imply no Z offset from the source unit's Z value, so everything SHOULD work appropriately!
I know I keep asking from this community and not really giving much back, and as always I really appreciate the help you folks have given me. If you have any suggestions where in the effect tree I should be looking, I'd be most interested in hearing them, but if not I do understand and apologize for not sharing what I've learned over the last few weeks beyond posting what approach I used to solve each problem.
I think the missile unit (also known as ammo unit) needs to have Ignore Terrain Height checked in Flags, you'll probably have to change its height afterwards too.
Be warned though that this will probably make the shots fly into the terrain and dissapear if the Viking is lower like in the last pic.
I've tried checking "Ignore Terrain Height" in the mover flag, but it just ends up clipping through the ground while heading to the same destination point. What do you mean by changing the height, though? Do you mean the Periodic Offset coordinates? I guess I could try that, but I think it'll just make them always shoot up. Still, I'll poke around a bit.
The mover used by most SS projectiles use a throw driven mover. It uses one of the two fields that give Throw driven movers a vector. The SS ones use the field that sends them relative to the global map grid and not the unit.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
As you mentioned, it turns out the driver I wanted to use was the Throw driver, instead of Generic.
Inside the mover SS_Fighter Missile, I modified the Driver type for both phases to Throw, and then the Throw Vector to (0, -1, 0). This causes both missiles to behave appropriately, although there is a minor bug where they converge into a single missile as they travel away from the source unit. This can be fixed by making separate movers for the left and right missile with slightly different X values in their throw vector.
Thanks a ton!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello again SC2Mapter, it's time for another terrible LaurenI question!
I'm trying to give a unit a shooting function similar to one in Asteroids, wherein the unit fires a projectile directly in front of it which damages anything it hits. Naturally, this has already been done for me through The Lost Viking's SS_Fighter Shooting ability. Everything's working well except for one big problem: the missiles fired appear to target a point relative to the ground, which causes them to angle upwards or downwards when the firing unit is near a cliff. Here's some visual examples of what I'm talking about:
What's supposed to happen, and what does happen when the target point is located somewhere on the same cliff height:
What happens when the target point is located on a different cliff height:
I've spent the last day looking at the complicated effect tree for SS_Fighter Shooting and I think the field I need to change is in the "Shooter - SS_Fighter Shooting Straight" Effect. This is an effect of type Create Persistant, which appears to call the two effects to spawn the basic left and right missiles, and assigns them their respective target points relative to the source unit in the Effect: Periodic Offsets field. What confuses me about this is that the Z value of both points ((0.5,-20,0), (-0.5,-20,0)) is 0, which would imply no Z offset from the source unit's Z value, so everything SHOULD work appropriately!
I know I keep asking from this community and not really giving much back, and as always I really appreciate the help you folks have given me. If you have any suggestions where in the effect tree I should be looking, I'd be most interested in hearing them, but if not I do understand and apologize for not sharing what I've learned over the last few weeks beyond posting what approach I used to solve each problem.
@LaurenI: Go
I think the missile unit (also known as ammo unit) needs to have Ignore Terrain Height checked in Flags, you'll probably have to change its height afterwards too. Be warned though that this will probably make the shots fly into the terrain and dissapear if the Viking is lower like in the last pic.
I've tried checking "Ignore Terrain Height" in the mover flag, but it just ends up clipping through the ground while heading to the same destination point. What do you mean by changing the height, though? Do you mean the Periodic Offset coordinates? I guess I could try that, but I think it'll just make them always shoot up. Still, I'll poke around a bit.
The mover used by most SS projectiles use a throw driven mover. It uses one of the two fields that give Throw driven movers a vector. The SS ones use the field that sends them relative to the global map grid and not the unit.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Got it working!
As you mentioned, it turns out the driver I wanted to use was the Throw driver, instead of Generic.
Inside the mover SS_Fighter Missile, I modified the Driver type for both phases to Throw, and then the Throw Vector to (0, -1, 0). This causes both missiles to behave appropriately, although there is a minor bug where they converge into a single missile as they travel away from the source unit. This can be fixed by making separate movers for the left and right missile with slightly different X values in their throw vector.
Thanks a ton!