Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 124 Pages +
  • « First
  • 66
  • 67
  • 68
  • 69
  • 70
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Hendricks266 

  • Weaponized Autism

  #2004

With EVENT_SOUND you can intercept and replace sounds by checking and setting RETURN.
0

User is offline   David B. 

#2005

After some work I finally managed to make a well-functioning script for an operable door sytem (rotating or whatsoever) in both directions.
I have chosen to add tiles for the closing animation in the model instead of using backward animation in the script.

I'm posting it in case someone else would be interested by the script. Here's the feedback :

action OPENING 1 8 1 1 0
action CLOSING 10 8 1 1 0

useractor notenemy OPERABLE_DOOR1

ifaction 0 ifpdistl 1800 ifcansee ifhitspace {
    soundonce 450
    action OPENING
    cstat 0
}

ifactioncount 30 ifaction OPENING ifpdistl 1800 ifcansee ifhitspace { 
    soundonce 455
    action CLOSING
    cstat 1
}

ifactioncount 30 ifaction CLOSING ifpdistl 1800 ifcansee ifhitspace { 
    soundonce 450
    action OPENING
    cstat 0
}
enda 

Thank you guys.

This post has been edited by David B.: 01 July 2017 - 11:21 AM

0

User is offline   David B. 

#2006

Hi everyone

Is it possible to control a point light (SE49) with a script ? I need a way to light up a room with real light source, when a switch is used.
0

User is online   Mark 

#2007

Switch controlled lights are one of the many features of a mod by High Treason called CONfetti. A search in the forums should take you to the thread. There may even be a YT video showcasing it.

This post has been edited by Mark.: 25 July 2017 - 11:44 AM

1

User is offline   David B. 

#2008

I've tested it, that's what I was looking for... ok thanks.
0

User is offline   David B. 

#2009

Hi everyone

How to control a SE (SE12 in my case for controlling the lighting of a room) with a custom light switch model ? (I know how to do for activators but I haven't found nothing for SE).
In fact I need a model because it must also execute other stuffs like change the picnum of the wall-light model (5439 to 5440, the last being defined with a glow map when the room is bright).

eventloadactor SWITCH
    getactor[THISACTOR].lotag SPRITE_LOTAG  // = SECTOR EFFECTOR CHANNEL
    setactor[THISACTOR].lotag 0
enda

useractor notenemy SWITCH
    [...]

    ifvare MODE 1 ifhitspace ifcansee {    // MODE 1 being conditions like facing it, being close to it, ... don't worry.
         operatemasterswitches SPRITE_LOTAG  // Is there a right command for what I want ?
    // OR :
         operateactivators SPRITE_LOTAG 0 // doesn't work neither as SE is not an activator of course;)
    }
 enda



-Subsidiary issue : is it possible to activate a glow map on a model directly by a script instead of defining two wall-light models and switching their picnum ?

This post has been edited by David B.: 01 August 2017 - 07:59 AM

0

User is online   Mark 

#2010

Make the lamp model with a 2 frames. Frame 1 will have the dark lens surface in front. Frame 2 will have the bright lens surface in front. In frame 1 the bright lens will be shrunk and behind the dull lens. In frame 2, the opposite. The dark lens will be behind the bright one. Then use your code of your choice for which frame will display. Its like how muzzle flashes are shrunk and hidden inside the mesh until they are needed.

This post has been edited by Mark.: 01 August 2017 - 10:01 AM

0

User is offline   David B. 

#2011

View PostMark., on 01 August 2017 - 09:59 AM, said:

Make the lamp model with a 2 frames. Frame 1 will have the dark lens surface in front. Frame 2 will have the bright lens surface in front. In frame 1 the bright lens will be shrunk and behind the dull lens. In frame 2, the opposite. The dark lens will be behind the bright one. Then use your code of your choice for which frame will display. Its like how muzzle flashes are shrunk and hidden inside the mesh until they are needed.
I'm not sure if you mean double the meshes, then I would have two lampshades into the model with one textured brighter than the other ?
0

User is online   Mark 

#2012

I thought it might be a simple lamp with a plastic lens that you could swap back and forth. But if its a lamp with fancy shade the switch between 2 shade meshes might be a viewable glitch. Instead, could you put a point light inside or outside the shade to light it when the switch is flipped? You are using Confetti, right?

This post has been edited by Mark.: 01 August 2017 - 11:59 AM

0

User is offline   David B. 

#2013

View PostMark., on 01 August 2017 - 11:57 AM, said:

I thought it might be a simple lamp with a plastic lens that you could swap back and forth. But if its a lamp with fancy shade the switch between 2 shade meshes might be a viewable glitch. Instead, could you put a point light inside or outside the shade to light it when the switch is flipped? You are using Confetti, right?
Yes I'm using it, I already tried to put a SE49 inside the lamp but it doesn't light it properly, the model lamp remains bleak.
0

User is offline   Danukem 

  • Duke Plus Developer

#2014

View PostDavid B., on 02 August 2017 - 12:59 AM, said:

Yes I'm using it, I already tried to put a SE49 inside the lamp but it doesn't light it properly, the model lamp remains bleak.


You need to use spritenoshade on the lamp model tile number, then code the lamp to switch between normal shade value and full bright shade (-127) depending on whether it is "lit".
0

User is online   Mark 

#2015

TD's idea is a good one. This is what I had in mind from my first post. I have no idea what your lamp looks like. Or if its on a table, wall or what. My idea works as long as the player does not have access to move 360 degrees around the lamp becasue the backside won't be lit. But then you could add a second small light to illuminate the backside. Tiny point lights like that don't bog framerate down. I don't mind the little hard ball of light because of the se being so close to the model.

Attached thumbnail(s)

  • Attached Image: LAMPSHADE.jpg


This post has been edited by Mark.: 03 August 2017 - 02:22 PM

0

User is offline   Kyanos 

#2016

I'd make two versions of the skin and switch between them. Changing the shade value is probably good, but you'd get more details into a second skin.
0

User is offline   David B. 

#2017

Here is the situation (see pics below) :

Even after placing some SE49 or 50 in the model, the lamp is not bright enough when it's "on", so I need to define a glow map and maybe working with two models, one has the glow, the other not.
But Confetti work with original switches from duke nukem and I don't know how they are hardcoded so to control the SE12.

Also I tried to add a script to the LIGHTSWITCH2 but this make it disappear from the game.
This was the script I started :

useractor notenemy LIGHTSWITCH2
	ifp pfacing ifcansee ifhitspace ifpdistl 512 {
		getactor[THISACTOR].pal SIGNAL_ON
	}
enda

My idea was getting the pal number of the switch and use it as a channel, and furtherly link it to the lamp with the same matching pal number (so the engine finds the right model in the map and changes its picnum when the global variable SIGNAL_ON is greater than zero).
That was the point.

Attached thumbnail(s)

  • Attached Image: mapster.jpg
  • Attached Image: comparaison.jpg


This post has been edited by David B.: 04 August 2017 - 06:21 AM

0

User is offline   David B. 

#2018

View PostDrek, on 03 August 2017 - 02:25 PM, said:

I'd make two versions of the skin and switch between them. Changing the shade value is probably good, but you'd get more details into a second skin.
Yes, I should change the pal number of the lamp model to change its skin (that's maybe easier than define two models with a glow map) ; but I don't know how to add a script to LIGHTSWITCH2 or how to make my own script with a custom lighswitch so this one will have the same ability to control the SE12. I don't know if it's clear...

This post has been edited by David B.: 04 August 2017 - 06:21 AM

0

User is offline   Jblade 

#2019

Easiest way I can think of doing it would be to check the shading of the sector that it's in and change the lamp based on that.

something like:
ifvarl sector[THISACTOR].floorshade 10 spritepal 3
else spritepal 0

Basically this would just detect if the sector is at a certain shade level (say under 10) and then change the sprite's skin to your lit version. You can of course change the 10 to whatever value you set the lit sector to. If this works and you want a more flexible version of the code, just ask again and I can whip something up for you.
1

User is offline   David B. 

#2020

View PostJblade, on 04 August 2017 - 11:04 AM, said:

Easiest way I can think of doing it would be to check the shading of the sector that it's in and change the lamp based on that.

something like:
ifvarl sector[THISACTOR].floorshade 10 spritepal 3
else spritepal 0

Basically this would just detect if the sector is at a certain shade level (say under 10) and then change the sprite's skin to your lit version. You can of course change the 10 to whatever value you set the lit sector to. If this works and you want a more flexible version of the code, just ask again and I can whip something up for you.
That's what I needed, this control the model with the floorshade. I didn't know that way. Thanks
1

User is offline   Zaxtor 

#2021

How do we replace this?

It comes after the final clips when u finish an EP etc.

How do we remove dis and ore replace it?
Posted Image

This post has been edited by Zaxtor: 19 August 2017 - 10:37 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#2022

View PostZaxtor, on 19 August 2017 - 10:37 AM, said:

How do we replace this?


I'm not sure, but it might be the NODUKETEAMTEXT bit on the predefined LOGO_FLAGS gamevar. You can declare it with a different value and see what happens.

http://wiki.eduke32....wiki/LOGO_FLAGS

Specifically, include this line in your var declarations:

gamevar LOGO_FLAGS 524544 0
0

User is offline   Zaxtor 

#2023

i tried, wont work.

if I put "gamevar LOGO_FLAGS 524544 0 " it disables all clips.

if I do
gamevar NODUKETEAMTEXT 524288 0
and

gamevar NODUKETEAMTEXT 524544 0
it wont work
0

User is offline   Danukem 

  • Duke Plus Developer

#2024

I don't know if any of those bits actually disable that particular text, and I don't feel like testing it out. However, there are surely other solutions. If that text displays upon completion of a specific episode, then you can use CON commands to change the episode number when the player completes it, to prevent displaying it. You can use gametext or other commands to display your own text instead, before that point.
0

User is offline   Zaxtor 

#2025

My mode is on EP4
Cus EP4 accepts "level placements without warping you to wrong level when you hit nuke button after going through 3 secret levels etc, (sector you walk in to finish level etc).

Dunno if they fixed it on Duke's today standard.

I remember in Oblivion level placements on EP1 were "weird" to have more levels than the EP1 limit.

This post has been edited by Zaxtor: 19 August 2017 - 03:08 PM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #2026

gamevar LOGO_FLAGS 524543 0

255 (the default) plus 524288.
1

User is offline   Zaxtor 

#2027

Worked, thx.
Got rid of it.
Had to remove the musicname.voc to get rid of the duke music when was dark screen but music still present.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #2028

Does your mod have a DUKETEAM.ANM (or .IVF)?
0

User is offline   Danukem 

  • Duke Plus Developer

#2029

View PostHendricks266, on 19 August 2017 - 04:56 PM, said:

gamevar LOGO_FLAGS 524543 0

255 (the default) plus 524288.


Oops I had added 256 instead of 255.
0

User is offline   Zaxtor 

#2030

neither has it.
Was gonna pic the arctic still pic, didn't work but scrapped it.

Ending is pretty long tho so is ok.
0

User is offline   Zaxtor 

#2031

when you lockplayer xx
it says (except the ability to look up/down with the mouse)
is there a locking code to temporarily lock mouse movements too?
0

User is online   Mark 

#2032

This is from a conversation I had with someone not too long ago that might get you started in the right direction.
"you should setplayer[THISACTOR].weapon_pos 1 and also setplayer[THISACTOR].jumping_counter 0
and maybe setinput[].horz 0 maybe even setinput[].bits 0
should keep the player from doing anything when lockplayer is active
firing a gun or jumping
looking up and down
etc"
0

User is offline   Zaxtor 

#2033

with lock player during scene jump, weaps items, movement etc wont work (as suppose to)
i tried with horz and bits (inside player) no workin
like setinput[THISACTOR].horz 0
and other so nothing happens

This post has been edited by Zaxtor: 26 August 2017 - 01:24 PM

0

Share this topic:


  • 124 Pages +
  • « First
  • 66
  • 67
  • 68
  • 69
  • 70
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options