How i make when a tool hurt me, my screen turns blue?
How i make when a tool hurt me, my screen turns blue?
Only i want to change the color, that don't be red, that be blue or a random color!
How i do that?
How i do that?
Have a nice day! :D
- Calinou
- Moderator
- Posts: 3169
- Joined: Mon Aug 01, 2011 14:26
- GitHub: Calinou
- IRC: Calinou
- In-game: Calinou
- Location: Troyes, France
- Contact:
Re: How i make when a tool hurt me, my screen turns blue?
Changing the hurt flash color/effect is currently not possible without modifying the engine.
- azekill_DIABLO
- Member
- Posts: 7507
- Joined: Wed Oct 29, 2014 20:05
- GitHub: azekillDIABLO
- In-game: azekill_DIABLO
- Location: OMICRON
- Contact:
Re: How i make when a tool hurt me, my screen turns blue?
*cries*
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!
DMs are always open if you want to get in touch!
Re: How i make when a tool hurt me, my screen turns blue?
Like this?
it replacing the red flash effect with randomly colors
it replacing the red flash effect with randomly colors
Code: Select all
minetest.register_on_player_hpchange(function(player, hp_change)
if hp_change<0 then
local name=player:get_player_name()
minetest.after(0, function(name,player)
local r,g,b=screencolor.rndhexcolor(),screencolor.rndhexcolor(),screencolor.rndhexcolor()
screencolor.user[name]=player:hud_add({
hud_elem_type = "image",
text ="screencolor_scr.png^[colorize:#" .. r .. g .. b .. "aa",
name = "rndcsc",
scale = {x=-100, y=-100},
position = {x=0, y=0},
alignment = {x=1, y=1},
})
end,name,player)
minetest.after(0.8, function(name,player)
player:hud_remove(screencolor.user[name])
screencolor.user[name]=nil
end,name,player)
end
end)
screencolor={user={}}
--screencolor.user[name] then id is stored as a global var if you want to use it to somthing
function screencolor.rndhexcolor()
local a="0123456789ABCDEF"
local a1=math.random(1,16)
local a2=math.random(1,16)
return string.sub(a,a1,a1) .. string.sub(a,a2,a2)
end
- Attachments
-
- screencolors.zip
- (995 Bytes) Downloaded 42 times
-
- screenshot_20160514sssa_223918.png (692.41 KiB) Viewed 313 times
- ExeterDad
- Member
- Posts: 1717
- Joined: Sun Jun 01, 2014 20:00
- In-game: ExeterDad
- Location: New Hampshire U.S.A
Re: How i make when a tool hurt me, my screen turns blue?
I am totally saving that snippet for later! Awesome!UjEdwin wrote:Like this?
it replacing the red flash effect with randomly colors[/code]
HOMETOWN -Our little server. Keep the HOMETOWN chatter @ http://hometownserver.com - Our server map: http://media.hometownserver.com
-
- Member
- Posts: 940
- Joined: Tue Aug 05, 2014 14:09
- GitHub: MinetestForFun
- IRC: MinetestForFun
- In-game: MinetestForFun
- Location: On earth
- Contact:
Re: How i make when a tool hurt me, my screen turns blue?
@UjEdwin
Exellent idea, thank you for the tip !
Exellent idea, thank you for the tip !
MinetestForFun Team mods : [spidermob] [fishing]
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
Re: How i make when a tool hurt me, my screen turns blue?
many things is possible in minetest, even people dont know it :-)
- azekill_DIABLO
- Member
- Posts: 7507
- Joined: Wed Oct 29, 2014 20:05
- GitHub: azekillDIABLO
- In-game: azekill_DIABLO
- Location: OMICRON
- Contact:
Re: How i make when a tool hurt me, my screen turns blue?
this is true ;)UjEdwin wrote:many things is possible in minetest, even people dont know it :-)
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!
DMs are always open if you want to get in touch!
Re: How i make when a tool hurt me, my screen turns blue?
Yay!
For the positivism quotes!
For the positivism quotes!
Have a nice day! :D
Re: How i make when a tool hurt me, my screen turns blue?
A question, how to make exactly white?
I mean if you can setup what color turns the screen when you are in lava, how you can't do it with a tool?
I mean if you can setup what color turns the screen when you are in lava, how you can't do it with a tool?
Have a nice day! :D
Re: How i make when a tool hurt me, my screen turns blue?
you can do it with everything that works with the code :-)
the screencolor.rndhexcolor() makes a random code (0 to F)
image.png^add_effect_or_image
How hex/colors works:
the last 6 numbers is replaced with letters
0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15
0.1.2.3.4.5.6.7.8.9..A..B...C...D..E..F
so 3E = 3*14
red,green,blue,alpha
NN.NN.NN.NN
......................red....green...blue....alpha
3EFFBCFF = 3*14, 15*15,11*12, 15*15
so FFFFFFFF = full,full,full,ful = 100% white
the screencolor.rndhexcolor() makes a random code (0 to F)
image.png^add_effect_or_image
How hex/colors works:
the last 6 numbers is replaced with letters
0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15
0.1.2.3.4.5.6.7.8.9..A..B...C...D..E..F
so 3E = 3*14
red,green,blue,alpha
NN.NN.NN.NN
......................red....green...blue....alpha
3EFFBCFF = 3*14, 15*15,11*12, 15*15
so FFFFFFFF = full,full,full,ful = 100% white
Who is online
Users browsing this forum: No registered users and 2 guests