Page 1 of 1

[SOLVED] Custom Monster working fine Offline; Drunk as hell in Multiplayer

Posted: Fri Oct 31, 2014 11:15 pm
by Erma
I have been editing/learning from various decorate files and am continuing to learn more and more.

Sadly, I've stumbled upon an issue of which I need to ask the community for help.. If possible!

Here goes: I have created a custom weapon that summons a monster. When firing, it launches a projectile and its range ends randomly (intended). Once the projectile reaches its end, the monster spawned just flies in a random direction, continuously flying and eventually ends up faceplanting the wall for an indefinite time. A friend of mine: Blitz, told me that the problem might be in the spawning / target code.

I've tested this offline and the monster seems to work fine. It attacks enemies, and doesn't attack allies (intended). So.. I am stuck from this point on.

Below you can find the decorate file. (My apologies if it looks atrocious to most of you advanced modders/editors out there):
Spoiler: WEAPON DECORATE (Open)
Actor RavenStaff : Weapon
{
Inventory.PickupSound "Misc/W_PkUp"
Inventory.PickupMessage "Raven Staff"
Obituary "%o was pecked down by %k's ravens"
Weapon.AmmoType "SkullRodAmmo"
Weapon.AmmoGive 0
Weapon.AmmoUse 50
Inventory.Icon "RVNSA0"
States
{
Spawn:
RVNS A -1
Loop
Select:
RVNS B 1 A_Raise
loop
Deselect:
RVNS B 1 A_Lower
loop
Ready:
RVNS B 1 A_WeaponReady
loop
Fire:
RVNS B 0 A_PlayWeaponSound("Weapons/RavenStaff/Fire2")
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), -35, 128)
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), -45, 128)
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), -55, 128)
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), 35, 128)
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), 45, 128)
RVNS B 0 A_SpawnItemEx("RavenSmoke", 6, 0, Random(31, 33), 2, 0, Random(-0.5, 0.5), 55, 128)
RVNS B 0 A_FireCustomMissile("PoweredRavenMissile", Random(-12, 12), 1, 0, 0, 0, Random(-4, 6))
RVNS B 8 Offset(0, 35)
RVNS B 8 Offset(0, 39)
RVNS B 8 Offset(0, 45)
RVNS B 12 Offset(0, 50)
RVNS B 11 Offset(0, 46)
RVNS B 11 Offset(0, 40)
RVNS B 11 Offset(0, 37)
RVNS B 11 Offset(0, 32)
Goto Ready
}
}

Actor RavenTrail
{
Radius 1
Height 1
+NoClip
+DropOff
+NoTeleport
+CannotPush
+DontSplash
+NoGravity
States
{
Spawn:
TNT1 A 2
RVNP OPQRST 2 A_FadeOut(0.08)
Goto Spawn+1
}
}

Actor PoweredRavenMissile
{

Radius 12
Height 8
Speed 25
Damage (6)
Projectile
+ripper
-BloodSplatter
+BloodlessImpact
BounceCount 10
BounceFactor 1.0
RenderStyle Translucent
SeeSound ""
Alpha 0.85
ReactionTime 9
States
{
Spawn:
RVSR A 0 Bright
RVSR A 0 A_PlaySound("Weapons/RavenStaff/RavenSight")
RVSR A 0 Bright A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
Spawn1: //This is just to randomize what frame they start on
RVSR A 4 Bright
Spawn2:
RVSR B 4 Bright
Spawn3:
RVSR C 4 Bright
Spawn4:
RVSR D 4 Bright
Idle:
TNT1 A 0 Bright A_SpawnItemEx("Soveraven", 0, 0, 0, 0, 0, 0, 0, 128, 192)
TNT1 A 0 Bright A_Countdown
Loop
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySound("Weapons/RavenStaff/RavenDeath")
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 1 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
Stop
}
}
Spoiler: MONSTER DECORATE (Open)
Actor Soveraven
{
Health 20
Radius 11
Meleerange 42
Height 13
Speed 20
Scale 1.0
BloodColor "Red"
Mass 400
PainChance 255
MeleeSound "Raven1"
ActiveSound "Raven/Active"
Obituary "%o's couldn't withstand %k's ravenswarm."
DamageFactor "SjasScream", 0
DamageFactor "Creeper", 0
DamageFactor "CreepStun", 0
DamageFactor "Jitter", 0
DamageFactor "Choke", 0
DamageFactor "Ravager", 0
DamageFactor "RavagerBall", 0
DamageFactor "Yurei", 0
DamageFactor "YureiBall", 0
DamageFactor "Misty", 0
DamageFactor "Clowny", 0
DamageFactor "Mohoph", 0
DamageFactor "Emtalic", 0
DamageFactor "EmtalicWeak", 0
DamageFactor "I1", 0
DamageFactor "I2", 0
DamageFactor "I3", 0
DamageFactor "I4", 0
DamageFactor "I5", 0
DamageFactor "DarkSovereign", 0
Damagefactor "BloodScepter", 0
MONSTER
+DONTBLAST
+LOOKALLAROUND
+DONTMORPH
+FRIENDLY
+NOGRAVITY
+DONTHURTSPECIES
+FLOAT
+NOGRAVITY
+SPAWNFLOAT
+MISSILEMORE
+PUSHABLE
+QUICKTORETALIATE
-COUNTKILL
States
{
Spawn:
RVSR AABBC 3 A_Look
RVSR C 1 A_PlaySound("Raven/wings")
RVSR C 2 A_Look
RVSR BB 3 A_Look
goto See
See:
RVSR A 0 A_JumpIfTargetinLOS(2, 140)
RVSR A 0 A_Jump(40, "Giveup")
RVSR AABBC 3 A_Chase
RVSR C 1 A_PlaySound("gibbage/wingflap")
RVSR C 2 A_Chase
RVSR BB 3 A_Chase
loop
Giveup:
IMPX A 0 A_ClearTarget
goto See
Idle:
RVSR A 0 A_LookEx(0, 0, 0, 0, 460, "See")
RVSR AABBCCBB 3 A_Wander
RVSR A 0 A_LookEx(0, 0, 0, 0, 460, "See")
loop
Melee:
RVSR D 5 A_FaceTarget
RVSR CD 6 A_CustomMeleeAttack(5, "RAVEN1", "RAVEN1")
Goto See
Missile:
RVSR A 5 A_FaceTarget
RVSR B 6 A_SkullAttack(14)
RVSR CBAB 6
RVSR C 0 A_Jump (230, 3)
RVSR C 0 A_Stop
RVSR C 0 A_Jump (256, "See")
RVSR C 0
Goto Missile
Pain:
RVSR D 3
RVSR D 3 A_Pain
Goto See
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySound("Weapons/RavenStaff/RavenDeath")
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 1 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
Stop
XDeath:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySound("Weapons/RavenStaff/RavenDeath")
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenFeather", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 0 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
TNT1 A 1 A_SpawnItemEx("RavenSmoke", 0, 0, 0, Random(1, 2), 0, Random(1, 2), Random(0, 360), 128)
Stop
}
}

Actor RavenSmoke
{
Radius 0
Height 0
Scale 0.4
RenderStyle Add
Alpha 0.7
+NoGravity
+DontSplash
States
{
Spawn:
RVSR EFGHIJKL 2
Stop
}
}

Actor RavenSmoke2
{
Radius 0
Height 0
Scale 0.3
RenderStyle Add
Alpha 0.3
+NoGravity
+DontSplash
States
{
Spawn:
RVSR EFGHIJKL 2
Stop
}
}

Actor RavenFeather
{
Radius 2
Height 4
+MISSILE
+DropOff
+NoTeleport
+CannotPush
+WindThrust
+DontSplash
Gravity 0.125
States
{
Spawn:
RVSR MNOPQPON 3
Loop
Death:
RVSR O 6
Stop
}
}
P.S.: Happy Halloween everybody!

RE: Custom Monster working fine Offline; Drunk as hell in Multiplayer

Posted: Sat Nov 01, 2014 4:59 am
by Ænima
It's because you're spawning the monsters clientside. Pay close attention to SpawnItemEx's flags parameter.

RE: Custom Monster working fine Offline; Drunk as hell in Multiplayer

Posted: Sat Nov 01, 2014 10:10 am
by Erma
Ænima wrote: It's because you're spawning the monsters clientside. Pay close attention to SpawnItemEx's flags parameter.
Thanks for the info. I tried adjusting the parameters, but I still couldn't get it to work. However, when you said that I needed to pay close attention to SpawnItemEx, it gave me an idea to use SpawnItem instead. That seems to work fine now :)

I owe you one!

RE: [SOLVED] Custom Monster working fine Offline; Drunk as hell in Multiplayer

Posted: Sat Nov 01, 2014 2:04 pm
by Ænima
Nuuuuuu don't use spawnitem, it's inferior. Use spawnitemex but use the correct flags. Subtracting 128 from the Flags parameter of your "soveraven" spawnitemex (which takes CLIENTSIDE spawning off) and changing it to 32 (which makes the actor always spawn even if there's another actor in it's way) would be the best for a projectile like this.

RE: [SOLVED] Custom Monster working fine Offline; Drunk as hell in Multiplayer

Posted: Sat Nov 01, 2014 4:07 pm
by Erma
Ænima wrote: Nuuuuuu don't use spawnitem, it's inferior. Use spawnitemex but use the correct flags. Subtracting 128 from the Flags parameter of your "soveraven" spawnitemex (which takes CLIENTSIDE spawning off) and changing it to 32 (which makes the actor always spawn even if there's another actor in it's way) would be the best for a projectile like this.
Oh.. well. Still solves the issues. I'll apply that in a next patch. I still owe you one! For now, I'll just see how it works in battle now, to see whether it's either too weak or too strong. From what I've heard is that it's rather a bit weak, but then again; There was only one of those summoning ravens. Imagine two. Would make things different!

Big thanks to Aenima!