Spoiler:Code: Select all
ACTOR BasicImp 3001 { Health 100 Radius 20 Height 56 Mass 100 Speed 8 PainChance 200 Monster +FLOORCLIP +MISSILEMORE DamageFactor "Fire", 0 SeeSound "imp/sight" PainSound "imp/pain" DeathSound "imp/death" ActiveSound "imp/active" HitObituary "$OB_IMPHIT" Obituary "$OB_IMP" var int user_impmemory; States { Spawn: TROO AABBCCDD 3 { A_Wander; A_LookEx(0,0,1280,768,90,"Chase"); } Loop /*IdleWait: TROO BBCCBBCCBBCCBBCCEE 4 // { // A_LookEx(0,0,1280,768,90,"Chase"); // }*/ Chase: TROO AABBCCDD 3 A_Chase TNT1 A 0 A_CheckSight("Sightless") Loop Sightless: TNT1 A 0 A_SetUserVar("user_impmemory",180) TNT1 A 0 A_PlaySound("imp/pain") Hunt: TNT1 A 0 A_JumpIf(user_impmemory<=0,"Forget") TROO AABBCCDDAABB 2 A_Wander TNT1 A 0 A_SetUserVar("user_impmemory",user_impmemory-1) TNT1 A 0 A_JumpIf(user_impmemory<=0,"Forget") TROO CCDDAABBCCDD 2 A_Chase TNT1 A 0 A_SetUserVar("user_impmemory",user_impmemory-1) Loop Forget: TNT1 A 0 A_PlaySound("imp/death") TNT1 A 0 A_ClearTarget Goto Spawn Missile: TNT1 A 0 A_JumpIfInTargetLOS("CheckRange",90,0,2048,128) Goto LeapAdvance CheckRange: TROO E 8 A_FaceTarget TNT1 A 0 A_CheckLOF("Fireball",CLOFF_JUMPENEMY|CLOFF_CHECKPARTIAL,1024) Goto Chase Fireball: TROO E 8 A_FaceTarget TROO G 6 A_CustomMissile("DoomImpBall",32,0,0,CMF_OFFSETPITCH,5) Goto Chase LeapAdvance: TROJ CD 8 A_FaceTarget TNT1 A 0 ThrustThingZ(0,12,0,0) TROJ EEFF 4 A_SkullAttack(12) TROJ GH 8 A_CustomMeleeAttack((Random(1,10)+Random(1,10)),"imp/melee") Goto Chase Pain: TROO H 2 TROO H 2 A_Pain Goto Chase Death: TROO I 8 TROO J 8 A_Scream TROO K 6 TROO L 6 A_NoBlocking TROO M -1 Stop XDeath: TROO N 5 TROO O 5 A_XScream TROO P 5 TROO Q 5 A_NoBlocking TROO RST 5 TROO U -1 Stop Raise: TROO ML 8 TROO KJI 6 Goto Spawn } }
Help with script slowdowns
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 474
- Joined: Fri Jul 18, 2008 12:27 pm
Help with script slowdowns
I was experimenting with some custom AI for mobs and wound up with one of my profiles occasionally causing severe slowdowns. Most of the time, it works correctly. And I can't tell when the slowdowns are occurring. But it's only with actors that use this code as a base. Could someone help me diagnose it?
Spoiler: