An "alien artifact" that can add a weapon to a ship?

Can you add a new weapon to a ship through a capturable artifact?

Hi everyone.

I'm not sure if you're familiar with ZombiesRus5's alien artifacts... they are objects in the game that can be "captured" and then "attached" to a selected capital ship which improves the ship i.e. more armor, hull points etc.

I would like to create a capturable alien artifact in the game (using Zombie's premise, I already have the mesh), that can add an additional weapon to the selected ship? i.e a wave cannon or a plasma turret or something? This could work through the artifact allowing research.... or as a area of effect persistent affect? Am I on the right track? 

Any advice would be great! 

20,136 views 23 replies
Reply #1 Top

Well, you can only add real weapons by research or starbase upgrade level. So if these things can give research, that would be a way. However, I'm not sure how they actually work; I assume they do not in fact do that though, because I know of no way to make a ship in game give access to a research subject.  ;)

Reply #2 Top

You can't do a normal ability because artifacts don't attach abilities, they attach buffs.

The buff would need to do a periodicAction probably using ApplyBuffToTargetsInRadius. The target would then need to cast a buff back to the calling unit which would then create another Buff to create the weapon effect back to the last unit. These are done with ApplyBuffToLastSpawnerNoFilterNoRange and ApplyBuffToLastSpawnerWithTravelNoFilterNoRange. This should work as the MassDisorientation ability doesn't require actual targets in the ability file.

And like I said earlier, the only common null point would be center for a buff like this.

 

Reply #3 Top

Quoting ZombiesRus5, reply 2

You can't do a normal ability because artifacts don't attach abilities, they attach buffs.

The buff would need to do a periodicAction probably using ApplyBuffToTargetsInRadius. The target would then need to cast a buff back to the calling unit which would then create another Buff to create the weapon effect back to the last unit. These are done with ApplyBuffToLastSpawnerNoFilterNoRange and ApplyBuffToLastSpawnerWithTravelNoFilterNoRange. This should work as the MassDisorientation ability doesn't require actual targets in the ability file.

And like I said earlier, the only common null point would be center for a buff like this.

 

So could I duplicate the Mass Disorientation ability as a basis for this ability? It applies a buff to targets within range. 

Reply #4 Top

I was able to get a working prototype of this put together. 

Here's the buff code. You'd need to setup your timing, weapon effects and what the weapon should do.

https://dl.dropboxusercontent.com/u/5790092/Temp/ArtifactWeaponPrototype.7z

Reply #5 Top

Quoting ZombiesRus5, reply 4

I was able to get a working prototype of this put together. 

Here's the buff code. You'd need to setup your timing, weapon effects and what the weapon should do.

https://dl.dropboxusercontent.com/u/5790092/Temp/ArtifactWeaponPrototype.7z

Thank you so much Z... I don't think that I would have had the skills to set this up myself from scratch. I'll play around with it and come back to you soon. 

Reply #6 Top

Quoting ZombiesRus5, reply 4

I was able to get a working prototype of this put together. 

Here's the buff code. You'd need to setup your timing, weapon effects and what the weapon should do.

https://dl.dropboxusercontent.com/u/5790092/Temp/ArtifactWeaponPrototype.7z

I couldn't get this to work Z. I duplicated the ability file for the shrine artifact (AbilityArtifactShrineAttach), tried to attach the ability to the shrine artifact... but when it attaches to a capital ship absolutely nothing happens. 

In your buffs (PostTarget, PreTarget & AttachTarget) I couldn't find reference to BuffArtifactWeaponSelf or BuffArtifactWeaponTarget.

BuffArtifactWeaponAttachPostTarget makes reference to the BuffArtifactShrineAttachTarget buff. PreTarget also includes reference to another Shrine buff. 

BuffArtifactWeaponAttachTarget references BuffArtifactShrineSpreadCulture? 

Reply #7 Top

Quoting Cylon_Luvr, reply 6


Quoting ZombiesRus5,

I was able to get a working prototype of this put together. 

Here's the buff code. You'd need to setup your timing, weapon effects and what the weapon should do.

https://dl.dropboxusercontent.com/u/5790092/Temp/ArtifactWeaponPrototype.7z



I couldn't get this to work Z. I duplicated the ability file for the shrine artifact (AbilityArtifactShrineAttach), tried to attach the ability to the shrine artifact... but when it attaches to a capital ship absolutely nothing happens. 

In your buffs (PostTarget, PreTarget & AttachTarget) I couldn't find reference to BuffArtifactWeaponSelf or BuffArtifactWeaponTarget.

BuffArtifactWeaponAttachPostTarget makes reference to the BuffArtifactShrineAttachTarget buff. PreTarget also includes reference to another Shrine buff. 

BuffArtifactWeaponAttachTarget references BuffArtifactShrineSpreadCulture? 

Sorry I was testing with Shrine, I apparently reverted some of the code... Will upload a new one. 

Reply #8 Top

https://dl.dropboxusercontent.com/u/5790092/Temp/Artifact_Weapon.7z

I should also note, you need to capture the artifact first or it can't apply the weapons correctly. Basically the artifact needs to be owned by the player or order to start the buff chain correctly otherwise it thinks it's a militia still attacking ;)

Reply #9 Top

What is wrong with this code Z? It keeps crashing out on me. I want to use a Beam as the weapon. 

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit -1
buffExclusivityForAIType "NotExclusive"
isInterruptable FALSE
isChannelling FALSE
numInstantActions 2
instantAction
buffInstantActionType "PlayPersistantAttachedEffect"
instantActionTriggerType "OnDelay"
delayTime 0.000000
effectInfo
effectAttachInfo
attachType "Aura"
smallEffectName "Buff_AlienArtifactShrine"
mediumEffectName "Buff_AlienArtifactShrine"
largeEffectName "Buff_AlienArtifactShrine"
soundID ""
instantAction
buffInstantActionType "CreateFrigate"
instantActionTriggerType "OnOwnerDeath"
frigateType "Artifact_AlienShrine"
numFrigates
Level:0 1
Level:1 1
Level:2 1
Level:3 1
matchOwnerDamageState FALSE
impulse 0.000000
expiryTime
Level:0 -1.000000
Level:1 -1.000000
Level:2 -1.000000
Level:3 -1.000000
spawnFrigateSoundID ""
postSpawnBuff ""
numPeriodicActions 1
periodicAction
actionCountType "Infinite"
actionIntervalTime
Level:0 10.000000
Level:1 10.000000
Level:2 10.000000
Level:3 10.000000
buffInstantActionType "ApplyBuffToTargetsInRadiusWithTravel"
instantActionTriggerType "AlwaysPerform"
buffType "BuffArtifactWeaponTarget"
targetFilter
numOwnerships 1
ownership "Enemy"
numObjects 5
object "CapitalShip"
object "PlanetModule"
object "Frigate"
object "Titan"
object "Corvette"
numSpaces 1
space "Normal"
numConstraints 0
columnRadius
Level:0 1000.000000
Level:1 1250.000000
Level:2 0.000000
Level:3 0.000000
Level:3 0.000000
maxTargetCount
Level:0 1.000000
Level:1 1.000000
Level:2 4.000000
Level:3 6.000000
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
mediumEffectName ""
largeEffectName ""
soundID ""
travelSpeed 0.000000
effectStaggerDelay 0.000000
hasWeaponEffects TRUE
weaponEffectOriginType "Targetter"
weaponEffectAttachInfo
attachType "Ability"
abilityIndex 3
weaponEffectImpactOffsetType "RandomMesh"
canWeaponEffectHitHull TRUE
canWeaponEffectHitShields TRUE
weaponEffectsDef
weaponType "Beam"
burstCount 1
burstDelay 0.000000
fireDelay 0.000000
muzzleEffectName ""
muzzleSoundMinRespawnTime 0.100000
muzzleSounds
soundCount 1
sound ""
hitEffectName "CapitalAbility_BeamBlastImpact"
hitHullEffectSounds
soundCount 1
sound ""
hitShieldsEffectSounds
soundCount 1
sound ""
beamEffectSounds
soundCount 1
sound "EFFECT_BEAMBLAST_ACTIVATE"
beamGlowTextureName "CapitalAbilityBeamBlast_Glow"
beamCoreTextureName "CapitalAbilityBeamBlast_Core"
beamWidth 250.000000
beamGlowColor ffffffff
beamCoreColor ffffffff
beamTilingRate 3.000000
numOverTimeActions 0
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 0

Reply #10 Top

Did you add the new entity files to the manifest?

Reply #11 Top

Sure did... I can get it to work for missile weapons and lasers... but not for beam weapons? Weird... 

It must be a problem with the code itself. Maybe I could send the buff file to you and you can run it through your program to see what the error is? 

Reply #12 Top

Quoting Cylon_Luvr, reply 11

Sure did... I can get it to work for missile weapons and lasers... but not for beam weapons? Weird... 

It must be a problem with the code itself. Maybe I could send the buff file to you and you can run it through your program to see what the error is? 

yeah let's do that

Reply #13 Top

Quoting ZombiesRus5, reply 12


Quoting Cylon_Luvr,

Sure did... I can get it to work for missile weapons and lasers... but not for beam weapons? Weird... 

It must be a problem with the code itself. Maybe I could send the buff file to you and you can run it through your program to see what the error is? 



yeah let's do that

No probs. Just sent the file to you. 

Reply #14 Top

It looks like you've tried to merge ApplyBuffToTargetsInColumn with ApplyBuffToTargetsInRadiusWithTravel which isn't going to work.

While google code is around you can see the syntax rules on this wiki I created: https://code.google.com/p/soaseplugin/wiki/RebellionSyntax

Also, I'm not sure ApplyBuffToTargetsInColumn will work in this embedded buff system. It seems to rely on ApplyTargettedBuffToSelf in the Ability file which isn't possible for this implementation.

ApplyTargettedBuffToSelf does not appear to work in the periodic action so that limits somewhat the ability to create beams. I also don't know if there is a way to get ApplyBuffToTargetsInColumn to work correctly either due to this.

I did get a Beam to fire using ApplyBuffToSelf in the periodicAction, then a sub-buff based off BuffChargedMissilesSpawnDamage using ApplyBuffToTargetsInRadiusWithChainTravel.

Reply #15 Top

Quoting ZombiesRus5, reply 14

It looks like you've tried to merge ApplyBuffToTargetsInColumn with ApplyBuffToTargetsInRadiusWithTravel which isn't going to work.

While google code is around you can see the syntax rules on this wiki I created: https://code.google.com/p/soaseplugin/wiki/RebellionSyntax

Also, I'm not sure ApplyBuffToTargetsInColumn will work in this embedded buff system. It seems to rely on ApplyTargettedBuffToSelf in the Ability file which isn't possible for this implementation.

ApplyTargettedBuffToSelf does not appear to work in the periodic action so that limits somewhat the ability to create beams. I also don't know if there is a way to get ApplyBuffToTargetsInColumn to work correctly either due to this.

I did get a Beam to fire using ApplyBuffToSelf in the periodicAction, then a sub-buff based off BuffChargedMissilesSpawnDamage using ApplyBuffToTargetsInRadiusWithChainTravel.

Ok. So I'm thinking that the artifact will just give cap ships an additional high powered energy weapon. 

Is it actually causing damage though? I can't find reference to the amount of damage anywhere in the buffs? 

Also, do you have a model for it? 

Reply #16 Top

Quoting ZombiesRus5, reply 14

It looks like you've tried to merge ApplyBuffToTargetsInColumn with ApplyBuffToTargetsInRadiusWithTravel which isn't going to work.

While google code is around you can see the syntax rules on this wiki I created: https://code.google.com/p/soaseplugin/wiki/RebellionSyntax

Also, I'm not sure ApplyBuffToTargetsInColumn will work in this embedded buff system. It seems to rely on ApplyTargettedBuffToSelf in the Ability file which isn't possible for this implementation.

ApplyTargettedBuffToSelf does not appear to work in the periodic action so that limits somewhat the ability to create beams. I also don't know if there is a way to get ApplyBuffToTargetsInColumn to work correctly either due to this.

I did get a Beam to fire using ApplyBuffToSelf in the periodicAction, then a sub-buff based off BuffChargedMissilesSpawnDamage using ApplyBuffToTargetsInRadiusWithChainTravel.

Do I need to create a damage buff Z?

Reply #17 Top

If you want a Beam type energy weapon then you can clone BuffChargedMissilesSpawnDamage.entity and BuffChargedMissilesLightDoDamage.entity. The targeting and weapon effect is in spawn damage. The damage is performed in do damage.

The periodic action in the artifact buff would like this.

periodicAction
actionCountType "Infinite"
actionIntervalTime
Level:0 10.000000
Level:1 30.000000
Level:2 30.000000
Level:3 30.000000
buffInstantActionType "ApplyBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffChargedMissilesSpawnDamage"
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
mediumEffectName ""
largeEffectName ""
soundID ""

Reply #18 Top

Quoting ZombiesRus5, reply 17

If you want a Beam type energy weapon then you can clone BuffChargedMissilesSpawnDamage.entity and BuffChargedMissilesLightDoDamage.entity. The targeting and weapon effect is in spawn damage. The damage is performed in do damage.

The periodic action in the artifact buff would like this.

periodicAction
actionCountType "Infinite"
actionIntervalTime
Level:0 10.000000
Level:1 30.000000
Level:2 30.000000
Level:3 30.000000
buffInstantActionType "ApplyBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffChargedMissilesSpawnDamage"
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
mediumEffectName ""
largeEffectName ""
soundID ""

 

* interval time and bufftype would be modified based no your settings.

Reply #19 Top

I may need to scrub the persistent effects for the artifacts. Trying to isolate some mid-late game mini-dumps or crashes that appear related to them. If I use the Mesh based particle effect I eventually get a pure-virtual function error and crash. If I revert to the released image based particle effect I get a minid-dump after the game runs for a bit. Going to try pulling out the artifact particle effect and see if it runs smoothly.

The particles aren't doing anything fancy at all, so I'm not sure why it would be causing issues other than Mesh particles appear to be used mostly with travel effects for weapons or flairs and not in abilities. The image based particle is more in line so if removing that resolves the latter issue then I'm not sure if applying a persistent effect in this type of buff chain is a good idea or not...

Just a hard one to troubleshoot as there aren't good debugging tools for modders.

Reply #20 Top

Quoting ZombiesRus5, reply 19

I may need to scrub the persistent effects for the artifacts. Trying to isolate some mid-late game mini-dumps or crashes that appear related to them. If I use the Mesh based particle effect I eventually get a pure-virtual function error and crash. If I revert to the released image based particle effect I get a minid-dump after the game runs for a bit. Going to try pulling out the artifact particle effect and see if it runs smoothly.

The particles aren't doing anything fancy at all, so I'm not sure why it would be causing issues other than Mesh particles appear to be used mostly with travel effects for weapons or flairs and not in abilities. The image based particle is more in line so if removing that resolves the latter issue then I'm not sure if applying a persistent effect in this type of buff chain is a good idea or not...

Just a hard one to troubleshoot as there aren't good debugging tools for modders.

Interestingly I shifted the particle effect to the first buff in the chain and have had an AI vs AI game running smoothly for quite a while now and it appears the particles are remaining in effect too... odd but I'll take it! 

 

Reply #21 Top

Quoting ZombiesRus5, reply 18


Quoting ZombiesRus5,

If you want a Beam type energy weapon then you can clone BuffChargedMissilesSpawnDamage.entity and BuffChargedMissilesLightDoDamage.entity. The targeting and weapon effect is in spawn damage. The damage is performed in do damage.

The periodic action in the artifact buff would like this.

periodicAction
actionCountType "Infinite"
actionIntervalTime
Level:0 10.000000
Level:1 30.000000
Level:2 30.000000
Level:3 30.000000
buffInstantActionType "ApplyBuffToSelf"
instantActionTriggerType "AlwaysPerform"
buffType "BuffChargedMissilesSpawnDamage"
effectInfo
effectAttachInfo
attachType "Invalid"
smallEffectName ""
mediumEffectName ""
largeEffectName ""
soundID ""



 

* interval time and bufftype would be modified based no your settings.

Thanks Z. I tried all of that, but I still can't get it to work!! Arrrgggh!! Could you please have a look? 

http://s000.tinyupload.com/?file_id=07997269411840957250

Reply #23 Top

Awesome!!! It's working perfectly now! 

Thanks so much Z. Do you have a model that you can use for the artifact? 

I put together some strings for you: 

StringInfo
ID "IDS_ARTIFACT_ALIEN_WEAPON_NAME"
Value "Weapon Artifact"
StringInfo
ID "IDS_ARTIFACT_ALIEN_WEAPON_DESCRIPTION"
Value "This artifact contains the designs for an advanced alien energy cannon which can be mounted on Capital Ships and Titans."