Page 1 of 1

[FINAL] friendly stalker creature -solved-

Posted: Thu Mar 21, 2019 11:32 pm
by jstnjc2123
this is how to create a friendly stalker creature.
I'm going to use the monster drone from realm667 for this example.
knowing inheritance is key here
[zdwiki]https://zdoom.org/wiki/Using_inheritance[/zdwiki]
it allows you to modify the monsters code without touching the decorate directly

now Lets create a new actor and name it ally
Spoiler: (Open)
actor ally : drone
{
}
now let's give it some actor flags
[zdwiki]https://zdoom.org/wiki/Actor_flags[/zdwiki]
let's give it Quicktoretaliate and lookallaround and the ability to fly
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
}
.

now we need to assign a tid to the creature it has to be done in the creatures spawn state
[zdwiki]https://zdoom.org/wiki/Thing_ChangeTID[/zdwiki]
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
loop
}
}
now we need it to look for tids to hunt we can do that by jumping it will look something like this
[zdwiki]https://zdoom.org/wiki/A_Jump[/zdwiki]
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
tnt1 a 0 a_jump(256,"see2")
loop
}
}
since we created a new state to jump to we haft to make a new state like so
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
tnt1 a 0 a_jump(256,"see2")
loop
see2:
}
}
now we need to give it some jumptargets
for this example I'm only going to use the doomimp and zombieman and for that we need to make 2 new actors and give them tids
Spoiler: (Open)
doomimp1 : doomimp
{
states
{
Spawn:
TROO AB 10 A_Look
tnt1 a 0 thing_changetid(0,1)
Loop
}
}

actor zombieman1 : zombieman
{
states
{
Spawn:
POSS AB 10 A_Look
tnt1 a 0 thing_changetid(0,2)
Loop
}
}
now we need the new actors to replace the old actors you can do that like this.
the replace keyword is important here.
Spoiler: (Open)
doomimp1 : doomimp replaces doomimp
{
states
{
Spawn:
TROO AB 10 A_Look
tnt1 a 0 thing_changetid(0,1)
Loop
}
}

actor zombieman1 : zombieman replaces zombieman
{
states
{
Spawn:
POSS AB 10 A_Look
tnt1 a 0 thing_changetid(0,2)
Loop
}
}
now since we have new creatures with tids now we can assign jumptargets to the drone like this
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
tnt1 a 0 a_jump(256,"see2")
loop
see2:
tnt1 a 0 a_jump(256,"m1","m2")
}
}
now we need our creature to hate the other 2 actors there are several kinds of hating
for this example I'm going with the kind that will hunt them without seeing them and is friendly to the player
[zdwiki]https://zdoom.org/wiki/Thing_Hate[/zdwiki]
your decorate so far should look like this
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
tnt1 a 0 a_jump(256,"see2")
loop
see2:
tnt1 a 0 a_jump(256,"m1","m2")
m1:
hdrn aaa 1
tnt1 a 0 thing_hate(3,1,2)
goto see
m2:
hdrn aaa 1
tnt1 a 0 thing_hate(3,2,2)
goto see
}
}
now all you haft to do is save the code above with the 2 other actors in one decorate like this
Spoiler: (Open)
actor ally : drone
{
+quicktoretaliate
+lookallaround
+float
states
{
spawn:
hdrn ab 10 a_look
tnt1 a 0 thing_changetid(0,3)
tnt1 a 0 a_jump(256,"see2")
loop
see2:
tnt1 a 0 a_jump(256,"m1","m2")
m1:
hdrn aaa 1
tnt1 a 0 thing_hate(3,1,2)
goto see
m2:
hdrn aaa 1
tnt1 a 0 thing_hate(3,2,2)
goto see
}
}

actor doomimp1 : doomimp replaces doomimp
{
states
{
Spawn:
TROO AB 10 A_Look
tnt1 a 0 thing_changetid(0,1)
Loop
}
}

actor zombieman1 : zombieman replaces zombieman
{
states
{
Spawn:
POSS AB 10 A_Look
tnt1 a 0 thing_changetid(0,2)
Loop
}
}
the ending result should look like this
for video purposes I made the drone invulnerable.
that means the drone takes no damage from enemies but can be killed by console or the mdk command
it is a actor flag that u can or not use on your stalker creature
here is the video
https://youtu.be/v3WD0a34MFs