Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline SkyMix_RMT  
#1 Posted : Friday, April 29, 2016 2:52:55 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
I want to have units from angry mob already start with AK47 and be individual units, like a rebel, and not all make part of a group, so I made this piece of code, but it makes the map crash everyime I try to play on it, I haven't found anything wrong with the code, can you help?
Thanks!

Code:

Object GLAInfantryAngryMobPistol01

;**** ART Parameters ***
 ReplaceModule ModuleTag_01
  Draw = W3DModelDraw ModuleTag_01_Override

    OkToChangeModelColor = Yes

    IgnoreConditionStates = PREATTACK_A FIRING_A BETWEEN_FIRING_SHOTS_A RELOADING_A
    ; "WHILE" (Default) CARRYING AK47 
    ;---------------------------------------------------------
    DefaultConditionState ;Idle with AK Slung
      Model = UIMOB01_SKN
      IdleAnimation = UIMOB01_SKL.UIMOB01_IDD1 0 6
      IdleAnimation = UIMOB01_SKL.UIMOB01_IDD2 0 6
      IdleAnimation = UIMOB01_SKL.UIMOB01_CHD  0 6
      IdleAnimation = UIMOB01_SKL.UIMOB01_STD
      AnimationMode = ONCE
      AnimationSpeedFactorRange 0.9 1.1
      TransitionKey = TRANS_STAND_AK
    End

    ConditionState = MOVING
      Animation = UIMOB01_SKL.UIMOB01_RND 
      AnimationMode = LOOP
      Flags = RANDOMSTART
      TransitionKey   = MOVING_AK
    End

    ConditionState = DYING
      Animation = UIMOB01_SKL.UIMOB01_DD1    
      Animation = UIMOB01_SKL.UIMOB01_DD2
      AnimationMode = ONCE
      TransitionKey = TRANS_Dying
    End

    ConditionState = SPECIAL
      Animation = UIMOB01_SKL.UIMOB01_CHD
      AnimationMode = ONCE
    End

    ; Drawing AK47
    ConditionState  = PREATTACK_B
      Animation     = UIMOB01_SKL.UIMOB01_ATD1_ST ; start firing
      AnimationMode = ONCE
    End
    AliasConditionState = PREATTACK_B FIRING_B
    AliasConditionState = PREATTACK_B BETWEEN_FIRING_SHOTS_B

    ; Firing Gun
    ConditionState = FIRING_B
      Animation = UIMOB01_SKL.UIMOB01_ATD1_LP ; looping firing
      AnimationMode = LOOP
      WeaponFireFXBone = SECONDARY MuzzleAK
      WeaponMuzzleFlash = SECONDARY MuzzleAKFX
      TransitionKey = TRANS_FIRING_AK
    End
    AliasConditionState  = BETWEEN_FIRING_SHOTS_B


    ConditionState  = RELOADING_B
      Animation     = UIMOB01_SKL.UIMOB01_ATD1_ED ; end firing
      AnimationMode = ONCE
    End


    ; This transition allows him to put his gun away when he's finished attacking.
    TransitionState = TRANS_FIRING_AK TRANS_STAND_AK
      Animation     = UIMOB01_SKL.UIMOB01_ATD1_ED ; end firing
      AnimationMode = ONCE
    End

;    ;Throwing bottle----------------------------------------------------------------
;    ConditionState = PREATTACK_C 
;      Animation     = UIMOB01_SKL.UIMOB01_ATCA_BF ; the wind up
;    End
;    AliasConditionState = PREATTACK_C FIRING_A
;    AliasConditionState = PREATTACK_C RELOADING_A
;    AliasConditionState = PREATTACK_C BETWEEN_FIRING_SHOTS_A 
;
;    ConditionState = FIRING_C 
;      Animation     = UIMOB01_SKL.UIMOB01_ATCA_AF ; the release and follow-thru
;      TransitionKey = TRANS_THROW
;    End
;    AliasConditionState = FIRING_C BETWEEN_FIRING_SHOTS_A
;
;    ConditionState RELOADING_C
;      Animation =UIMOB01_SKL.UIMOB01_IDA1
;      WaitForStateToFinishIfPossible = TRANS_THROW ; universal hub for follow-thru
;    End
;    AliasConditionState = RELOADING_C RELOADING_A
;    AliasConditionState = RELOADING_C FIRING_A
;    AliasConditionState = RELOADING_C BETWEEN_FIRING_SHOTS_A


;    TransitionState = TRANSXXX TRANS_THROW
;      Animation     = UIMOB01_SKL.UIMOB01_XXXXXXXXputaway gun and take out bottle
;    End

;    TransitionState = TRANS_THROW TRANS_FIRING_A
;      Animation     = UIMOB01_SKL.UIMOB01_XXXXXXXXputaway bottle and get PISTOL
;    End

;    TransitionState = TRANSXXXAK TRANS_THROW
;      Animation     = UIMOB01_SKL.UIMOB01_XXXXXXXXputaway AK and take out bottle
;    End

;    TransitionState = TRANS_THROW TRANS_FIRING_AK
;      Animation     = UIMOB01_SKL.UIMOB01_XXXXXXXXputaway bottle and get AK
;    End

    ;--------------------------------------------------------

    TransitionState = TRANS_Dying TRANS_Flailing
      Animation = UIMOB01_SKL.UIMOB01_A_ADTE1
      Animation = UIMOB01_SKL.UIMOB01_D_ADTE1
      AnimationMode = ONCE
    End

    ConditionState = DYING EXPLODED_FLAILING
      Animation = UIMOB01_SKL.UIMOB01_A_ADTE2
      Animation = UIMOB01_SKL.UIMOB01_D_ADTE2
      AnimationMode = LOOP
      TransitionKey = TRANS_Flailing
    End

    ConditionState = DYING EXPLODED_BOUNCING
      Animation = UIMOB01_SKL.UIMOB01_A_ADTE3
      Animation = UIMOB01_SKL.UIMOB01_D_ADTE3
      AnimationMode = ONCE
      TransitionKey = None
    End
  End

;**** DESIGN parameters ***

  DisplayName      = OBJECT:AngryMob
  Side = GLA
  EditorSorting = INFANTRY
  TransportSlotCount = 1                 ;how many "slots" we take in a transport (0 == not transportable)

  WeaponSet
    Conditions = None
    Weapon = PRIMARY GLAAngryMobAK47NoDamageWeapon ; for atttacking in AK-proof conditions
    Weapon = SECONDARY GLAAngryMobAK47Weapon
  End

  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End

  VisionRange = 150
  ShroudClearingRange = 150
  Prerequisites
    Object = GLABarracks
  End
  BuildCost = 100
  BuildTime = 0.0           

  ExperienceValue = 5 5 5 5    ;Experience point value at each level
  ExperienceRequired = 0 150 450 900  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrushableLevel         = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles

  ; *** AUDIO Parameters ***
  VoiceSelect = AngryMobVoiceSelect
  VoiceMove = AngryMobVoiceMove
  VoiceGuard = AngryMobVoiceMove
  VoiceAttack = AngryMobVoiceAttack
  
;**** ENGINEERING Parameters *** ;MOB01
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY SALVAGER

 ReplaceModule BodyTag_01
  Body = ActiveBody BodyTag_01_Override
    MaxHealth       = 50.0
    InitialHealth   = 50.0
  End
 End

 ReplaceModule ModuleTag_03
  Behavior = AIUpdateInterface ModuleTag_03_Override
    AutoAcquireEnemiesWhenIdle = Yes
  End
 End

 RemoveModule ModuleTag_04
 End

  Locomotor = SET_NORMAL AngryMobNormalLocomotor
  Locomotor = SET_WANDER AngryMobWanderLocomotor
  Locomotor = SET_PANIC AngryMobPanicLocomotor

 ReplaceModule BehaviorTag_01
  Behavior = PhysicsBehavior BehaviorTag_01_Override
    Mass = 5.0
  End
 End
End
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Sponsor
Offline Gameanater  
#2 Posted : Friday, April 29, 2016 6:45:08 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
It would be much easier to start off with an actual Rebel and work from there, replacing Art code and weaponry as needed. Trust me, I've learned this the hard way.



"Always mod the unit closest in function, not in appearance, to what you want.
For example, if you want to convert an A10 Thunderbolt into a controllable unit, start with a Raptor."
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline SkyMix_RMT  
#3 Posted : Friday, April 29, 2016 7:14:47 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
Yes of course! Why didn't I think of that? I did that to transform the biohazardtech to a minigun carrying guy!
I'll try to do that.
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Offline Gameanater  
#4 Posted : Friday, April 29, 2016 7:19:06 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
Originally Posted by: SkyMix_RMT Go to Quoted Post
Yes of course! Why didn't I think of that? I did that to transform the biohazardtech to a minigun carrying guy!
I'll try to do that.


Mkay. :b


Wait, that was a map.ini though, right?
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline SkyMix_RMT  
#5 Posted : Friday, April 29, 2016 7:26:43 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
What do you mean?
The coding above belongs to a map.ini, if that's what you meant.
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Offline Gameanater  
#6 Posted : Friday, April 29, 2016 7:28:44 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
Oh whoops. I somehow missed that fact.

Anyway, I'm not a versatile in map.ini'ing, but it'd be worth a try to mod a Rebel instead.
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline SkyMix_RMT  
#7 Posted : Friday, April 29, 2016 7:32:20 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
Yeah i'm working on it right now.
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Offline Gameanater  
#8 Posted : Friday, April 29, 2016 7:38:38 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
'Kay. Let me know how it goes.


BTW, may I use your Epic Biohazard Tech Guy in my demo map for my mod?
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline SkyMix_RMT  
#9 Posted : Friday, April 29, 2016 7:42:41 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
Ok I tried to use a rebel preset and replace the models and weapons, but I still got a crash haha.
And yes you may use it freely and change it as you like i'm absolutely fine with it!

Edit~: Ok this is weird now, I still get a crash even without the code :S

Edited by user Friday, April 29, 2016 7:45:10 PM(UTC)  | Reason: Not specified

Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Offline Gameanater  
#10 Posted : Friday, April 29, 2016 7:44:22 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
Well darn, that's a bummer. D:


Lol thanks!
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline Annihilationzh  
#11 Posted : Friday, April 29, 2016 9:40:31 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Originally Posted by: SkyMix_RMT Go to Quoted Post
Ok this is weird now, I still get a crash even without the code :S

That's a pain in the butt. I hope for your sake you won't have to filter through a lot of code to find the error.

Originally Posted by: Gameanater Go to Quoted Post
"Always mod the unit closest in function, not in appearance, to what you want.
For example, if you want to convert an A10 Thunderbolt into a controllable unit, start with a Raptor."

Well that's one fancy way to quote someone.

Originally Posted by: Gameanater Go to Quoted Post
Oh whoops. I somehow missed that fact.

You absolutely deserve to be teased for that. :P
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.
thanks 1 user thanked Annihilationzh for this useful post.
Gameanater on 4/30/2016(UTC)
Offline SkyMix_RMT  
#12 Posted : Saturday, April 30, 2016 6:07:34 AM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
I fixed it.
For some stupid reason, command & conquer does not like when I edit the map.ini using notepad, everytime I use notepad to change a bit of code like the damage of a weapon the map.ini stops working and it will always make the game crash even if I remove most of the code.
Fortunately, I always have a working backup of the map.ini.
So I used notpad+ to change the exact same code I did before with notepad, and it worked.
So yeah, no more notepad!

Still, I have the same problem, the code from the original topic still makes the game crash, and still I don't know why.
When I remove it with notepad+ it works, so the problem is from that code.

EDIT:
I replaced the code with this one:

Code:

Object GLAInfantryAngryMobPistol01

  VoiceSelect = AngryMobVoiceSelect
  VoiceMove = AngryMobVoiceMove
  VoiceGuard = AngryMobVoiceMove
  VoiceAttack = AngryMobVoiceAttack

  RemoveModule ModuleTag_04
End


It works, the unit doesn't die like it would normally do, it's selectable and moveable, it can shoot stuff. But it doesn't have a health bar, or a GUI, and also makes no sound when selected or ordered to move, don't know why.

Yet another EDIT:
Adding this to the code fixes the Health bar, GUI, and sounds problem.

KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY SALVAGER

Edited by user Saturday, April 30, 2016 7:14:15 AM(UTC)  | Reason: Not specified

Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.