Jump to content


Crates logic


6 replies to this topic

#1 Dutchygamer

    Shyborg Commander

  • Member Test
  • 1899 posts
  • Projects: Frontline Chaos creator and leader, Invasion Confirmed co-leader

Posted 21 June 2011 - 10:16

I've been fiddling around with crates, to see if I can use them for an idea I have. Currently, all units drop a crate, which is either cash, a level up, or very rarely reveals the whole map. The cash and reveal map work fine: unit collides with the crate, crate is removed, and effect is given. The level-up crate doesn't; it isn't removed when it collides with an unit, nor does it give the expected effect.
After testing with multiple settings, I still can't get those bastards to work. These are the codes I use:
; -----------------------------------------------------------------------------
Object VehicleWreckCrateLevelUp
       
&#59; *** ART Parameters ***
 
Draw = W3DModelDraw ModuleTag_01
       
DefaultConditionState
         
Model = PMJnkCrate
       
End
 
End

 
&#59; ***DESIGN parameters ***
 
EditorSorting   = MISC_MAN_MADE

 
&#59; *** ENGINEERING Parameters ***  
 
KindOf = PARACHUTABLE CRATE&#59;Only Salvage crates are marked Selectable so the Mouse can interact with them and give Salvage voices.  Being dead makes them not actually selectable
 
 
Behavior = VeterancyCrateCollide         ModuleTag_ForbiddenChanges
       
ForbiddenKindOf = PROJECTILE
       
EffectRange = 10
   
&#59;ExecuteFX = FX_CratePickup
       
ExecuteAnimation           = MoneyPickUp
       
ExecuteAnimationTime   = 4.0   &#59; In seconds
       
ExecuteAnimationZRise  = 15.0  &#59; Z world units per second to rise
       
ExecuteAnimationFades  = Yes   &#59; Animation does/doesn't fade out        
 
End

 
Behavior = DeletionUpdate ModuleTag_03&#59; Not LifetimeUpdate, since I can't die.  This will DestroyObject me.
       
MinLifetime = 30000  
       
MaxLifetime = 35000  
 
End

 
Geometry = BOX
 
GeometryMajorRadius = 12.0
 
GeometryMinorRadius = 12.0
 
GeometryHeight = 12.0  
 
GeometryIsSmall = Yes
 
Shadow                  = SHADOW_VOLUME
   
End

The VeterancyCrateCollide is the part that should give the level up. As you may see, I added an small animation when the crate is picked up. The results are rather... interesting: the anim keeps playing as long as an unit is colliding with the crate, until the unit moves away, or the crate is removed by DeletionUpdate.
I'm beginning to have the strange feeling that the VeterancyCrateCollide module is broken. Am I right on this?
Posted Image

#2 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 21 June 2011 - 10:45

GLA units can get veterancy with their crates. Maybe try it with that code (SalvageCrateCollide), but that might create other problems (Units would probably need the SALVAGER KindOf)
Posted Image

#3 Dutchygamer

    Shyborg Commander

  • Member Test
  • 1899 posts
  • Projects: Frontline Chaos creator and leader, Invasion Confirmed co-leader

Posted 21 June 2011 - 14:29

Already checked that: the SALVAGER part is in the crate code, and can be disabled. Unfortunately this gives the same result: unit collides with crate, and nothing happens. I may need to recheck that though, as I only tested this quickly.
Posted Image

#4 SorataZ

    Professional

  • Member
  • 347 posts
  • Projects: For the hunt I sharpen my claws.

Posted 22 June 2011 - 13:15

What if you just put in UNIT instead of SALVAGER? It should have the same effect. I think that Gens refuses to do anything with the crate if it is not specified what kind of object should collide with it, to prevent non-salvagers from getting a crate bonus.

#5 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 22 June 2011 - 16:19

try to make the crate starts as veteran maybe? |8

#6 Dutchygamer

    Shyborg Commander

  • Member Test
  • 1899 posts
  • Projects: Frontline Chaos creator and leader, Invasion Confirmed co-leader

Posted 22 June 2011 - 16:40

 SorataZ, on 22 Jun 2011, 14:15, said:

What if you just put in UNIT instead of SALVAGER? It should have the same effect. I think that Gens refuses to do anything with the crate if it is not specified what kind of object should collide with it, to prevent non-salvagers from getting a crate bonus.

Why do the cash and reveal map crates work fine then |8 Anyways, I'll try out what you suggested, but I doubt it will make any difference.
Posted Image

#7 Dutchygamer

    Shyborg Commander

  • Member Test
  • 1899 posts
  • Projects: Frontline Chaos creator and leader, Invasion Confirmed co-leader

Posted 23 June 2011 - 18:42

From what I saw you can only define which KindOf types will spawn a crate, and define which KindOfs are disallowed from picking up a crate. There is no way to say that a specific KindOf is allowed to pick up a crate from what I saw.
Posted Image



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users