Jump to content

XML Beginner: Inserting a scrolling image into XML


Helantisubron^6

Recommended Posts

Good day everyone. I’ve been coming to W3schools for several years and the site/forums definitely complimented my learning of SQL. However, this is the first time that research alone was unable to resolve a question regarding XML. After several hours of researching, reading, and coding, it is time to call upon the experts! Before I get into the question, please note some background info:My experience with XML consists of only the 3-4 hours of research and modding attempts to pre-existing code. I am an Oracle functional dev with 5+ years of complex SQL scripting. I am just beginning to learn Java within the past few months. My question is a ‘gamer’ question and not for my profession. I play an online game (World of Tanks) that allows for mods to be inserted and altered via .swf files and XML scripts. The mod below displays data above enemy tanks such as damage, life remaining, etc. This data is not globally broadcast to all players in the game but unique to the UI of the player running this specific mod. In instances where enemy tanks blow up, a scrolling message of ‘Explode!’ appears above the tank before disappearing (<speed value="2"/>) Being that customization is encouraged, some players decide to alter variables such as color, scroll speed, and even the message itself. Based on that, I’d like modify my XML to display a small JPEG or GIF image instead of the scrolling message of ‘Explode!’. First, is this even plausible? If so, how would I need to modify the existing code to make this work? I have tried using <image> text nodes but to no avail. Once the XML is modified, what do I need to do to the .swf file that calls this script? Any information and time spent on this would be greatly appreciated. Again this is for a game and not a professional question. This is not a hack and does not violate any of the points mentioned in the ‘Guidelines and Netiquette’ section. Further proof of this assertion can be provided. What I hope to gain is the methodology and understanding behind the correct modifications so I can use it to further my knowledge of XML. Again, your time is greatly appreciated and I would be happy to provide any additional information. Thanks!

<?xml version="1.0" encoding="utf-8"?><overTargetMarkers>  <definition>	<author>Nicolas Siver + Korean Random</author>	<description>Default color theme. Default components positions.</description>	<date>Sun Aug 14 18:23:17 GMT+0300 2011</date>	<mod-version-min>2.0.4</mod-version-min>	<game-version>0.7</game-version>	<mod-page>http://www.koreanrandom.com/forum/files/file/4-overtargetmarkers/</mod-page>  </definition>  <battle>	<showPostmortemTips>true</showPostmortemTips>  </battle>  <components>	<friend>	  <combatScrollText>		<enabled value="true"/>		<speed value="2"/>		<maxRange value="40"/>		<textSize value="14"/>		<message>Explode!</message>		<prefix>-</prefix>		<postfix/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="200"/>		<hitKind>Absolute</hitKind>		<font>$TextFont</font>	  </combatScrollText>	  <contourIcon>		<tint amount="0"/>	  </contourIcon>	  <currentHealth>		<format size="11" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="60"/>		<maxValue enabled="true"/>	  </currentHealth>	  <healthBar>		<border size="1" color="0x000000" alpha="30"/>		<fill width="80" height="12" alpha="30"/>		<damage fade="1" alpha="65"/>	  </healthBar>	  <healthRatio>		<format size="11" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="60"/>	  </healthRatio>	  <playerName>		<format size="13" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="120"/>	  </playerName>	  <vehicleIcon>		<fill/>		<scale maxScale="100" x="0" y="16"/>	  </vehicleIcon>	  <vehicleName>		<format size="13" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="120"/>	  </vehicleName>	</friend>	<enemy>	  <combatScrollText>		<enabled value="true"/>		<speed value="2"/>		<maxRange value="40"/>		<textSize value="14"/>		<message>Explode!</message>		<prefix>-</prefix>		<postfix/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="200"/>		<hitKind>Absolute</hitKind>		<font>$TextFont</font>	  </combatScrollText>	  <contourIcon>		<tint amount="0"/>	  </contourIcon>	  <currentHealth>		<format size="11" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="60"/>		<maxValue enabled="true"/>	  </currentHealth>	  <healthBar>		<border size="1" color="0x000000" alpha="30"/>		<fill width="80" height="12" alpha="30"/>		<damage fade="1" alpha="80"/>	  </healthBar>	  <healthRatio>		<format size="11" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="60"/>	  </healthRatio>	  <playerName>		<format size="13" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="120"/>	  </playerName>	  <vehicleIcon>		<fill color="0xFF1D0C"/>		<scale maxScale="100" x="0" y="16"/>	  </vehicleIcon>	  <vehicleName>		<format size="13" align="center" font="$FieldFont"/>		<filter type="DropShadowFilter" size="1" angle="45" distance="1" color="0x000000" alpha="100" strength="120"/>	  </vehicleName>	</enemy>  </components>  <behavior>	<friend>	  <alive>		<normal>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="100" visible="false"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="true"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="true"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthBar x="-41" y="-34" alpha="100" visible="true"/>		  <teamTag x="-62" y="-36"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</normal>		<extended>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-55" alpha="100" visible="true"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="false"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="true"/>		  <healthBar x="-41" y="-34" alpha="100" visible="true"/>		  <teamTag x="-62" y="-36"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</extended>	  </alive>	  <dead>		<normal>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="100" visible="false"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="false"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthBar x="-41" y="-38" alpha="100" visible="false"/>		  <teamTag x="-8" y="-36"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</normal>		<extended>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="80" visible="true"/>		  <vehicleName x="-70" y="-55" alpha="80" visible="true"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>	 	 <healthBar x="-41" y="-34" alpha="100" visible="false"/>		  <teamTag x="-8" y="-36"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</extended>	  </dead>	</friend>	<enemy>	  <alive>		<normal>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="100" visible="false"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="true"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="true"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthBar x="-41" y="-34" alpha="100" visible="true"/>		  <teamTag x="-62" y="-34"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</normal>		<extended>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-55" alpha="100" visible="true"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="false"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="true"/>	 	 <healthBar x="-41" y="-34" alpha="100" visible="true"/>		  <teamTag x="-62" y="-34"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</extended>	  </alive>	  <dead>		<normal>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="100" visible="false"/>		  <vehicleName x="-70" y="-55" alpha="100" visible="false"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthBar x="-41" y="-34" alpha="100" visible="false"/>		  <teamTag x="-62" y="-34"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</normal>		<extended>		  <actionMarker x="0" y="-67"/>		  <combatScrollText x="0" y="-67"/>		  <playerName x="-70" y="-73" alpha="80" visible="true"/>		  <vehicleName x="-70" y="-55" alpha="80" visible="true"/>		  <currentHealth x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthRatio x="-41" y="-38" color="0xFFFFFF" alpha="100" visible="false"/>		  <healthBar x="-41" y="-34" alpha="100" visible="false"/>		  <teamTag x="-62" y="-34"/>		  <vehicleIcon x="0" y="-16" alpha="100" visible="true"/>		  <levelIcon x="0" y="-21" alpha="100" visible="false"/>		  <contourIcon x="6" y="-65" alpha="100" visible="false"/>		</extended>	  </dead>	</enemy>  </behavior></overTargetMarkers>

Link to comment
Share on other sites

This isn't an XML question. There must be some other software that's interprettingthis XML.You can't make games in XML, XML is just a data storage format and how the data is interpretted depends on the program you're using to interpret the data.

Link to comment
Share on other sites

It is an XML question. The XML code I provided was written by someone unrelated to the game. It provides additional information that was not a part of the original game, but an add on. I can further modify his code to fit my specifc needs. For instance, I can change variables such as font, font size, scroll time, colors, and the locations that this information appears within the game. I can even change the message from 'Explode!' to anything I desire. I'd like to get an image to pop instead of a text message, my question is how do I modify the code in order for me to do that. <combatScrollText> <enabled value="true"/> <speed value="2"/> <maxRange value="40"/> <textSize value="14"/> <message>Explode!</message> <prefix>-</prefix> <postfix/>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...