firing out ships
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
simply this- how can you make a weapon with an "invoke" or equivalent script capable of spawing kamikazi ships?
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
1a open your mod xml to place the new objects in
1b and the main xml(or tdb) for refference
2 make your kamakazi ship, canhitsource area weapons should work
3 find an auton(the item that spawns it to be precise)
4 dig in the invoke there, copy what you need into the invoke on your weapon
5 change it so that it spawns your new ship, and orders it to attack your target, not escort you(remove the objremove or whatever it is at the end or it will delete your weapon, very annoying...)
you now have a self destructing/exploding auton that will seek out your target, be careful- and don't blow your eye out.
1b and the main xml(or tdb) for refference
2 make your kamakazi ship, canhitsource area weapons should work
3 find an auton(the item that spawns it to be precise)
4 dig in the invoke there, copy what you need into the invoke on your weapon
5 change it so that it spawns your new ship, and orders it to attack your target, not escort you(remove the objremove or whatever it is at the end or it will delete your weapon, very annoying...)
you now have a self destructing/exploding auton that will seek out your target, be careful- and don't blow your eye out.
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
wait- doesn't that need to be used via "u"?
where can I stick the code so it fires like a normal weapon?
where can I stick the code so it fires like a normal weapon?
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
i don't think you can, but you can come close with autohotkey and giving the invoke a key, i did this with the tow hook(simply pressing h imitates u then h, but messes up typing).Wolfy wrote:where can I stick the code so it fires like a normal weapon?
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
hmm...
oh, what ai setting can be used to get it to work? it wont shoot or even get near tthe target
oh, what ai setting can be used to get it to work? it wont shoot or even get near tthe target
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
the following code block is partly taken from the autosentinel spawner item, and i changed the order so it attacks the player's target. it will make an autosentinel appear and attack your target.(assuming you have the targetting program installed, press t f and r to use it, if you don't have it and no enemies are near it may just gate out)
i just got another idea! the nami mine launcher has a tracking mine, perhaps this could be modified to be a mine that looks like a ship.
Code: Select all
(block Nil
(setq auton
(sysCreateShip
&scAutoSentinel;
(objGetPos gSource)
&svFriendlyAuton;
"auton"
)
)
(shpOrderAttack auton (objGetTarget gPlayerShip))
)
i just got another idea! the nami mine launcher has a tracking mine, perhaps this could be modified to be a mine that looks like a ship.
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
well, i wanted mine to gate in. I took the working code from my SOS and reinforcement roms.Bobby wrote:the following code block is partly taken from the autosentinel spawner item, and i changed the order so it attacks the player's target. it will make an autosentinel appear and attack your target.(assuming you have the targetting program installed, press t f and r to use it, if you don't have it and no enemies are near it may just gate out)Code: Select all
(block Nil (setq auton (sysCreateShip &scAutoSentinel; (objGetPos gSource) &svFriendlyAuton; "auton" ) ) (shpOrderAttack auton (objGetTarget gPlayerShip)) )
i just got another idea! the nami mine launcher has a tracking mine, perhaps this could be modified to be a mine that looks like a ship.
for the other weapon i already put the himal interceptor's image the missile image slot.
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
set a reccurring timer on the ship and then when the playership is close enough:
(sysCreateWeaponFire number spaceObject vector number number spaceObject [condition])
number: the UNID of the called weapon effect
spaceObject: the controller of the weaponfire, can also be Nil (probably good to be Nil)
vector: position of the weaponfire (gSource)
number: angle of the direction of the weapon (shpGetDirection ship)
number: speed of the weaponfire (pick a number)
spaceObject: the target of the weapon, can also be Nil (gPlayerShip or Nil)
[condition]: if True the failsafe variable in the <Weapon> tag is ignored (True is probably good)
(sysCreateWeaponFire number spaceObject vector number number spaceObject [condition])
number: the UNID of the called weapon effect
spaceObject: the controller of the weaponfire, can also be Nil (probably good to be Nil)
vector: position of the weaponfire (gSource)
number: angle of the direction of the weapon (shpGetDirection ship)
number: speed of the weaponfire (pick a number)
spaceObject: the target of the weapon, can also be Nil (gPlayerShip or Nil)
[condition]: if True the failsafe variable in the <Weapon> tag is ignored (True is probably good)
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
it's not only the playership that these missiles are designed to attack.F50 wrote:set a reccurring timer on the ship and then when the playership is close enough:
(sysCreateWeaponFire number spaceObject vector number number spaceObject [condition])
number: the UNID of the called weapon effect
spaceObject: the controller of the weaponfire, can also be Nil (probably good to be Nil)
vector: position of the weaponfire (gSource)
number: angle of the direction of the weapon (shpGetDirection ship)
number: speed of the weaponfire (pick a number)
spaceObject: the target of the weapon, can also be Nil (gPlayerShip or Nil)
[condition]: if True the failsafe variable in the <Weapon> tag is ignored (True is probably good)
virtually all of my script is produced from cobbled together versions of existing code (From george) thus i understand very little of that.
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Not only the playership? Then you'll need to get the check between the position of gSource (the ship) and (objGetTarget gSource)
Sorry I don't have time to explain what I wrote before, I really should be working on an essay. Periculi (man you are good) and probably bobby should understand what I mean and should be able to make an example for you.
It took me a while, but after trying to script and understand a mission (in the Pirates mod which I will release and explain soon after school is over) I am able to understand the stuff on Xelerus and able to solve problems like this.
an example call to sysCreateWeaponFire (untested):
(sysCreateWeaponFire &itMicronuke; gSource gSource (shpGetDirection gSource) 100 (objGetTarget gSource) True)
Sorry I don't have time to explain what I wrote before, I really should be working on an essay. Periculi (man you are good) and probably bobby should understand what I mean and should be able to make an example for you.
It took me a while, but after trying to script and understand a mission (in the Pirates mod which I will release and explain soon after school is over) I am able to understand the stuff on Xelerus and able to solve problems like this.
an example call to sysCreateWeaponFire (untested):
(sysCreateWeaponFire &itMicronuke; gSource gSource (shpGetDirection gSource) 100 (objGetTarget gSource) True)