View Full Version : interesting monster coding required.
Commando Nukem
10-28-2006, 01:00 AM
Hey all, me again. I need something for my current project. I need a monster (specifically I would like to retrofit this to the LIZMAN(Chaingun guy), because I would rather not have to code over a scratch creature.)
What I need is a monster that upon spawning will choose a random direction (or rather attempt to reach the player.) and anywhere from between 64 units to 512 units later, die and be moved back to the initial start point and do it again. It won't have any attacks, and shouldn't be something you can actually hurt. or rather if it is hurt it should continue the same series of events. The concept is to develop a sequence involving a rework of the rotguns that I have devised, the scene is supposed to make it appear as if the guns are holding off entire waves of enemies. The ROT guns do fire shot spark, and will indeed kill certain enemies. but the point is that because all they're actually doing is pointing on direction and firing (I removed the rotation function and the "ifplayerdead" function so that they would just keep firing to make the effect seem real, unfortunatly I didn't stop to realise that they will not EVER stop firing as long as the player is within the game space now. (They can't I removed the "wait" function too so that they did not pause inbetween bursts... Essentially making an ALIENS styled machinegun.)
If someone does not follow I can post a video to try and explain what I need done.
DeeperThought
10-28-2006, 01:48 AM
What I need is a monster that upon spawning will choose a random direction (or rather attempt to reach the player.) and anywhere from between 64 units to 512 units later, die and be moved back to the initial start point and do it again.
So the body will disappear from the ground, and then a live monster will suddenly appear again and start walking towards the player... Won't that look kind of lame? I guess you'd have the monsters starting in a place they can't be seen. But it wouldn't be that much harder to make the gun literally hold off waves of attackers. In fact, it might be easier -- just make the gun really powerful and track enemies, kind of like my auto turret that spawns from alt-pipebombs in my mods, but with a faster firing rate and unlimited ammo.
Commando Nukem
10-28-2006, 02:39 AM
So the body will disappear from the ground, and then a live monster will suddenly appear again and start walking towards the player... Won't that look kind of lame? I guess you'd have the monsters starting in a place they can't be seen. But it wouldn't be that much harder to make the gun literally hold off waves of attackers. In fact, it might be easier -- just make the gun really powerful and track enemies, kind of like my auto turret that spawns from alt-pipebombs in my mods, but with a faster firing rate and unlimited ammo.
Well I decided to scrap the basic idea, because I do actually have the NEWBEAST charging at the turrents, and they do get their butts kicked. What im really going for is just to keep the action continuious. I know eduke supports targetting certain enemies, but I really couldn't figure it out from what eduke wiki told me. Im not much of a code person.
http://www.youtube.com/watch?v=zPSsp6aqi5o This video shows exactly why. The number of enemies starting in the little test map is 70. They are all killed before I step out. When I step out the "Eggs" off in the distance (which I have altered the code of so that ifspritepal 4, they will use an alternate attack that will cause them to spawn pigcops (which look like green aliens(stillworking on their sprite work.)), and it is supposed to spawn them contiously. Problem is, is it spawns too many. literally it would be up to about 3000 in a matter of minutes. If not more. How would I establish a delay?
Heres the egg code as I have edited it.:D
action EGGOPEN1 1 1 1 1 4
action EGGOPEN2 2 1 1 1 4
action EGGOPEN3 2 1 1 1 4
action EGGWAIT 0
action EGGFROZEN 1
action EGGGROW 1
action EGGSHRUNK 1
actor EGG TOUGH
fall
ifaction 0
{
ifcount 64
{
ifrnd 128
{
action EGGWAIT
move 0
}
else
{
sound SLIM_HATCH
action EGGOPEN1
}
}
}
else
ifaction EGGOPEN1
ifactioncount 4
action EGGOPEN2
else
ifaction EGGOPEN2
ifactioncount 4
{
spawn NEWBEAST
action EGGWAIT
}
else
ifaction EGGOPEN1
ifactioncount 4
action EGGOPEN2
ifspritepal 4
{
spawn PIGCOP
action EGGOPEN1
count 1
}
else
ifaction EGGOPEN2
ifactioncount 4
else
ifaction EGGGROW
state genericgrowcode
else
ifaction EGGSHRUNK
state genericshrunkcode
else
ifaction EGGFROZEN
{
ifcount THAWTIME
{
action 0
getlastpal
}
else
ifcount FROZENDRIPTIME
{
ifactioncount 26
{
spawn WATERDRIP
resetactioncount
}
}
ifhitweapon
{
ifwasweapon FREEZEBLAST
{
strength 0
break
}
lotsofglass 30
sound GLASS_BREAKING
ifrnd 84
spawn BLOODPOOL
addkills 1
killit
}
// ifp pducking
ifp pfacing
ifpdistl FROZENQUICKKICKDIST
pkick
break
}
ifhitweapon
{
ifdead
{
ifwasweapon FREEZEBLAST
{
sound SOMETHINGFROZE
spritepal 1
move 0
action EGGFROZEN
strength 0
break
}
else
ifwasweapon GROWSPARK
{
cstat 0
move 0
sound ACTOR_GROWING
action EGGGROW
break
}
addkills 1
sound SQUISHED
state standard_jibs
killit
}
else
ifwasweapon SHRINKSPARK
{
move 0
sound ACTOR_SHRINKING
action EGGSHRUNK
break
}
ifwasweapon GROWSPARK
sound EXPANDERHIT
}
else
ifaction EGGWAIT
{
ifcount 512
ifrnd 2
{
ifaction EGGSHRUNK
break
sound SLIM_HATCH
action EGGOPEN1
}
}
enda
DeeperThought
10-28-2006, 09:39 AM
It looks pretty messed up. Where you put "ifspritepal 4", it's indented, but it's not actually dependant on any conditions, so that code is just executing all the time. Not only that, but's screwing with the else condition under it, because now that else depends on the ifspritepal 4 condition. Indenting is just formatting -- it doesn't effect the way the code is executed. You should have the NEWBEAST and PIGCOP spawning code in the same block:
{
ifspritepal 4 spawn PIGCOP
else spawn NEWBEAST
action EGGWAIT
}
Commando Nukem
10-28-2006, 10:37 AM
It looks pretty messed up. Where you put "ifspritepal 4", it's indented, but it's not actually dependant on any conditions, so that code is just executing all the time. Not only that, but's screwing with the else condition under it, because now that else depends on the ifspritepal 4 condition. Indenting is just formatting -- it doesn't effect the way the code is executed. You should have the NEWBEAST and PIGCOP spawning code in the same block:
{
ifspritepal 4 spawn PIGCOP
else spawn NEWBEAST
action EGGWAIT
}
See? I guess it is true you learn something new everyday. Thanks for your assitance. I = Noob to conning. That helps me understand con a little better, I had no idea two things could be on one line like that.
DeeperThought
10-28-2006, 11:01 AM
It won't make any difference whether commands are on the same line or not. Again, that's just formatting. Where you put the brackets, on the other hand, makes all the difference.
vBulletin® v3.8.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.