Hammerwatch Forum

Custom mapping and Mods => Editor Discussion => Topic started by: KptnKook on August 20, 2013, 04:47:33 PM

Title: Hide spawnedobjects :o
Post by: KptnKook on August 20, 2013, 04:47:33 PM
So, the hide function won't work on the spawnobjects script.

i need a spawned wall, which immediately gets invisible and blocks the path with its collision.
how can i hide spawned objects afterwards?

greats
Title: Re: Hide spawnedobjects :o
Post by: Juschlan on August 20, 2013, 07:35:51 PM
Isn't there a "hide object" script? That should do exactly what you want: an invisible wall
Title: Re: Hide spawnedobjects :o
Post by: KptnKook on August 20, 2013, 09:31:09 PM
when the object gets spawned by the script whilst the game and not prior, then i can't link to it, since the only relation i have to it is the script, which is not compatible with hideobject script, which only connects to objects as its name says.


its not about spawning invisible walls. its about a spawned object from a spawnscript, which i dont know how to manipulate, since it's not there yet.

greets
Title: Re: Hide spawnedobjects :o
Post by: KptnKook on August 20, 2013, 09:36:44 PM
 ;) anyway,i now have made a new asset, which is basically a hitable square. i tried to copy the script of the .xml of a basic destructible wall and changed the coordinates accordingly.

i don't know what i did wrong, but the area is not hitable, like it's supposed to be, since it is the same script like the destructible_dst_wall. the script of my square looks like this:

Quote

<doodad aobias="0.4" minimap="menus/minimap.xml:h_8" defaultlayer="25">
   <sprite scale="16">
   <texture>effects/mod_effects.png</texture>
   <origin>8 8</origin>
   <frame>16 0 16 16</frame>
   </sprite>
      
   <polygon collision="false" shadow="false">
   <point>20 0</point>
   <point>30 0</point>
   <point>20 10</point>
   <point>30 10</point>
   </polygon>         
      
   <polygon collision="false" shadow="false">
      <point>20 0</point>
      <point>30 0</point>
      <point>20 10</point>
      <point>30 10</point>
   </polygon>      
   
   <polygon collision="false" shadow="false">
      <point>20 0</point>
      <point>30 0</point>
      <point>20 10</point>
      <point>30 10</point>
   </polygon>         

</doodad>

did i miss anything? how can i get this square hitable, so that i can trigger it?

thanks
Title: Re: Hide spawnedobjects :o
Post by: Myran on August 21, 2013, 04:21:08 PM
For the first thing that's actually possible, if you connect a HideObject so it runs right after the SpawnObject and then when you are in the mode where you pick an object to hide you can right click the SpawnObject and pick Last spawned.
For an object to be hitable it needs collision, so you need to set collision to true for your polygon.
Title: Re: Hide spawnedobjects :o
Post by: KptnKook on August 21, 2013, 04:38:10 PM
 8) ::) great! thank you so much.
Title: Re: Hide spawnedobjects :o
Post by: Linaru on August 24, 2013, 12:18:28 PM
So, the hide function won't work on the spawnobjects script.

i need a spawned wall, which immediately gets invisible and blocks the path with its collision.
how can i hide spawned objects afterwards?

greats

why not just use a hide object and toggle physics script together to turn the wall on and off?
Title: Re: Hide spawnedobjects :o
Post by: KptnKook on August 25, 2013, 09:30:42 PM
i dont know all the scripts. now i know, thank you for the hint!