Creating new monsters and their features

Talk about editing and creation of Vavoom mods

Re: Creating new monsters and their features

Postby Janis Legzdinsh » 16 May 2010 17:51

You must move everything from progs/common/ to progs/.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Re: Creating new monsters and their features

Postby b0rsuk » 03 Jun 2010 19:23

I'm trying to make Imps shoot inaccurately, by adding a random number to their angle. Unfortunately I've been unable to find the implementation of Partial Invisibility - there may be a better way. Here's my try:

Code: Select all
   randangle = P_Random() % 15;
   if (P_Random() % 2 == 0)
   {
       randangle *= -1;
   }

   // launch a missile, 60.0 is tmp -b0rsuk
   SpawnMissileAngle(DoomImpBall, Angles.yaw + itof(randangle), 60.0);


I don't know a good way to find the angle to target. I just took Angles.yaw, but because imps don't look up or down I can only make them shoot horizontally. I can't just use SpawnMissile, because the function requires a target entity.
User avatar
b0rsuk
 
Posts: 189
Joined: 10 May 2010 15:55

Re: Creating new monsters and their features

Postby Firebrand » 04 Jun 2010 18:13

Check A_FaceTarget method inside Actor.MonsterAi.vc :).
User avatar
Firebrand
 
Posts: 1000
Joined: 11 Feb 2004 08:12
Location: Mexico

Re: Creating new monsters and their features

Postby Janis Legzdinsh » 04 Jun 2010 20:03

VectorAngles()
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Re: Creating new monsters and their features

Postby b0rsuk » 11 Jun 2010 19:02

Ok, no more stupid math questions until I finish going through my high school math books and especially Trigonometry. Meanwhile...

I try to design a custom attack for those cute Hexen ettins, but I fail.
I started by designing an attack in Actor.Hexen.vc:

Code: Select all
final void A_Borsuk() // temporary !!
{
A_TroopAttack() // DooM Imp attack
}


Then I added this line to ettin.txt in Actors:

Code: Select all
ETTN E 1 A_Borsuk


I launch the mod, it doesn't crash (yay !) but no effect when an ettin attacks.

If I just use A_TroopAttack directly in ettin.txt, it works, and it's easy to see because DooM Imps do instant damage in melee.
If I modify one of existing attacks in Actors.Hexen.vc, the effect is visible in game. It's just the my new attack that produces no effect.

What am I missing ? By the way, I tried just using VavoomC function (Thrust(angle, power)) directly in Decorate, but I guess it's not possible - it crashed. Can I only call functions which take no arguments in decorate ? What determines which functions can be used in Decorate ?
User avatar
b0rsuk
 
Posts: 189
Joined: 10 May 2010 15:55

Re: Creating new monsters and their features

Postby Firebrand » 11 Jun 2010 19:15

Have a look at what A_TroopAttack does:
Code: Select all
   // launch a missile
   SpawnMissile(Target, DoomImpBall);

It spawns a Projectile of class DoomImpBall, did you add it to your MOD? If you didn't then the game isn't spawning it because the class doesn't exists or it doesn't has any sprites :), DoomImpBall uses sprites named BAL1A0 and BAL1B0, hope this helps you out :).
User avatar
Firebrand
 
Posts: 1000
Joined: 11 Feb 2004 08:12
Location: Mexico

Re: Creating new monsters and their features

Postby b0rsuk » 11 Jun 2010 19:24

Firebrand wrote:Have a look at what A_TroopAttack does:


Thanks for very fast repply, but unfortunately you're wrong ! I already said A_TroopAttack works if called directly from DECORATE. I know how it works because I already changed imps to be inaccurate (with your help). There's no DoomImpBall to be spawned, because A_TroopAttack first checks for an enemy in melee range. I made Ettins use A_TroopAttack in melee, so it's too close for ball and they scratch me instead. Like I wrote above, instant melee damage happens, as with imps.

Problems start when I try to use my own defined attack (see the post above).
I tried wrapping other functions inside my A_Borsuk(), such as:

PlaySound('BlastRadius', CHAN_VOICE);
dprint("Alamakota");

And it didn't work either.
User avatar
b0rsuk
 
Posts: 189
Joined: 10 May 2010 15:55

Re: Creating new monsters and their features

Postby Firebrand » 12 Jun 2010 14:15

OK then, I've got a second solution, the problem seems to be that the function hasn't been made native for actors to use, making this is really simple, inside 'basev\common\' there's a nativeclasses.txt file, just add the A_Borsurk(); method there, this should make the method native for actors to use :). Make sure that A_Borsurk method is declared inside any for the Actor.xx files or it won't work fine, hope this helps you out.
User avatar
Firebrand
 
Posts: 1000
Joined: 11 Feb 2004 08:12
Location: Mexico

Re: Creating new monsters and their features

Postby Janis Legzdinsh » 12 Jun 2010 20:28

It seams you forgot to declare it as a native action. Take a look for example at actors/hexen/dragon.txt.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Previous

Return to Editing

Who is online

Users browsing this forum: No registered users and 0 guests

cron