[Wait for Doomscript] Decorate addons.

Moderator: GZDoom Developers

Decorate addons.

Postby Sphagne » Tue Apr 12, 2005 8:49 pm

Here is another attempt at an old feature suggestion of mine, for DECORATE objects: :wink:

Decorate actors can have some internal general-purpose values that could be set and checked via action functions, like this:

A_SetVal(1,100) // Val[1]=100
A_SetValRand(8,50,70) // Val[8]=Random(50,70)
A_JumpValEQ(5,50) // if (Val[5]==50) {}
A_JumpValIN(4,30,40) // if (Val[4]>=30 && Val[4]<=40) {}
A_JumpValLT(7,10) // if (Val[7]<10) {}

Some arithmetic:

A_AddVal(5,7) // Val[5]=Val[5]+7
A_AddVals(5,7) // Val[5]=Val[6]+Val[7]

Some bonus actions:

A_SetValToHealth(3) // Val[3]=Actor.Health

Some bool results:

A_SetVal_if_WaterZone(1) // if (Actor_in_WaterZone) {Val[1]=1} else {Val[1]=0}

Set an internal value to reflect a flag bit of the actor:

A_SetVal_to_FlagBit(5,flagFloating) // if (Actor_is_Floating) {Val[5]=1} else {Val[1]=0}


OK, here is another way of communication between ACS and DECORATE:

Thing_SetValue(tid, val_index, value); // Sets an internal value of the things
a=Thing_GetValue(tid, val_index); // Retrieves an internal value of the things


We can have some global values that are shared and accessed by all the actors, useful for communication between them, setting alarms, coordinating movements, and so on...

A_SetGlobal(1,100) // Global[1]=100
A_JumpGlobalEQ(5,50) // if (Global[5]==50) {}
A_JumpGlobalLT(7,10) // if (Global[7]<10)

Some value exchange:

A_GlobalToVal(2,5) // Val[2]=Global[5]
A_ValToGlobal(2,5) // Global[2]=Val[5]
A_AddGlobal(2,-10) // Global[2]=Global[2]-10
A_AddValToGlobal(2,5) // Global[2]= Global[2]+Val[5]
A_AddGlobalToVal(2,5) // Val[2]=Val[2]+Global[5]

Some ACS Functions:

Decorate_SetGlobalValue(5,7) // Decorate.Global[5]=7
a=Decorate_GetGlobalValue(5) // a=Decorate.Global[5]

Thus, we can control internal states of the actors via ACS scripts, or globally change their behaviors.
User avatar
Just me, nothing more
Joined: 16 Jul 2003

Postby Cptschrodinger » Tue Apr 12, 2005 9:15 pm

Do what now?
Our father, who art in hell
Joined: 21 Oct 2004

Postby Kirby » Tue Apr 12, 2005 9:20 pm

Sphagne wrote:globally change their behaviors
User avatar
Soon to be chastized
Joined: 26 Aug 2004

Postby Graf Zahl » Wed Apr 13, 2005 2:21 am

Oh man, you are in desperate need of some RPG elements, aren't you? ;)

Anyway, most of the suggestions make sense - unlike many other lengthy posts from you. ;)

But you forgot one ACS option:

Decorate_Set/GetValue(tid, index, value).

But you can achieve lots of the stuff you are suggesting with the latest inofficial version and inventory items already.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Joined: 19 Jul 2003
Location: Germany

Postby Sphagne » Wed Apr 13, 2005 9:19 pm

OK, but would these take long to implement?

These are not for RPG obly, these would give the monster designers lots of control over their handywork.

How about a timer within the monsters that would be activated and do some delayed action.

Or, faking new states with setting these flags, and checking them later.

Or starting a mass massacre with all the monsters of the room starting fo fire their weapon at once...
User avatar
Just me, nothing more
Joined: 16 Jul 2003

Postby Sphagne » Sun Apr 17, 2005 8:27 am

If player actors could have these internal values, and we could use these action functions for weapon definitions, then we could achieve lots of great effects, like alternate fire modes for our weapons.

I.e. we could assign a new key that would toggle an internal value of the player and in the weapon definition; we could check this value to run alternate attack sequence, instead of the normal one.

We could disable some weapons in some areas, like underwater, or make weapons that could be improved, during the course of the game, and so on...

Just by changing those internal values (by ACS) and checking them in the weapon definition codes.


Additional action functions for these internal values:

A_SetDirToVal(5) // sets the direction of the actor to Val[5]

Rotating actors?

A_GetValFromDir(7) // gets the direction of the actor into Val[7]

You can decide on the actor’s direction and perform tasks depending on it.
Remember this actor can be the player, when in weapon definition.

A_SetScaleToVal(3) // sets the scale of the actor to Val[3]

Shrinking actors?


Some action function suggestions:

A_Force(Fx,Fy,Fz) // forces the object toward a direction

A_ForceRand(Fx,Fy,Fz) // like A_Force(-Fx to Fx, -Fy to Fy, -Fz to Fz) : Snow flakes?

A_ForceTarget(Dir,Fh,Fz) // Jumps toward the target but:

if Dir is 0 then jumps directly at target, but if it is 180 or -180, then jumps backwards and the in between values would set the direction.

Fh if the horizontal force in the specified direction, and Fz is the Z Force.

A_PushTarget(Dir,Fh,Fz) // Like A_ForceTarget, but pushes the target in the specified direction.

We can emulate Archvile attacks this way, by the help of the next action functions:

A_SpawnTarget(... // Spawns an actor over the target.

A_DamageTarget(... // Damages the target by a defined amount.
User avatar
Just me, nothing more
Joined: 16 Jul 2003

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest