Lua Questions

Pizza

Member
How do i make a new sprite for charging a bar

How do i make a code to shoot projectiles With a custom sprite for it (the projectile and the character firing it)

How do i make more than one super form for the character or am i limited to one form

Can i make the super color gone and make it the regular colors so when the character transform it retains his previous color

lastly How do i make a code for sliding and destroying enemies gives energy to the bar
 
How do i make a new sprite for charging a bar
Via drawing. Grab your favourite drawing tool and get to it!
Then save it and, assuming you're using SLADE, import it.
If you're creating a WAD file, make sure the sprite is in between S_START and S_END markers.
If you're creating a PK3 file, your sprite has to go somewhere within a Sprites folder.
In both cases, make sure the sprite follows the correct nomenclature.
Here's more detailed information about it.
Afterwards, you have to draw the sprite to the screen.

How do i make a code to shoot projectiles With a custom sprite for it (the projectile and the character firing it)
Depends.
The Lua function P_SPMAngle allows player objects to shoot whatever you want at any angle. An example usage would be P_SPMAngle(player.mo, MT_LASER, player.mo.angle), assuming player is a valid player. Just replace MT_LASER with the correct constant of your custom object.

How do i make more than one super form for the character or am i limited to one form
You are limited to a single super form, yes. You can attempt coding a second super form if you so wish.

Can i make the super color gone and make it the regular colors so when the character transform it retains his previous color
Normally, no, though again, you can code it to do so.

lastly How do i make a code for sliding and destroying enemies gives energy to the bar
Depends...
For sliding, it... depends on how you want to do it.
For the other thing, it depends on however you programmed your energy thing? The usual steps are hooking onto the game with the MobjDamage hook then working from there; Since it runs the code whenever an object is damaged, you can check if the attacker is a player and the victim is an enemy, and if so, give the player energy.
 
Last edited:
Thank you for replying

Forgive me if i wasn't clear, i meant a character sprite to which when pressed while the bar is charging, the character would do an animation

do you have a sample code for 3 and 4 if not i shall try to figure it out

Sliding kinda like how modern sonic did it

Thank you i shall try out the rest soon
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top