Page 1 of 1
Monster get faster when player is seen
Posted: Sat Aug 24, 2013 11:04 am
by Lollipop
Hi, title should say all, but I will explain further, in point to make easier to read:
1.The monster got speed x normally.
2. When it sees the player or is set into painstate, it's speed get set to 4x.
3. When it kills the player, it's speed it once again set to x.
I have tried to mess around with a bit of this and a bit of that, but I can only seem to make the monster jet all over the map :\
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 12:27 pm
by CloudFlash
Give it a speed boosting powerup? Thats how creeper in gvh was done, so I think it should work.
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 12:33 pm
by Cruduxy
http://zdoom.org/wiki/A_CheckSight
If the tic with A_Chase is very low value this seems to make actors faster on the same speed setting than with higher tics.. Figure it out yourself now
And before complaining about this making actor shoot like crazy remember there is other chase functions that disable missile/melee and will help getting a more advanced behaviour
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 12:47 pm
by Lollipop
Cloud Flash: I tried using a powerup, but it seem to have no effect on non-player actors.
Cruduxy: I think I tried that. Also, the way I made it fly was with A_changevelocity, which made it go from one end of map to another, as I tried to make it able turn at least 90 degrees to hunt the player, by calling the function many times :\
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 12:51 pm
by Cruduxy
// TNT1 A 0 A_JumpIf( Z + height + 100 >= CeilingZ, "See")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_ChangeFlag("DROPOFF",1)
TNT1 A 0 A_ChangeFlag("FLOAT",1)
Goto Fly // Use with inventory and jump states and you can have a monster that can alternate flying/ground chasing
Edit : Is what you are asking for the same thing in first post? It seems to me you are trying to make actor fly and not change chase speed.
Edit 2 : Or inherit from d'sparil's good ol' serpent that has a native function to walk faster.
http://zdoom.org/wiki/Classes:Sorcerer1
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 1:13 pm
by Lollipop
What I ask for is the same as in the first post, but that is now working. It worked with a_chase.
But now I got another problem, so I might as well ask here about it:
My actor use a melee attack, and it is supposed to only attack if it's so close that the player can't escape the attack, but I can't seem to make it do that.
I tried using a combination like this:
meleerange 128
maxtargetrange 64
It seems that maxtargetrange only affects millise attacks, which is not what I am looking for.
Any ideas on how I can make my monster behave?
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 1:14 pm
by Cruduxy
RE: Monster get faster when player is seen
Posted: Sat Aug 24, 2013 1:28 pm
by Lollipop
Thank you, I got it working by doing this:
I made it check if player was closer than 64, but it's range was 128 causing it to get stuck when player is out of range, as it just looped.
I made it thrust forward if it was out of range, so it would get thrown into the players face and hit him hard, as it is in range of the player(works like 90% of the time, enough).
Thank you very much for your help.