If I have two points in 3d space (x,y,z), p1 and p2, Is it possible to make a missile or weapon launch at p1 and travel to p2 where it would "impact" or do damage?
You could either try to configurate a mover to travel approximately along the path you want, however this would most likely not be exact. Another method would be to launch a missile at p1 and on impact, launch a second missile from p1 to p2.
The bare minimum you need for a missile to work is a missile unit for the projectile, a launch missile effect and a missile mover. However, some additional components usually make sense, because without an impact effect, the missile wouldn't do anything, without a missile actor you would only see the sphere test model travelling to the target and without an action actor, the missile would only travel on the floor without starting at any of the units attachment points etc.
So a typical missile uses a launch missile effect, an impact effect (probably of type damage), a missile mover, a projectile unit, a missile actor for the projectile unit, an action actor for the missile launch and probably some means of executing the launch effect, usually an ability or a weapon.
The target can be a unit or a point, you can also make it selectable by the user. You can change the target location field of the launch missile effect for this.
I advise looking at the phase missile weapon from the campaign in that there by using clever actor events it attaches a Site actor to a point so the missile is launched from it.
The launch Site actor is one of the few actors that can impact missile function. I advise you use a lurker like system for actor creation using the host for properties field to link it to the caster to create a model at p1 with an associated site which then does the launching to p2.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I have a solution now. It's kind of ugly but works :)
The goal was to make the viewport circulate around a Point, viewing it from different angles, and when clicking somewhere on the screen, launching a missile at the clicked XY point. By doing this, creating a "gunship" experience.
The camera rig is based on 8 cameras, distributed a 45 degree step pitch. Their target points are calculated based on a center point, with a polar offset. The angle that determines the polar offset is the pitch of the cameras. When the centerpoint moves, I update the position of the camera rig. On a periodic timer event, the current camera steps into the next camera in the rig. The launch point should be somewhere slightly above the current camera view. To accomplish this, I set the "distance" of all cameras to 1. I created a dummy unit that is located at the target point of the gunship-players camera (the current view). This new point was then offsetted in height so that it appears to be in the same height or slightly above the cameras eye-position. The ground radius used in the polar offset calculation is set to a negative value. With a positive value, every camera will be looking out, away from the centerpoint. With a negative value the camera is being "pushed back" and appears to be circulating around the centerpoint, looking inwards.
The launch of the missiles is done using create effect, using the dummy unit as a source, targeting random units in a weapon specific proximity of the click-point. Any standard missile looks good, no data editing neccessary!
Missiles cant fire at xy points, they need units. My solution was to create a search area around the clickpoint, adding any units in there and then target them (randomly). This creates a cool effect, when firing a bunch of missiles, they seem to hunt down enemy targets.
If I have two points in 3d space (x,y,z), p1 and p2, Is it possible to make a missile or weapon launch at p1 and travel to p2 where it would "impact" or do damage?
You could either try to configurate a mover to travel approximately along the path you want, however this would most likely not be exact. Another method would be to launch a missile at p1 and on impact, launch a second missile from p1 to p2.
@Kueken531: Go
Do I need an actor to launch a missile or weapon, or is it somehow possible to do it with only a point?
Does the target have to be a unit, or can it be simply a generic point?
The bare minimum you need for a missile to work is a missile unit for the projectile, a launch missile effect and a missile mover. However, some additional components usually make sense, because without an impact effect, the missile wouldn't do anything, without a missile actor you would only see the sphere test model travelling to the target and without an action actor, the missile would only travel on the floor without starting at any of the units attachment points etc.
So a typical missile uses a launch missile effect, an impact effect (probably of type damage), a missile mover, a projectile unit, a missile actor for the projectile unit, an action actor for the missile launch and probably some means of executing the launch effect, usually an ability or a weapon.
The target can be a unit or a point, you can also make it selectable by the user. You can change the target location field of the launch missile effect for this.
I advise looking at the phase missile weapon from the campaign in that there by using clever actor events it attaches a Site actor to a point so the missile is launched from it.
The launch Site actor is one of the few actors that can impact missile function. I advise you use a lurker like system for actor creation using the host for properties field to link it to the caster to create a model at p1 with an associated site which then does the launching to p2.
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
I have a solution now. It's kind of ugly but works :)
The goal was to make the viewport circulate around a Point, viewing it from different angles, and when clicking somewhere on the screen, launching a missile at the clicked XY point. By doing this, creating a "gunship" experience.
The camera rig is based on 8 cameras, distributed a 45 degree step pitch. Their target points are calculated based on a center point, with a polar offset. The angle that determines the polar offset is the pitch of the cameras. When the centerpoint moves, I update the position of the camera rig. On a periodic timer event, the current camera steps into the next camera in the rig. The launch point should be somewhere slightly above the current camera view. To accomplish this, I set the "distance" of all cameras to 1. I created a dummy unit that is located at the target point of the gunship-players camera (the current view). This new point was then offsetted in height so that it appears to be in the same height or slightly above the cameras eye-position. The ground radius used in the polar offset calculation is set to a negative value. With a positive value, every camera will be looking out, away from the centerpoint. With a negative value the camera is being "pushed back" and appears to be circulating around the centerpoint, looking inwards.
The launch of the missiles is done using create effect, using the dummy unit as a source, targeting random units in a weapon specific proximity of the click-point. Any standard missile looks good, no data editing neccessary!
Missiles cant fire at xy points, they need units. My solution was to create a search area around the clickpoint, adding any units in there and then target them (randomly). This creates a cool effect, when firing a bunch of missiles, they seem to hunt down enemy targets.
@Monkalizer: Go
So you attached the sites to the camera and cursor?
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