View Full Version : Nightvision to Pal 0?
dcxboxfreak
02-03-2008, 09:52 AM
Is it possible to change the green palette of the nighvision to pal 0? Like nothing happens when you push the button. Because I'm making a flashlight, not a flashlight that everything becomes bright, a flashlight with a sphere thingy, I donno how you call that.
Cheers
Usurper
02-03-2008, 10:30 AM
Could redefine the palette in the duke3d.def file.
If you're using 8-bit mode, well, you have openglbuildtouch and my pity.
dcxboxfreak
02-03-2008, 01:26 PM
Could redefine the palette in the duke3d.def file.
If you're using 8-bit mode, well, you have openglbuildtouch and my pity.
And how can I redefine the pal, how do you do that. Cuz i'm not that familiar with the def language. If somebody is kind enough to write down a line of code I would be very happy:)
Dopefish7590
02-03-2008, 03:03 PM
the eduke32 wiki is your friend :)
http://wiki.eduke32.com/wiki/DEF_Language
DeeperThought
02-03-2008, 04:28 PM
I think he should leave the nightvision goggles alone and use the Duke Plus lighting code to make the flashlight. The flares could easily be replaced with a flashlight (replace the flare model, and maybe allow the player to shoot while using it).
dcxboxfreak
02-05-2008, 05:13 AM
Hello, I still haven't figured out how I can fix my problem. I tried the Dukeplus idea Deeperthought but still...
This is what my code looks like:
actor APLAYER MAXPLAYERHEALTH PSTAND 0 0
getplayer[THISACTOR].heat_on pusinggoggles
ifvare pusinggoggles 1
{
quote 136 // Picture of that flashlight sphere thingy (high-res)
cstat 2
}
// Rest of APLAYER code continues here...
The 2 screens below are how it looks like. The first picture is the one how it looks now: everything green, like the nightvision. The second picture is how it has to look like: nothing green, just a normal flashlight, white.
I hope someone can figure out now how I can solve my problem.
Roma Loom
02-05-2008, 05:55 AM
How did you manage to put Silent Hill 3 Heaven's Night room mesh into polymost engine?
dcxboxfreak
02-05-2008, 06:53 AM
How did you manage to put Silent Hill 3 Heaven's Night room mesh into polymost engine?
Silent Hill 2 textures rip, some models ripped, made the room in mapster32, and tadaa you got Heaven's Night from SH2 and 3.
Roma Loom
02-05-2008, 07:45 AM
:kosher:
Usurper
02-05-2008, 04:56 PM
If you want to override the NVG palette entirely, for the whole mod, edit the line about pal 6 in duke3d.def to read as follows:
tint { pal 6 red 255 green 255 blue 255 flags 0 }
Heck, it probably would work to just take out the definition for pal 6 entirely as well.
If you want to keep the palette for use in the map, but not with the goggles, you could override the default goggle behavior with the event system, specifically EVENT_USENIGHTVISION (http://wiki.eduke32.com/wiki/EVENT_USENIGHTVISION). Setting the RETURN var to -1 will, if I remember correctly, disable the default behavior if you put it in that event. You can replace it with the behavior you want then.
dcxboxfreak
02-06-2008, 04:09 AM
If you want to override the NVG palette entirely, for the whole mod, edit the line about pal 6 in duke3d.def to read as follows:
tint { pal 6 red 255 green 255 blue 255 flags 0 }
Heck, it probably would work to just take out the definition for pal 6 entirely as well.
If you want to keep the palette for use in the map, but not with the goggles, you could override the default goggle behavior with the event system, specifically EVENT_USENIGHTVISION (http://wiki.eduke32.com/wiki/EVENT_USENIGHTVISION). Setting the RETURN var to -1 will, if I remember correctly, disable the default behavior if you put it in that event. You can replace it with the behavior you want then.
Thanks man! I'll try it immediatly!
EDIT: hmm, I tried what you gave me but it seems like that the first option doesn't work. I don't get it either. I don't acctually know what you mean by the second option.
onevent EVENT_USENIGHTVISION
setvar RETURN -1
endevent
But that would just disable the nightvision.
Usurper
02-06-2008, 04:47 PM
Are you using the HRP? If so, the duke3d.def that's loading is probably inside the duke3d_hrp.zip file. Otherwise, the one in the root folder should work.
In regards to the event trick, you're right about it disabling NVG, but in addition to putting setvar RETURN -1 in there, you also put the code you DO want to run.
You're using the old quote system for the display, so I'll use that for the example so you can follow along more easily. I do recommend switching to either myosxpal or rotatesprite for drawing the image.
Start your aplayer code out more like this:
actor APLAYER MAXPLAYERHEALTH PSTAND 0 0
ifvare pusinggoggles 1
{
quote 136 // Picture of that flashlight sphere thingy (high-res)
}
else { }
Then make the event look like this:
onevent EVENT_USENIGHTVISION
setvar RETURN -1
ifvare pusinggoggles 1 { setvar pusinggoggles 0 }
else ifvare pusinggoggles 0 { setvar pusinggoggles 1 }
endevent
That chunk just toggles the gamevar off (0) and on (1).
dcxboxfreak
02-07-2008, 05:18 AM
Are you using the HRP? If so, the duke3d.def that's loading is probably inside the duke3d_hrp.zip file. Otherwise, the one in the root folder should work.
In regards to the event trick, you're right about it disabling NVG, but in addition to putting setvar RETURN -1 in there, you also put the code you DO want to run.
You're using the old quote system for the display, so I'll use that for the example so you can follow along more easily. I do recommend switching to either myosxpal or rotatesprite for drawing the image.
Start your aplayer code out more like this:
actor APLAYER MAXPLAYERHEALTH PSTAND 0 0
ifvare pusinggoggles 1
{
quote 136 // Picture of that flashlight sphere thingy (high-res)
}
else { }
Then make the event look like this:
onevent EVENT_USENIGHTVISION
setvar RETURN -1
ifvare pusinggoggles 1 { setvar pusinggoggles 0 }
else ifvare pusinggoggles 0 { setvar pusinggoggles 1 }
endevent
That chunk just toggles the gamevar off (0) and on (1).
Hmm, now something really weird happens. I can use the NVG when I don't have them and when I want to turn it off, I have to wait around 4 sec before it fades out (I think it has something to do with the quote system because quotes are showning for 4sec on the screen). The pal is right, it isnt showing green anymore so thats one good thing:)
DeeperThought
02-07-2008, 10:55 AM
It sounds like the event triggers when the key is pressed, as opposed to triggering only when you have the item and the key is pressed.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.