That would replace it for Fang's pop gun too.Replace the already existing SRB2 Homing Marker, easy.
oh ok i just keept it their for code ill remove it lolUhh why is there a character
Thats not very legal
With the use of P_LookForEnemies(), you could store the closest enemy into a variable, then use P_SpawnLockOn() to draw a lock-on target over the enemy's head.hello so on my mod, (witch i already had help on) i want to put a custom homing marker instade of the triangle that aprease, any help?
the homing marker sprite i want to use is below the mod is also below
freeslot("SPR_EXMP", "S_CUSTOMMARKER") -- SPR_EXMP and S_CUSTOMMARKER can be swapped out for whatever names you think fit best. SPR_* constants have to use four letters, whereas states can use around 24 afaik
states[S_CUSTOMMARKER] = {
sprite = SPR_EXMP,
frame = A,
duration = -1,
nextstate = S_CUSTOMMARKER
}
addHook("PlayerThink", function(player)
if player.mo and player.mo.skin == "skinname" then -- skinname is just a placeholder. Replace it with your character's skin name.
player.lockon = P_LookForEnemies(player) -- Store an enemy into a variable.
if player.lockon and player.lockon.valid then -- Does the enemy exist?
P_SpawnLockon(player, player.lockon, S_CUSTOMMARKER) -- Spawn a lock-on target with our custom sprite.
end
end
end)
That would make it never disappear though. I'd recommend doing the following changes:With the use of P_LookForEnemies(), you could store the closest enemy into a variable, then use P_SpawnLockOn() to draw a lock-on target over the enemy's head.
Example Code:freeslot("SPR_EXMP", "S_CUSTOMMARKER") -- SPR_EXMP and S_CUSTOMMARKER can be swapped out for whatever names you think fit best. SPR_* constants have to use four letters, whereas states can use around 24 afaik states[S_CUSTOMMARKER] = { sprite = SPR_EXMP, frame = A, duration = -1, nextstate = S_CUSTOMMARKER } addHook("PlayerThink", function(player) if player.mo and player.mo.skin == "skinname" then -- skinname is just a placeholder. Replace it with your character's skin name. player.lockon = P_LookForEnemies(player) -- Store an enemy into a variable. if player.lockon and player.lockon.valid then -- Does the enemy exist? P_SpawnLockon(player, player.lockon, S_CUSTOMMARKER) -- Spawn a lock-on target with our custom sprite. end end end)
states[S_CUSTOMMARKER] = {
sprite = SPR_EXMP,
frame = A,
duration = 2, -- It appears for at least one frame
nextstate = S_NULL -- then disappears
}
-- ...
For the floating above part, wouldn’t you just set an offset for the sprite?That would make it never disappear though. I'd recommend doing the following changes:
Even then, it'd float ABOVE the enemy, soChanged Example Code:states[S_CUSTOMMARKER] = { sprite = SPR_EXMP, frame = A, duration = 2, -- It appears for at least one frame nextstate = S_NULL -- then disappears } -- ...
Still bobs up and down.For the floating above part, wouldn’t you just set an offset for the sprite?
You can’t code it to be still?Still bobs up and down.
You can’t code it to be still?
P_SpawnLockon
doesn't return anything, so no.