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

Jump to content

  • 124 Pages +
  • « First
  • 54
  • 55
  • 56
  • 57
  • 58
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   Danukem 

  • Duke Plus Developer

#1651

View PostMr. Alias Nameless, on 04 September 2015 - 12:34 AM, said:

Hello everyone! Is it possible to monitor a player touches the wall or not?
I tried ifawayfromwall - works only on border of two sectors. On a step for example. If to stand at a wall, distance too big. Player too thick


You can use hitscan, but it's not easy. You would have to scan from the player's position at at least two different heights and many different angles. Then check the return values. If one of the scans hit a wall at nearby coordinates, then the player is "touching" the wall. If you require the player to be facing the wall, then it's only a few scans. I have some code which does this as part of the mantle check in DukePlus.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1652

View PostMr. Alias Nameless, on 04 September 2015 - 12:34 AM, said:

Hello everyone! Is it possible to monitor a player touches the wall or not?
I tried ifawayfromwall - works only on border of two sectors. On a step for example. If to stand at a wall, distance too big. Player too thick

http://wiki.eduke32.com/wiki/Htmovflag
0

User is online   Danukem 

  • Duke Plus Developer

#1653

View PostFox, on 05 September 2015 - 01:08 PM, said:



That will help if he wants to know whether the player is pushing against a wall, but if the player is touching a wall without pushing against it, it won't help.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1654

I am thinking of storing the htmovflag from the last time the player moved.
0

User is offline   Mark 

#1655

Hmmm. I wonder if detecting the player pushing a wall could be used in conjunction with another effect for doing something cool with that wall.

This post has been edited by Mark.: 05 September 2015 - 07:50 PM

0

User is offline   Mblackwell 

  • Evil Overlord

#1656

Well, with simple subtraction you could get the wallnum, so... yes!
0

#1657

Hey guys, is there a way to have a sound play when a secret place is discovered? Also, is there a way to make a separate sound for turning Goggles off?
0

User is offline   Jblade 

#1658

 December Man, on 12 September 2015 - 04:50 AM, said:

Hey guys, is there a way to have a sound play when a secret place is discovered? Also, is there a way to make a separate sound for turning Goggles off?

Yeah - I only have time to give you code for the first, the easiest way is to detect if the 'Secret found!' quote is displayed on screen. You can stick this anywhere in the APLAYER actor:
ifvare player[THISACTOR].fta 99 // is a quote being displayed?
{
ifvare player[THISACTOR].ftq 9 // is it the 'secret found!' quote?
	soundonce SECRETFOUND // play this sound
}

I'm sure it would work with checking the sector lotag as well but I haven't tested that.

This post has been edited by Jblade: 12 September 2015 - 05:02 AM

0

#1659

 Jblade, on 12 September 2015 - 05:01 AM, said:

Yeah - I only have time to give you code for the first, the easiest way is to detect if the 'Secret found!' quote is displayed on screen.


Thanks man. I'm a total beginner and I'm learning con editing through eduke wikia and pure trial and error. I guess I figured it out that the way to do it was through detecting the quote, just had no idea how to do it. Thanks again!
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1660

 December Man, on 12 September 2015 - 07:46 AM, said:

Thanks man. I'm a total beginner and I'm learning con editing through eduke wikia and pure trial and error. I guess I figured it out that the way to do it was through detecting the quote, just had no idea how to do it. Thanks again!

Be warned that the quote method will not work if the player has messages turned off with F8.

Unfortunately, I can't find any events that run before the game checks for sector lotag 32767 and sets it to zero, but this is the best I can do:

gamevar previous_secret_rooms 0 1

onevent EVENT_GAME
    ifactor APLAYER
    {
        ifvarvarg player[THISACTOR].secret_rooms previous_secret_rooms
            globalsound BAR_MUSIC

        getplayer[THISACTOR].secret_rooms previous_secret_rooms
    }
endevent

2

#1661

 Hendricks266, on 12 September 2015 - 09:09 AM, said:

Be warned that the quote method will not work if the player has messages turned off with F8.


Makes sense. Thanks man.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1662

 Hendricks266, on 12 September 2015 - 09:09 AM, said:

but this is the best I can do:

It's flawless as far I can tell, except for some multiplayer nuisances.
0

#1663

Don't wanna outstay my welcome, but is it possible to implement a sound when Duke is drowning (losing HP) and a different sound when he gets out of the water after he was drowning - different than when he wasn't?
0

User is offline   Mblackwell 

  • Evil Overlord

#1664

If you check http://wiki.eduke32.com/wiki/Airleft that should give you a signal to let you play a sound. Like the previous code it's best to check both if it's 0 (drowning) and then save the last value and see if it was also zero. If the current value is non-zero but the previous value was then you know to play a gasping sound or whatever you have planned.
0

#1665

 Mblackwell, on 13 September 2015 - 10:55 AM, said:

If you check http://wiki.eduke32.com/wiki/Airleft that should give you a signal to let you play a sound. Like the previous code it's best to check both if it's 0 (drowning) and then save the last value and see if it was also zero. If the current value is non-zero but the previous value was then you know to play a gasping sound or whatever you have planned.


Ok, now I know what, but I don't know how. Sorry.
0

User is offline   Mblackwell 

  • Evil Overlord

#1666

... If it's 0 then you are out of air.

eg
gamevar AIR_LEFT 0 1
gamevar AIR_LEFT_LAST 0 1
onevent EVENT_GAME
    ifactor APLAYER
    {
        getplayer[THISACTOR].airleft AIR_LEFT
       
        ifvarvarn AIR_LEFT AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0
            soundonce MY_GASP_SOUND
        else ifvare AIR_LEFT 0
            soundonce MY_DROWNING_SOUND
        
        setvarvar AIR_LEFT_LAST AIR_LEFT
    }
endevent

0

#1667

 Mblackwell, on 15 September 2015 - 03:21 PM, said:

... If it's 0 then you are out of air.


Thanks for your patience, however at the beginning of the first level of an episode or a user level the gasp for air (not drowning) sound can be heard. Subsequent levels for some reason do not have this problem.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1668

 Mblackwell, on 15 September 2015 - 03:21 PM, said:

gamevar AIR_LEFT 0 1
gamevar AIR_LEFT_LAST 0 1
onevent EVENT_GAME
    ifactor APLAYER
    {
        getplayer[THISACTOR].airleft AIR_LEFT
       
        ifvarvarn AIR_LEFT AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0
            soundonce MY_GASP_SOUND
        else ifvare AIR_LEFT 0
            soundonce MY_DROWNING_SOUND
        
        setvarvar AIR_LEFT_LAST AIR_LEFT
    }
endevent


Fixes:
AIR_LEFT doesn't need to be per-player. Its value isn't kept between tics.
The sound kept playing after the player dies from drowning.
The bug mentioned above.

gamevar temp 0 0
gamevar AIR_LEFT_LAST -1 1

onevent EVENT_GAME
    ifactor APLAYER
    {
        getplayer[THISACTOR].airleft temp

        ifvare AIR_LEFT_LAST -1
            setvarvar AIR_LEFT_LAST temp

        ifvarvarn temp AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0
            soundonce BAR_MUSIC
        else ifvare temp 0
            ifp palive
                soundonce DUKE_KILLED1

        setvarvar AIR_LEFT_LAST temp
    }
endevent

0

#1669

It works! Thanks much!
0

#1670

Is it possible to detect what render mode is being used from within a CON file ? Specifically, I have a above + under water TROR sectors (which are also part of a more complex TROR map) and to stop HOM effects in software render mode I need to change the water texture to solid instead of transparent; i'm hoping that this can be accomplished via a CON file.

TTFN,
Jon
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1671

Yes.

http://wiki.eduke32.com/wiki/Rendmode
1

#1672

 Fox, on 21 September 2015 - 11:55 AM, said:



Cheers Fox :) I checked all the usual haunts on Eduke wiki but they didn't list it. [Feeble excuses]I checked the pre-defined gamevars just didn't think to look in Constantly updated gamevars as simply assumed it wasn't something that'd get updated and I'd used "rendermode" as me google search[/Feeble excuses].

D'Oh!

TTFN,
Jon
0

User is offline   Daedolon 

  • Ancient Blood God

#1673

Tbh, rendmode sounds like something that would belong in Die by the Sword.
0

User is offline   NightFright 

  • The Truth is in here

#1674

I am looking for a method to display some info text at the beginning of each map.

What it's supposed to do:
- Info about the map (in my case: map name, author, creation year)
- Shown after loading of every map (i.e. when you start a new level)
- Duration: 5 secs
- Style: Ideally with the same font of status/pickup/etc messages, centered

Question is: Can it be done (I guess it can), and if so, how? ^^

This post has been edited by NightFright: 22 September 2015 - 07:56 AM

0

User is offline   Jenz/Amaka 

#1675

I got three questions I'd love to know how.
How to modify weapon stats? Like how fast it shoots, what art it loads and etc. For example, changing Devastator's firing speed to be much slower and also its rockets to make them bigger.

How can I fully copy of an enemy but with different skin? I'd like to have fully copy ALIZ for example. I got two soldiers one is male and other is female.

How do I remove intro video? Is there way to just add con code or do I just need 1 millisecond long video replacement?
0

User is offline   Daedolon 

  • Ancient Blood God

#1676

For the weapon functionality, check the weaponx variables over at Category:Pre-defined_gamevars

Then when you're ready to edit the actual stuff the weapons emit, check Defineprojectile.

For skipping the intro video, check the LOGO_FLAGS. It defaults to 255, so if you want to remove, say the LOGO_DUKENUKEM, you remove 32 from the value.

This post has been edited by Daedolon: 24 September 2015 - 10:49 AM

1

User is offline   Jenz/Amaka 

#1677

 Daedolon, on 24 September 2015 - 10:43 AM, said:

For skipping the intro video, check the LOGO_FLAGS. It defaults to 255, so if you want to remove, say the LOGO_DUKENUKEM, you remove 32 from the value.


So how I would type it?
gamevar LOGO_DUKENUKEM 0 0
?
Not good with CON coding.
0

User is offline   NightFright 

  • The Truth is in here

#1678

I am using this in the addon compilation as well. I disable all cutscenes with gamevar LOGO_FLAGS 2095359 0.
If you want to deactivate LOGO_DUKENUKEM which has a value of 32, you deduct that from 255 and use it like this: gamevar LOGO_FLAGS 223 0.

Following the wiki, all these bits are already set by default:
1 - LOGO_ENABLED
2 - LOGO_PLAYANIM
4 - LOGO_PLAYMUSIC
8 - LOGO_3DRSCREEN
16 - LOGO_TITLESCREEN
32 - LOGO_DUKENUKEM
64 - LOGO_THREEDEE
128 - LOGO_PLUTOPAKSPRITE

Add the values and you have 255. That's the default. If you go above that, e.g. in order to put LOGO_SHAREWARESCREENS (256), it is 256+255, so: gamevar LOGO_FLAGS 511 0. You can combine modifications, then you have to add more values. For example, if you don't want the ep.1 and ep.2 cutscenes to show, you use these:

4096 - LOGO_NOE1BONUSSCENE
8192 - LOGO_NOE2BONUSSCENE

Adding them is 12288, so 12288+255 = 12543. Result: gamevar LOGO_FLAGS 12543 0.

Bottom line is: Add conditions by adding values, remove them by subtracting values. It's a bit tricky with the "NO" entries (LOGO_NOE1BONUSSCENE, LOGO_NODUKETEAMTEXT etc) since in those cases you have to add values to remove something, but you get the hang of it quickly. Please correct me if I am wrong here.

This post has been edited by NightFright: 25 September 2015 - 12:13 AM

1

User is offline   Daedolon 

  • Ancient Blood God

#1679

For some quick profit, just set the variable to 5 0.
1

User is offline   Jenz/Amaka 

#1680

Um, I must be missing something. I tried adding...

gamevar LOGO_FLAGS 2095359 0
in GAME.CON and my own custom .CON to disable all cutscenes but nothing. They all still show up.
Then I tried
gamevar LOGO_FLAGS 223 0
to disable Duke Nukem text appearing but it still shows up.
So then..
gamevar LOGO_FLAGS 251 0
to disable menu music but that didn't work either. What did I miss?


Oh ffs. Nevermind. It's working exactly as it should. Thanks guys. I forked up.

This post has been edited by Jenz/Amaka: 26 September 2015 - 12:41 AM

0

Share this topic:


  • 124 Pages +
  • « First
  • 54
  • 55
  • 56
  • 57
  • 58
  • 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