zero hour mad map maker
9 years ago
Well after quite the bit of research, I am still having some troubles. Though I do believe I am getting a lot closer!! 😄



Object SupW_AmericaPatriotBattery

  
    AddModule
    Behavior = StealthUpdate ModuleTag_07
    StealthDelay                = 2000 ; msec
    StealthForbiddenConditions  = FIRING_PRIMARY
    HintDetectableConditions    = IS_FIRING_WEAPON 
    FriendlyOpacityMin          = 50.0%
    FriendlyOpacityMax          = 100.0%
    InnateStealth               = Yes
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
    
    End


Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
klingondragon
9 years ago
You need to end the object, the addmodule, and the module itself (that's 3 ends), it also helps if you indent your code so that lines which open and end are on the same level and everything inside is indented (usually by two presses of the spacebar).
Also (I'm not certain so let me check) I think your addmodule might need to specify a module tag (don't hold me to that, I don't usually deal with map.inis so add, modify, and remove module tags are still a bit new)
zero hour mad map maker
9 years ago

You need to end the object, the addmodule, and the module itself (that's 3 ends), it also helps if you indent your code so that lines which open and end are on the same level and everything inside is indented (usually by two presses of the spacebar).
Also (I'm not certain so let me check) I think your addmodule might need to specify a module tag (don't hold me to that, I don't usually deal with map.inis so add, modify, and remove module tags are still a bit new)

Originally Posted by: klingondragon 



DANG! Now it crashes the game LOL! You did say to put an end after Addmodule and after the object right? 😪


Object SupW_AmericaPatriotBattery
End
  
    AddModule
	End
    		Behavior = StealthUpdate ModuleTag_07
    		StealthDelay                = 2000 ; msec
    		StealthForbiddenConditions  = FIRING_PRIMARY
    		HintDetectableConditions    = IS_FIRING_WEAPON 
    		FriendlyOpacityMin          = 50.0%
    		FriendlyOpacityMax          = 100.0%
    		InnateStealth               = Yes
   		 OrderIdleEnemiesToAttackMeUponReveal  = Yes
    
    					End

Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
Annihilationzh
9 years ago

DANG! Now it crashes the game LOL! You did say to put an end after Addmodule and after the object right? 😪

Originally Posted by: Zero Hour Mad Map Maker 



This code that tells the game you want to deal with the EMP Patriot, and then immediately stop doing so.
Object SupW_AmericaPatriotBattery
End

This code tell the game to add modules, and then immediately stop adding modules.
AddModule
End

And then when the game sees this line:
Behavior = StealthUpdate ModuleTag_07
The game will crash. You're specifying a module, but you haven't told it which unit you're changing or what to do with the module.

Also, don't use tabs in code. It'll crash the game.

See this:
Object SupW_AmericaPatriotBattery
 AddModule
  Behavior = StealthUpdate ModuleTag_07
   StealthDelay                = 2000 ; msec 
   StealthForbiddenConditions  = FIRING_PRIMARY
   HintDetectableConditions    = IS_FIRING_WEAPON 
   FriendlyOpacityMin          = 50.0%
   FriendlyOpacityMax          = 100.0%
   InnateStealth               = Yes
   OrderIdleEnemiesToAttackMeUponReveal  = Yes
  End
 End
End
The first line tells the game to edit the EMP patriot, and the last line tells it to stop editing the EMP patriot. The second line adds modules, the second to last line tells the game to stop adding modules.

I made the code neater and easier to read by indenting each line to show where things start and finish. This is quite normal in programming.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
klingondragon
9 years ago
Although, unlike most languages, you shouldn't use tab, use 2 spaces for the indentation.
zero hour mad map maker
9 years ago
Wow okay! Thank you both! Sorry for my novice skills! I'm slow at first to learn a new language, though once I do I'll surely become proficient at it! Like I said many times in the past, I know how to do XML, HTML, DAT, C#, BASIC, and some other crap! Just not Zh....... lol. Alright, well that's all I think I want to know how to do for now.


Do any other members have a request to Klingon Dragon?
Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
zero hour mad map maker
9 years ago
Hey guys! A slight problem came up! I am super glad that the stealth actually works! YAY! Now the EMP turrets are stealthed. Though they do not become unstealthed and do not attack when any of my troops are near them? They are on the enemy team so that's fine. I even tried to correct it with this script, but nothing. Dumb thing....


*** IF ***
Unit 'EP3' sees a(n) Enemy unit belonging to Player 'ThePlayer'.
*** THEN ***
Set Unit 'EP3' stealth ability to FALSE.
Unit 'EP3' attacks Team 'teamThePlayer'
*** ELSE ***
Set Unit 'EP3' stealth ability to TRUE.
Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
zero hour mad map maker
9 years ago
Anyone know why?
Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
Annihilationzh
9 years ago

Anyone know why?

Originally Posted by: Zero Hour Mad Map Maker 


The AI needs changing, so that it will attack whilst stealthed. I completely forgot about that earlier.

I wasn't sure what kind of stealth you wanted so I didn't mention that your choice of module was overpowered; it wouldn't have revealed itself even if you attack it.

Here's a fixed one (assuming I haven't forgotten anything else):
Object SupW_AmericaPatriotBattery
 RemoveModule ModuleTag_07
 AddModule
  Behavior = StealthUpdate ModuleTag_17
    StealthDelay                = 2500 ; msec
    StealthForbiddenConditions  = ATTACKING USING_ABILITY TAKING_DAMAGE
    InnateStealth               = Yes ;Require the upgrade first
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
  End
  Behavior = AIUpdateInterface ModuleTag_07
    Turret
      TurretTurnRate        = 180   // turn rate, in degrees per sec
      TurretPitchRate       = 180
      AllowsPitch           = Yes
      NaturalTurretPitch    = 45   
      GroundUnitPitch       = 40
      MinPhysicalPitch      = -20
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
      MinIdleScanInterval   = 250    ; in milliseconds
      MaxIdleScanInterval   = 250    ; in milliseconds
      MinIdleScanAngle      = 0       ; in degrees off the natural turret angle
      MaxIdleScanAngle      = 360     ; in degrees off the natural turret angle
    End

    AutoAcquireEnemiesWhenIdle = Yes Stealthed ;ATTACK_BUILDINGS; defensive weapon
    MoodAttackCheckRate        = 250
  End
 End
End

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
zero hour mad map maker
9 years ago
Annihilationzh you're a genius! Thank you very much!
Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator