Multitarget weapon fire creating
I'm trying to make a multitarget weapon with multiple kinds of projectiles. From my knowledge, sysCreateWeaponFire cannot automatically acquire target, let alone multitarget. What function should I use for this? Or how should I implement sysCreateWeaponFire so that it can acquire a target for itself?
Yes, look at my avatar, I have a wyvera type ship.
-
- Fleet Admiral
- Posts: 2876
- Joined: Thu Feb 03, 2011 5:21 am
- Location: Hmm... I'm confused. Anybody have a starmap to the Core?
ObjTarget is the target for the weapon fired by sysCreateWeaponFire. This means that if you have a weapon that has maneuver= and use a ship as the target for sysCreateWeaponFire (you might have to use sysfindobject to find ships through code) you can find a way to have that weapon fire multiple shots and target.
(sysCreateWeaponFire weaponID objSource posVector dir speed objTarget [detonateNow] [weaponBonus]) -> obj
Alternatively you can just have a weapon have
and just use sysCreateWeaponFire to fire the weapon and see if they multitarget.
(sysCreateWeaponFire weaponID objSource posVector dir speed objTarget [detonateNow] [weaponBonus]) -> obj
Alternatively you can just have a weapon have
Code: Select all
multiTarget= "true"
autoAcquireTarget= "true"
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Get on Discord for mod help and general chat
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
In the past, yes. Today, sysCreateWeaponFire can fire at targets. You "just" need to iterate the spaceobjects near your ship and fire a sysCreateWeaponFire at each one up to the number of projectiles you want to fire.From my knowledge, sysCreateWeaponFire cannot automatically acquire target, let alone multitarget.
In pseudocode:
sysFindobject ships --> list of ships
for i 0 (number of shots)
(syscreateweaponfire shot (@ (list of ships) i))
where (@ (list of ships) i) will return the spaceobject around the ship (ordered by distance) one by one for each shot
Hmm.... sounds like martian to me... I don't actually understand the code, yet. I can only at most understand vaguely what each block of code I see do. Anyway, multitarget virtual weapon may be too hard right now. I'll come back and upgrade the weapon later...
And I don't think making a multitarget version of a weapon and then sysCreateWeaponFire it will have the multitarget feature. Only the graphics and damage get imported, it think, since sysCreateWeaponFire requires us to give informations of speed, direction, and bonus. I'll try it and see if it works.
And I don't think making a multitarget version of a weapon and then sysCreateWeaponFire it will have the multitarget feature. Only the graphics and damage get imported, it think, since sysCreateWeaponFire requires us to give informations of speed, direction, and bonus. I'll try it and see if it works.
Yes, look at my avatar, I have a wyvera type ship.
Don't give up, it is possible.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!
Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!
Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Well, making a multitarget version and sysCreateWeaponFire it really doesn't work. At least I learned a bit more about functions(are they in TLisp?) even if it failed. The mod I'm making should be released soon, but unfortunately will not incorporate all the ideas I had.
Yes, look at my avatar, I have a wyvera type ship.