PDA

View Full Version : FS: Possible FS additions.


Danimetal
January 31st, 2006, 08:55 AM
When Legacy V2.0 is out surely FS and the BEX extensions will be used to make new weapons. Regarding this I´ve thought about a couple of modifications to the functions that, if possible to be coded, could add more possibilities to Legacy.

-The Lineattack function will be surely used for a lot of new firearms but it doesn´t work for melee weapons that should duplicate the chainsaw or fist effect. I suggest adding a "distance" parameter to the function so melee weapons can be done too. As far as I know, the original Doom fist is a lineattack weapon with a limited range.

-The Spawnmissile function will also allow for new weapons and works right as it is. Still, if something could be added it would be a "spawner" parameter: I seem to remember that some projectile weapons in Doom can´t harm the one who fires them (plasma gun) and it would be nice to make this effect possible with custom weapons too. I don´t know the difficulty for this.

And I think that´s all... Well, the only thing that´s missing is a railgun and then some function to spawns a projectile that doesn´t dissapear when impacts the enemy. Now that I think about that, it could be interesting: it could keep hurting until the health of the projectile is completely depleted (that would be achieved by hurting things or after a given period of time)... Clouds of venom and "railgun projectiles" could be done with this. Anyway, I just wanted to point the two above.

shinobi
January 31st, 2006, 01:22 PM
Mmmm, railgun sucks, im happy that doom doesnt have one

Ebola
January 31st, 2006, 09:28 PM
When Legacy V2.0 is out surely FS and the BEX extensions will be used to make new weapons.

Or they could use a good system to make the weapons.

Danimetal
February 1st, 2006, 02:44 AM
Or they could use a good system to make the weapons.
Indeed... When I think about this I tend to think about separate things: the weapons graphics (seen on the screen), the weapons functioning (firing, ammo consumption) and the weapons sideeffects (light effects, checkreload states...).

Right now you can emulate only the functioning with scripting, but nothing less. If Legacy was to have a custom weapons system, would it be embedded inside FS or would it be another kind of system like an extended table?... I don´t know, but a simple and effective way to do it would be as following:

{
weapon = 06 // For example, the number.
bobbing01 = ("Handgun01", 2 , 0) // The graphic lump, duration and sideeffects. If no sideffect specified, the state passes to the next.
bobbing02 = ("Handgun02", 2, 0)
bobbing03= ("Handgun03, 2, bobbing1) // If sideeffect = frame that frame is called.
firing01 = ("Hangunfir01", 4, startscript(1)); //Again, graphic lump, duration and sideffect (call script 1).
firing02 = ("Handgunfir02", 2, startscript(2));
firing... //Etc... Lower, Raise and other weapon states should be called. In addition, some "customstates" could be done for custom stuff like weapon reloading, secondary fires and things like that... These custom states would be called only from scripting.
}

script 1
{
if (x != 0) // Given x as ammo.
{
callweaponframe(6, firing02); //If there´s ammunition the weapon number 6 proceeds to the second firing frame.
}
else
{
callweaponframe(6, bobbing01); //If there´s not, we get back to the bobbing frame.
}
}

script 2
{
callstate("LIGHT1"); // Lits up the room when firing.
x=x-1; //Substracts ammo.
lineattach(blahblah); //Attack itself.
playsound("BLAH"); // Sound of the weapon.
}

You see, first there´s the definitions and then we create the effects and working with scripts. For example, this weapon works in a simple way: if there´s ammo it fires and lits the room, if not it goes back to bobbing frames... Need functions (like callstate, callweaponframe and stuff) would be needed along with lot of other things for this system to work but well, this is just a suggestion or inspiration :).

DarkWolf
February 1st, 2006, 05:34 AM
-The Spawnmissile function will also allow for new weapons and works right as it is. Still, if something could be added it would be a "spawner" parameter: I seem to remember that some projectile weapons in Doom can´t harm the one who fires them (plasma gun) and it would be nice to make this effect possible with custom weapons too. I don´t know the difficulty for this.

Well lineattack was an experiment and really wasn't supposed to be documented. But somehow it got in the CVS and then someone found out about it. As far as spawning a missle inside a player you can get around this by using simple trig to spawn the missle in front of the player by a few pixels.

weaponx = cos(playerangleinrads) * distance from player + playerx
weapony = sin(playerangleinrads) * distance from player + playery

Danimetal
February 1st, 2006, 05:46 AM
Yeah, that can be made and you can also spawn a node just a little more distance away to be the target for the missile spawned. What I meant with a spawned parameter was that the missile (projectile) would never harm you if you shoot it and collide with it.

We al know missiles hurt the player that launchs them but plasma and BFG shots don´t (you can do a large hallway with teleporters in each side and check yourself) so you´re invulnerable to your own weapons. If you spawn those with FS you´re bound to be harmed by them so to avoid that you could use a "spawner" parameter. Anyway, that should be hard to code.

It really can sound pointless since the player never gets to reach his own plasma balls but I don´t know, you can script plasma balls that circle around the player or something and those would hurt. The whole purpose of that parameter would be to "emulate" the original Doom behaviour (supposing it´s easy to implement and worth the effort).

Danimetal
February 14th, 2006, 09:03 AM
I just thought... With any user-made projectile weapon (assuming it´s done with FS) the whole multiplayer and deathmatch thing would be harder to script, but possible but... How would you recognise who killed someone with an user-made projectile weapon so he gets the frag?. Using the player as the spawn point?.

Ebola
February 14th, 2006, 02:38 PM
Why not just add Decorate?

Danimetal
February 14th, 2006, 02:49 PM
I´m sure that most people would agree and second that but I´m not sure if it´s a priority or even an objective for the Legacy team. Also, wouldn´t DECORATE need to add an extended thing table or something?. With Hexen on the works it could be a little messy if not planned right.

DarkWolf
February 14th, 2006, 04:56 PM
The projectile's target should be the monster or player that fired the missile.

Danimetal
February 14th, 2006, 05:32 PM
Does that identify in the "Spawnmissile" as the source of the missile?. Wouldn´t that make rockets explode in the mouth of the players?.

Ebola
February 14th, 2006, 05:52 PM
I´m sure that most people would agree and second that but I´m not sure if it´s a priority or even an objective for the Legacy team. Also, wouldn´t DECORATE need to add an extended thing table or something?. With Hexen on the works it could be a little messy if not planned right.

Err, how do you figure that? Decorate is something that was made for Zdoom, Zdoom support all the Doom engine games. So, you are not making any sense.

DarkWolf
February 14th, 2006, 06:06 PM
In the FS command, the trigger of the script is used as the creator of the missile. So if you're spawning the projectiles from a script started with "startscript" then they should belong to player 1.

Danimetal
February 14th, 2006, 06:19 PM
Err, how do you figure that? Decorate is something that was made for Zdoom, Zdoom support all the Doom engine games. So, you are not making any sense.
That´s the whole point of asking questions: to try not to state something that doesn´t make sense. What are you exactly referring to?. For the extended thing table I meant to get free thing numbers to be assigned to DECORATE items (I think it works that way, from 8000 or something?). I´m not sure about the Legacy code supporting that and I´m not sure about the numbers that Hexen will use in V2.0, hence the possible mess if they coincide (not likely).

In the FS command, the trigger of the script is used as the creator of the missile. So if you're spawning the projectiles from a script started with "startscript" then they should belong to player 1.
So, in multiplayer and with an adecuate Codepointer work there would be no problems, I guess. For example, making the missile launcher codepointer trigger a script where the "trigger" fires five missiles will make the player that triggered it fire them... The only thing that could be a concern is that Legacy could mess with several instances of the script running at the same time but I guess they are independent...

Finally, wasn´t there a bug that crashed Legacy when you spawned a lot of things?. Wouldn´t it happen too with spawned projectiles?.

DarkWolf
February 15th, 2006, 06:43 AM
The problem with spawn is that it creates a mapthing (defines where a monster/item spawns at map load) to prevent respawning monsters from crashing (since they need to start where they were first spawned). However, when you remove an object, it doesn't free the memory that's taken up by the mapthing.

I don't believe spawnmissile has this problem since projectiles aren't respawned.

And the as long as the codepointer correctly assigns the trigger of the script as the object that called it, everything should work okay (in theory).

Danimetal
February 15th, 2006, 07:12 AM
Darkwolf, I remember you told me that you introduced the setobjposition function in FS precisely to find a route around this problem (or so I think)... Do you think it could be possible to fix it and, if possible, do you think it would be in V2.0?. I tend to think that all problems in v1.42 will be fixed by rewriting the whole code (fun it´s said in other thread that Legacy is dead) but I´m not sure about which ones could be fixed. Maybe I should try to learn coding so I can be useful in a few years.

g6672D
February 15th, 2006, 03:25 PM
The one thing I'd really like to see in FraggleScript is functions since it gets VERY messy with globals.

DarkWolf
February 15th, 2006, 07:33 PM
There are a few different ways it could be addressed. Hopefully the problem won't translate into v2.0.