i want when the main body attacks or receives damage for the appendage to also go into a counterpart state.
i tried repurposing the inventory code from this hat setup from yikes two years ago but here it seems to be going entirely unnoticed.
can you see anything glaringly off with the anonymous function that i keep trying to use?
![Image]()
i earlier had working a set of tail appendages for a_chasing (attacking and pain probably just need one since they are more upright; in this revised plan the middle ones go invisible when not needed) that are created when movement starts and removed when movement stops. That is substantially simpler to set up and suits me, for the time being, but i can imagine in the future wanting to make a destroyable appendage, and so having it be recreated fresh every time the body enters a different state would not work with that.
i tried repurposing the inventory code from this hat setup from yikes two years ago but here it seems to be going entirely unnoticed.
can you see anything glaringly off with the anonymous function that i keep trying to use?
Code:
actor lerdappendage{scale .1radius 4height 8+FLOORCLIP-solidstates{spawn:lrct c 0 nodelay {A_SetInventory ("attack", 0);A_SetInventory ("pain", 0);}goto spunspun:lret aabbccdd 3 {if (Checkinventory("move", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("look"); } }//{//A_Warp(AAPTR_master, -24, 0, 0, 0, WARPF_NOCHECKPOSITION);//A_JumpIfInventory("move", 1, "look");//obviously THIS doesn't worklooplook:lrct abcdefgh 3 {if (Checkinventory("dosomethinger", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("whatnext"); } }whatnext:lrtt a 0 A_SetInventory ("dosomethinger", 0)fnyp a 0 A_JumpIfInventory("attack", 1, "attacking") fnyp a 0 A_JumpIfInventory("attack", 2, "energing") fnyp a 0 A_JumpIfInventory("pain", 1, "paining1") fnyp a 0 A_JumpIfInventory("pain", 2, "paining2") lrtt a 8 //11-5-2024 the game got struck in an apparent infinite loop before i added this 8 frame nonsense since none of the inventory checks were finding anything, but it shouldn't be possible to get here without being given inventoryattacking:lrtt abcdefghijkl 3 {if (Checkinventory("dosomethinger", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("whatnext"); } } goto spawnenerging:lret abcd 3 {if (Checkinventory("dosomethinger", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("whatnext"); } }looppaining1:lrpt a 0 A_SetInventory ("pain", 0)lrpt aaabbbcccccc 1 {if (Checkinventory("dosomethinger", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("whatnext"); } }goto spawnpaining2:lrpt a 0 A_SetInventory ("pain", 0)lrpt cccbbbaaaaaa 1{if (Checkinventory("dosomethinger", 0)){ A_Warp(AAPTR_master, -12, 0, 0, 0, WARPF_NOCHECKPOSITION);return state(0);} else { return state ("whatnext"); } }goto spawn}}actor dosomethinger : custominventory{//does it actually need anything defined?radius 1height 1}actor attack : dosomethinger{}actor pain : dosomethinger{}actor move : dosomethinger{}ACTOR Lerd 6006{spawnid 174bloodcolor 00a000seesound "skeleton/sight"activesound "skeleton/active"painsound "skeleton/pain"deathsound "skeleton/death"attacksound "skeleton/attack"translation "lerd1" Health 200 Radius 20 Height 56 Mass 500 Speed 6 Scale .1 Painchance 80 MONSTER+floorclip Obituary "%o got beat" Missileheight 30 Missiletype lerdshot2 States{ Spawn: LRcl a 0 nodelay {A_SpawnItemEx ("lerdappendage", 0, 0, 0, 0, 0, 0, 0,SXF_SETMASTER);A_SpawnItemEx ("lerdmiddleappendage1", -1, 0, 0, 0, 0, 0, 0,SXF_SETMASTER);//A_SpawnItemEx ("lerdmiddleappendage2", -2, 0, 0, 0, 0, 0, 0,SXF_SETMASTER);} //LRjp a 10 A_Look Lrat abcb 8 A_Look goto spawn+1 See: lrcl a 0 { A_GiveToChildren("move", 1);} saw: LRcl Abcdefgh 3 A_Chase loop Missile: lrcl a 0 { A_GiveToChildren("dosomethinger", 1);A_GiveToChildren("attack", 1);} //{A_RemoveChildren (true, RMVF_MISC,"lerdappendage"); //A_RemoveChildren (true, RMVF_MISC,"lerdmiddleappendage1"); //A_RemoveChildren (true, RMVF_MISC,"lerdmiddleappendage2");} Lrat abc 3 A_FaceTarget Lrat defgh 3 BRIGHT A_FaceTarget Lrat i 1 BRIGHT A_CustomMissile ("lerdshot2", 30, 0, 0) Lrat i 1 BRIGHT A_CustomMissile ("lerdshot3", 30, 0, 0) Lrat i 1 BRIGHT A_CustomMissile ("lerdshot4", 30, 0, 0) Lrat jk 3 Lrat l 3 A_SpawnItemEx ("lerdattackbit", Random (0, 1), 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION) GoTo See Pain: ectr A 0 A_Jump(256, "pain1", "pain2") pain1: lrcl a 0 { A_GiveToChildren("dosomethinger", 1);A_GiveToChildren("pain", 1);} lrpa abc 3 lrpa c 3 A_Pain GoTo See pain2: lrcl a 0 { A_GiveToChildren("dosomethinger", 1);A_GiveToChildren("pain", 2);} lrpa cba 3 lrpa a 3 A_Pain goto saw //////there is a bunch of old melee and death code from when it was a single piece monster with differently named frames beyond this point since I have not finished implementing them all

i earlier had working a set of tail appendages for a_chasing (attacking and pain probably just need one since they are more upright; in this revised plan the middle ones go invisible when not needed) that are created when movement starts and removed when movement stops. That is substantially simpler to set up and suits me, for the time being, but i can imagine in the future wanting to make a destroyable appendage, and so having it be recreated fresh every time the body enters a different state would not work with that.
Statistics: Posted by bimshwel — Tue Nov 05, 2024 2:36 am