Author Topic: XML questions and answers  (Read 69456 times)

Offline PokerChen

  • Hero Member Mark III
  • *****
  • Posts: 1,088
Re: XML questions and answers
« Reply #75 on: January 25, 2016, 08:44:36 pm »
Yeah, no idea where the script is though. Diazo had one to convert from the raw exported .csv to formatted wiki.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: XML questions and answers
« Reply #76 on: January 25, 2016, 09:01:47 pm »
The movement on spawning works. Here is an example. The die tag will kill it automatically, remove it to see the ship move in a square pattern.
Code: [Select]

  <entity name="TestMinion" ship_category="EnemyFamiliar" is_not_ready_to_seed="true"
  display_name="Test"
  behavior="Attacker" category="Ship"
  speed="300"
  max_health="20"
  image_folder="Enemy_BossBuddies" image_name="InvaderMinion2OrangeTeal"
  wall_collision_reduction="-15"
  time_to_visually_rotate_180_degrees="0.3"
  always_faces_player ="true"
  initial_movement_driving_bullet_pattern="ExampleBoxMovePattern"
>
    <hitbox radius="37" offset="-10,0" />
  </entity>



      <bullet_pattern name="ExampleBoxMovePattern">
<bullet speed="200" angle="180" shot_type="HexishellEmblazonedYellow" relative="true" uses_direct_location_control="true" location="150,300">
<die/>
    <loop iterations="-1">
<change uses_direct_location_control="true" location="300,300" time="0.5"/>
<wait time="1" />
<change uses_direct_location_control="true" location="-300,300" time="0.5"/>
<wait time="1" />
<change uses_direct_location_control="true" location="-300,-300" time="0.5"/>
<wait time="1" />
<change uses_direct_location_control="true" location="300,-300" time="0.5"/>
<wait time="1" />
</loop>
</bullet>
  </bullet_pattern>

And for EffectType.StartMovementDrivingPattern

Code: [Select]
  <system name="InteruptMovementSystem"
category="DirectUseSystem"
fire_rate="5"
ammo="10"
cue_time="0"
image_name="MolarBlue"
firing_timing="AllTheTime"
>
<effect timing="OnUse" targeting="Self" type="StartMovementDrivingPattern" related_pattern="ExampleBoxMovePattern"/>
  </system>

Part of the wiki problem is that searching is awkward for me using Chrome. The search is case sensitive and information is spread across pages, especially with modifiers and effects.

Thanks again for your help Keith. I'm trying to document my successes so that future generations have examples to work from.
« Last Edit: January 26, 2016, 02:31:05 pm by ptarth »
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: XML questions and answers
« Reply #77 on: January 25, 2016, 09:47:02 pm »
typo in those effect tags:

targeting instead of targetting

And the value "OnUse_ParentEntity" isn't valid; valid values are:

    Player
    AllEnemies
    AllPlayerFamiliars
    AllShots
    AllEnemyShots
    AllPlayerShots
    Self
    AllNormalEnemiesAndShots
    NonCondemnedBossesAndShots
    AllAutoPickups

In this case, I believe Self is what you want.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: XML questions and answers
« Reply #78 on: January 25, 2016, 10:34:47 pm »
Thank you. I...   :'( .... I think this is the point where I join Cinth and Misery and giant blocks of hat wear cheeses.


I'm taking a break now after sending Misery some updates.
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: XML questions and answers
« Reply #79 on: January 27, 2016, 08:01:56 pm »
Okay, I mostly got the movement stuff sorted out. i'm having some oddity in entities moving slowly or quickly towards a location, I think that might have to do with mixing fixed/relative/location attributes. I have this idea for a train boss that moves on a couple of different fixed paths with him "entering an exit" at the edge of the screen and then teleporting to a different "entrance" using the locations. It is having teleport issues. However, since there is a demand for low level enemies I've been workgin on those instead. Interestingly using fixed locations can move your entity outside of the map boundaries, which has some potential (and potential for trouble). If you want to keep entities inside the boundaries, relative movement using angle and speed seems to be the way to go.

My current problem is in regards to using the bullet attribute follows_previously_spawned_entity. The wiki entry:

Code: [Select]
follows_previously_spawned_entity (bool)
*makes this entity follow the last entity spawned by this operation
*for now [b]only[/b] works with a pattern triggered by an entity's [u]spawning_patterns[/u] attribute
*also, only takes effect on an entity after the spawning bullet behavior has concluded (without a die tag); before that point the bullet pattern itself decides where it moves

entity attribute spawning_patterns
Code: [Select]
spawning_patterns (List<bullet_pattern>)
when this entity is spawned by room-generation, instead of just spawning one at the center of the corresponding tile, it picks one of the bullet patterns in this list, then spawns one entity per bullet node that's a direct child of the pattern (so child nodes that do their own spawns don't count)

What I think I figured out at this point in writing this is that it works like this:
An Entity Y with spawning_pattern X spawns in a room. Entity Y then spawns new entities around it in the pattern specified by spawning_pattern X. Those entities then move according spawning_pattern X.

Which is great, except it is nothing that I was interested in using. I wanted to get bullets to follow bullets, but wait, shots are entities. But bullets aren't shots. So never mind again.

And now if anyone else has this bright idea they can save themselves some trouble, unless I'm completely wrong.
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: XML questions and answers
« Reply #80 on: January 28, 2016, 12:13:17 am »
Welcome to today's show, 'The Mystery of the Two Bodied Snake'. In this chilling tale we see what should be a terrifying pink, gold, and white snake, is even more disturbing as it has extra bodies!

The code for today's mystery is
Code: [Select]
<entity name="AbmoogBasic" ship_category="LocalGuard_1x1"
    category="Ship"
    display_name="Basic Abmoog"
    behavior="CardinalMover"
    speed="1" acceleration="50"
    max_health="25"
    image_folder="Enemy_Pursuers" image_name="Abmoog1Green"
    time_to_visually_rotate_180_degrees="2"
    >
    <hitbox radius="26" />
<system type="AbmoogBasicSystem" offset="0,0" />
  </entity>


 
 <system name="AbmoogBasicSystem"
   category="Weapon"
   shot_type="ClipperWhite"
   damage_type="Ballistic"
   attack_power="1"
   fire_rate="5"
   cue_time = "0"
   range_actual="600"
   shots_per_salvo="1"
   shot_speed="0"
   targeting_logic="Direct"
   image_name="Invisible"
   firing_timing="OnlyinRange"
   initial_firing_delay ="0"
   special_bullet_patterns="SnakePattern"
>
</system>

    <bullet_pattern name="SnakePattern">
  <bullet angle="0" speed="0">
<spawn>
<bullet_pattern>
$SnakeShot SHOT_TYPE=ClipperRed TIME=0.5 SPEED=300
</bullet_pattern>
</spawn>

<loop iterations="2">
<wait time="0.1"/>
<spawn>
        <bullet_pattern>
$SnakeShot SHOT_TYPE=TorchWhite TIME=0.5 SPEED=300
</bullet_pattern>
</spawn>
<wait time="0.1"/>
<spawn>
        <bullet_pattern>
$SnakeShot SHOT_TYPE=TorchGolden TIME=0.5 SPEED=300
</bullet_pattern>
</spawn>
<wait time="0.1"/>
</loop>
</bullet>
  </bullet_pattern>

 
    <var name="SnakeShot">
<bullet angle="0" speed="[SPEED]" shot_type="[SHOT_TYPE]" relative="true">
<loop iterations="-1">
<change angle="90" speed="0" relative="true" time="[TIME]"/>
<change angle="-90" speed="0" relative="true" time="[TIME]"/>
<change angle="-90" speed="0" relative="true" time="[TIME]"/>
<change angle="90" speed="0" relative="true" time="[TIME]"/>
</loop>
</bullet>
  </var>
 


What it should hypothetically produce is a snake like shot pattern with a pink head and alternating white and gold body segments. By changing the loop iteration count you should be able to increase the length of the snake. Our home viewers are encouraged to try it.

Now, here are images of loop iteration = 2 and 3. Note that the head and first 2 bodies pieces are fine and normal. But every white segment after the first is doubled! Increasing the length of the snake continues this pattern. I've no idea what is causing it. I'm going to try some more things, but I'm posting this as a morale booster.

Further information. It doesn't depend upon the color of the shot. Whichever one is topmost in the loop is doubled. It doesn't change with the addition of additional shots, body segment pattern sizes or 3 & 4 produce as expected with the first still being doubled.

I can confirm that this is the case, the loop is making the first line occur twice. Code that demonstrates:

Code: [Select]
    <var name="SnakeLoopShot">
<bullet angle="0" speed="100" shot_type="SpikeGreen" relative="false" interval_mult="1">
<loop iterations="-1">
<change self_scale="1"/>
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
</loop>
</bullet>
  </var>
 
      <var name="SnakeNoBuffLoopShot">
<bullet angle="0" speed="100" shot_type="SpikeRed" relative="false" interval_mult="1">
<loop iterations="-1">
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
</loop>
</bullet>
  </var>
 
 
      <var name="SnakeNoLoopShot">
<bullet angle="0" speed="100" shot_type="SpikeYellow" relative="false" interval_mult="1">
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
<change angle="45" speed="100" relative="false" time=".5"/>
<change angle="-45" speed="100" relative="false" time=".5"/>
</bullet>
  </var>
 

These are 3 patterns that should produce identical behaviors for the first 8 turns. After that the Yellow no loop shot should depart on its way. Attached is a screenshot demonstrating what does occur. On the first loop, the Red shot exits, then every loop cycle after that you can see it increase in distance. Note that the Green shot stays in proper position. So a quick and ugly solution is to add a change size line as the first line in your loop.

On an off note, it used to be you could have loop iterations=0 work, but not it forces at least 1 cycle. I'm mantising.
« Last Edit: January 28, 2016, 03:44:18 pm by ptarth »
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: XML questions and answers
« Reply #81 on: January 28, 2016, 05:49:54 pm »
This looks complicated

Offline PokerChen

  • Hero Member Mark III
  • *****
  • Posts: 1,088
Re: XML questions and answers
« Reply #82 on: January 29, 2016, 08:52:44 am »
How can I make a particular shot in a bullet pattern richochet off terrain? I've only seen modifiers in the system entities, which will be ignored by a special bullet pattern.

Offline Cinth

  • Core Member Mark II
  • *****
  • Posts: 2,527
  • Resident Zombie
Re: XML questions and answers
« Reply #83 on: January 29, 2016, 08:57:32 am »
I've only seen it as a system modifier and it's usually an all or nothing flag.
Quote from: keith.lamothe
Opened your save. My computer wept. Switched to the ST planet and ship icons filled my screen, so I zoomed out. Game told me that it _was_ totally zoomed out. You could seriously walk from one end of the inner grav well to the other without getting your feet cold.

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: XML questions and answers
« Reply #84 on: January 29, 2016, 09:03:38 am »
How can I make a particular shot in a bullet pattern richochet off terrain? I've only seen modifiers in the system entities, which will be ignored by a special bullet pattern.

Modifiers like that affect bullets in patterns actually.

Offline Cinth

  • Core Member Mark II
  • *****
  • Posts: 2,527
  • Resident Zombie
Re: XML questions and answers
« Reply #85 on: January 29, 2016, 09:19:50 am »
How can I make a particular shot in a bullet pattern richochet off terrain? I've only seen modifiers in the system entities, which will be ignored by a special bullet pattern.

Modifiers like that affect bullets in patterns actually.

While this is true, the usage zharmad is looking for isn't possible (as far as I know).
Quote from: keith.lamothe
Opened your save. My computer wept. Switched to the ST planet and ship icons filled my screen, so I zoomed out. Game told me that it _was_ totally zoomed out. You could seriously walk from one end of the inner grav well to the other without getting your feet cold.

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: XML questions and answers
« Reply #86 on: January 29, 2016, 09:33:20 am »
What you'd need is basically multiple systems.  That's the only way to get a combination of bullets that bounce and ones that do not.

I've never really found the need for a function beyond that, myself, or I'd have requested it awhile ago.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: XML questions and answers
« Reply #87 on: January 29, 2016, 12:18:07 pm »
https://www.arcengames.com/mediawiki/index.php?title=Starward_Rogue:XML_-_Modifier_Definitions#Contexts_In_Which_You_Can_Use_A_Modifier_Tag

bullet nodes can take modifier sub-nodes, with target="Self", and they should impact just that bullet. RicochetsOffTerrain is probably the modifier type you're looking for.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline PokerChen

  • Hero Member Mark III
  • *****
  • Posts: 1,088
Re: XML questions and answers
« Reply #88 on: January 29, 2016, 02:48:16 pm »
https://www.arcengames.com/mediawiki/index.php?title=Starward_Rogue:XML_-_Modifier_Definitions#Contexts_In_Which_You_Can_Use_A_Modifier_Tag

bullet nodes can take modifier sub-nodes, with target="Self", and they should impact just that bullet. RicochetsOffTerrain is probably the modifier type you're looking for.

That's the thing, it didn't work. Granted, I was changing angles and speeds of the bouncing bullet, but this shouldn't impact their richochet behaviour?

Okay just tested. The bullets are "richochay-ing" during a <wait> tag, but not a <change angle...> tag. Specifically, the richochet won't work if it's currently changing the angle (and will die), but will still richochet if it's just changing the speed.

...um, can this be fixed? It seems like a bug, and I was kinda hoping for, well, bouncing and curving boomerangs for my Australian-aboriginal warriors.
« Last Edit: January 29, 2016, 03:03:24 pm by zharmad »

Offline Cinth

  • Core Member Mark II
  • *****
  • Posts: 2,527
  • Resident Zombie
Re: XML questions and answers
« Reply #89 on: January 29, 2016, 03:10:22 pm »
You sir, are evil.
Quote from: keith.lamothe
Opened your save. My computer wept. Switched to the ST planet and ship icons filled my screen, so I zoomed out. Game told me that it _was_ totally zoomed out. You could seriously walk from one end of the inner grav well to the other without getting your feet cold.