Multitarget weapon fire creating

A place to discuss mods in development and concepts for new mods.
Post Reply
User avatar
sun1404
Militia Captain
Militia Captain
Posts: 527
Joined: Thu Nov 03, 2011 10:32 am
Location: Heretic. (Finally!)

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.
RPC
Fleet Admiral
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

Code: Select all

multiTarget=		"true"
autoAcquireTarget=	"true"
and just use sysCreateWeaponFire to fire the weapon and see if they multitarget.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
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.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

From my knowledge, sysCreateWeaponFire cannot automatically acquire target, let alone multitarget.
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.

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
User avatar
sun1404
Militia Captain
Militia Captain
Posts: 527
Joined: Thu Nov 03, 2011 10:32 am
Location: Heretic. (Finally!)

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.
Yes, look at my avatar, I have a wyvera type ship.
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

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.
User avatar
sun1404
Militia Captain
Militia Captain
Posts: 527
Joined: Thu Nov 03, 2011 10:32 am
Location: Heretic. (Finally!)

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. :wink:
Yes, look at my avatar, I have a wyvera type ship.
Post Reply