Back to the Vavoom Forum Archives


Forum

VavoomC/Progs scripting questions

Sun, 30 Jan 2011 18:54:44

b0rsuk

The purpose of this thread is to talk about "how to do stuff" or "how stuff works" in VavoomC/progs. Since my mod works by now, asking my questions in the thread "how to get mod working" isn't right. At the same time, there's
Sun, 30 Jan 2011 20:52:19

Janis Legzdinsh

[quote="b0rsuk":4ks2vehc]What are Special variables ? For instance A_FPunchAttack in Hexen uses Special1 variable to keep track of punches that hit. Every third punch is a hook with double damage
Mon, 31 Jan 2011 09:01:49

b0rsuk

I modified punch attack to fire missiles. Upon hitting, DoSpecialDamage method of the missile increases the Special1 by 1. So far it works. But on new attack it's apparent the counter is reset for new spawned missile. Appa
Mon, 31 Jan 2011 13:25:39

Firebrand

To use translations like that, you need to modify the pallete.pcx file inside the "basev/hexen/" directory, you need to add rows on the bottom of the image, since the player has 8 translations (or 7 in arrays), you'll need to use a number bigger
Sun, 06 Feb 2011 20:19:29

b0rsuk

Physics of items I modified Disc of Repulsion to attract some items - mana created by Hammer of Retribution. The hammer uses 40 mana per shot, and spawns 40 mana where it hits. For player's convenience, and to make things more interesting, Disc of Repuls
Tue, 08 Feb 2011 00:34:53

Firebrand

Mass doesn't actually affect velocity at all, only on Z, but the effect is minimal on it. Did you tried removing the bFloatBob flag while moving mana items? It could affect the Z movement a bit.
Tue, 08 Feb 2011 10:52:00

b0rsuk

I'll play around with FloatBob function, thanks. I know it can mess up stuff, becaue I tried it on floating bridges <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->. I don't think the effect is always minimal
Sun, 13 Feb 2011 20:19:42

b0rsuk

I'm trying to write an actor method that triggers item pickup. When player is close enough, the item should be picked up. I don't want to just increase item Radius, because this has side effects (collision when blasted with Disc o
Mon, 14 Feb 2011 02:12:51

Firebrand

Is your item marked with the bSpecial flag? If it isn't then the game won't call the proper methods to pick it up if touched by the player.
Sat, 26 Feb 2011 18:55:28

b0rsuk

Okay, this may be a little off-topic, but it jumped at me. Below is a piece of code from linespec/ArtiBlastRadius.vc . There are special cases for certain missiles. Note the way they're checked.
if (victim.bMissile) 137
Sun, 27 Feb 2011 16:49:00

Crimson Wizard

Umm, b0rsuk, did you just removed your last post about unaffected ghosts? <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> I may be wrong but I had a feeling you've got some mistake in 'if/else if' structure. Regar
Sun, 27 Feb 2011 17:45:17

b0rsuk

[quote="Crimson Wizard":36k1vr4q]Umm, b0rsuk, did you just removed your last post about unaffected ghosts? <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> I may be wrong but I had a feeling you've got som
Sun, 27 Feb 2011 18:02:33

Firebrand

You are checking it wrong, it should be something like:
if (link.State == link.SeeState)
{
      continue;
}
Right now, you are checking if the State is equal to the projectile's SeeState <!-- s:) --><img src="{SMIL
Sun, 27 Feb 2011 18:25:16

b0rsuk

[quote="Firebrand":32mmzmf1]You are checking it wrong, it should be something like:
if (link.State == link.SeeState)
{
      continue;
}
Right now, you are checking if the State is equal to the projectile'
Sun, 27 Feb 2011 19:49:55

Crimson Wizard

[quote="b0rsuk":3mckojdp] In the meantime, I'm trying to make my Hammer use 20 mana per shot on easy skill levels (rather than 40). I don't know how to do that, and there doesn't seem to be an easy way. Any ideas ? Well, to get
Wed, 02 Mar 2011 16:10:28

b0rsuk

Overriding Pickup sounds like a reasonably easy way to go.
native final void BounceWall(float overbounce, float bouncefactor);
I understand what the second parameter is, but what is the first one ? I would like to make
Wed, 02 Mar 2011 16:44:16

Crimson Wizard

[quote="b0rsuk":8htw3v7b]The function is native so I can't look inside it. You can, if you download engine sources <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Can't help regarding
Thu, 03 Mar 2011 18:28:26

b0rsuk

Why can't I just do
AmmoUse1 = 10
, put it in a custom DECORATE method and execute it on spawn or pickup ? I get "illegal identifier AmmoUse1" error. I also tried "Weapon.AmmoUse1 = 10".
Thu, 03 Mar 2011 20:01:31

Firebrand

Where are you adding this new method to call?
Fri, 04 Mar 2011 06:50:03

b0rsuk

[quote="Firebrand":3pmbd2qn]Where are you adding this new method to call? actors/hexen/fighterhammer.txt actor FWeaphammer
 22     Ready:
 23         FHMR A 1 A_WeaponReady
 24         FHMR A 0 A_SetAmmoUse
Fri, 04 Mar 2011 16:29:33

Firebrand

You need to do it with something like this in the A_SetAmmoUse method (in progs):
if (!bIsPlayer)
	{
		return;
	}
	Weapon Wpn = PlayerEx(Player).ReadyWeapon;

        Wpn.AmmoUse1 = 10;
I would recommend that you ta
Fri, 04 Mar 2011 19:23:53

BlackJar72

I have questions about "special" data fields too: (1) are they automatically made part of any monster (or other object) that uses a method they appear in? (2) Is there a way (other than an init function called at spawn) that they can be given d
Fri, 04 Mar 2011 19:24:27

BlackJar72

I have questions about "special" data fields too: (1) are they automatically made part of any monster (or other object) that uses a method they appear in? (2) Is there a way (other than an init function called at spawn) that they can be given d
Fri, 04 Mar 2011 19:41:24

b0rsuk

[quote="BlackJar72":3n4f9jd2]I have questions about "special" data fields too: (1) are they automatically made part of any monster (or other object) that uses a method they appear in? (2) Is there a way (other than an init function ca
Sat, 05 Mar 2011 06:40:13

Crimson Wizard

[quote="BlackJar72":2kaxadn1](1) are they automatically made part of any monster (or other object) that uses a method they appear in? Variables that are declared in class are made a part of any object of that class (type). How can I check an actor's name or class name ? For example when a projectile hits an Ettin, I want to print "Ettin". Simple enough,
GetClassName(A.Class)
Y
Fri, 11 Mar 2011 10:40:44

b0rsuk

Okay, that worked, but I've learned the hard way that I need to print "%n" and not "%s". I'm trying to debug WraithVerge. I want ghosts not to target idle monsters. So in CHolyFindTarget I compare:
if (link.State 
Fri, 11 Mar 2011 12:52:35

Crimson Wizard

Ah, I remember I had similar problem. IIRC, such properties as IdleState refer to exactly the FIRST FRAME of the state animation. Thus, if an actor is at different frame, the equation won't work. I think you should use either StateIsInRange or StateIsInSe
Fri, 11 Mar 2011 13:55:10

b0rsuk

[quote="Crimson Wizard":ehtppcfk]Ah, I remember I had similar problem. IIRC, such properties as IdleState refer to exactly the FIRST FRAME of the state animation. Thus, if an actor is at different frame, the equation won't work. I think you shou
Fri, 11 Mar 2011 14:11:07

Crimson Wizard

That's because you make a mistake there:
 if (StateIsInSequence(Other.State, IdleState)){
49         return true;
50         } 
Here you compare the Other's State with the Missile's IdleState. You should perhaps make:
Fri, 11 Mar 2011 14:31:57

b0rsuk

Yesss !! That's it ! Thank you. My ghosts now behave much better, even though they can fly through walls they won't disturb idle creatures. It was very annoying in vanilla hexen, and is even more annoying in a mod where Wraithverge doesn't kill.
Fri, 11 Mar 2011 14:34:55

Crimson Wizard

Glad I could help <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Fri, 11 Mar 2011 17:48:12

b0rsuk

A question about native methods. A) sometimes a method used in DECORATE is defined in a progs file, and then listed in actors/nativeclasses.txt B) sometimes a method used in DECORATE is called native in a decorate file, for examp
Fri, 11 Mar 2011 18:28:22

Crimson Wizard

[quote="b0rsuk":2cksutz7] When should A be used, and when B ? So far I've only been using the way "A" - I add my methods in linespec/Actor.B0rsuk.vc . But I'm starting to think maybe if I use the method only in one decorate file I shou
Sat, 12 Mar 2011 07:25:54

b0rsuk

I'm trying to utilize the bFullBright flag to make mage's Arc of Death flicker randomly. The actual weapon, not the missile. I started by erasing most of "Bright" words from actors/hexen/magelightning.txt . So far as expected, the weapon is no l
Sat, 12 Mar 2011 10:27:29

b0rsuk

Another question. I want my centaurs to have much longer melee attack range. How do I do that ? Here's what doesn't work: - editing EntityEx.Head and just changing MELEERANGE constant. Player attacks change their range (undesirable!), but ettins and cent
Sat, 12 Mar 2011 15:08:00

Crimson Wizard

First of all, you SHOULDN'T change anything in Engine folder. These files contain only declarations, but actual implementation is in Vavoom engine. That's why functions there have a "native" type. If you change any class there engine will detect
Sat, 12 Mar 2011 17:03:42

b0rsuk

[quote="Crimson Wizard":3hjymlow] You can change it the way there won't be any need to fix its call all over the progs. There's a way to make parameter be optional, like this: I know, I already tried doing it this way ! But ev
Sat, 12 Mar 2011 17:12:36

Crimson Wizard

No, sorry, it was me who made a mistake. Actually, you should make something like this:
bool CheckMeleeRange( optional float range )
{
   if (!specified_range)
   {
      if (Class = Centaur):
          range = 2 * MELEERANGE;
      el
Sat, 12 Mar 2011 17:38:55

b0rsuk

I've already made it work in a similar way, simply
if (IsA('Centaur'))
And it works. I've seen the !specified_variablename trick before, and couldn't find a variable with a name like that. You mean I can use it with wit
Sat, 12 Mar 2011 17:53:32

b0rsuk

Wait a second - I don't have to do this ! There's already a "MeleeRange" actor property !! And the CheckMeleeRange method uses the property, not MELEERANGE constant. But another question arises. In linespec/EntityEx.Head.vc , MELEERANGE constan
Mon, 14 Mar 2011 14:18:03

b0rsuk

1333             A = Spawn(class<EntityEx>(SInfo->ChunkClass), org);
This line from progs/linespec/EntityEx.Physics.vc generates a chunk corresponding to surface type when a projectile hits floor. For example if
Wed, 16 Mar 2011 16:17:46

Firebrand

Vavoom has different ways to search for class names, if you look into Objects.vc and search for FindClass, you'll see that there are means to look for lower cased class names, this was done for convenience of both modders and developers, imagine trying to
Wed, 16 Mar 2011 17:16:04

b0rsuk

[quote="Firebrand":3gas3ztw]Vavoom has different ways to search for class names, if you look into Objects.vc and search for FindClass, you'll see that there are means to look for lower cased class names, this was done for convenience of both mod
Fri, 18 Mar 2011 13:32:58

Janis Legzdinsh

If you want to use in progs a class that is defined completely in DECORATE you have to use declaration to inform compiler about this. Usually these declarations are placed in classes.vc. For example:
class BulletPuff : Actor decorate;[/

Back to the Vavoom Forum Archives