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

Jump to content

  • 101 Pages +
  • « First
  • 48
  • 49
  • 50
  • 51
  • 52
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

#1471

How do you add new Ambiance sounds???

This is what I tried to do in my Custom content folder. Do I need to define something in the con files? If so what would I need to do?


// VOC MUSIC/SOUND REPLACEMENTS

Sound { ID 400 file "CustomT/CMusic/Music/Voc/barmusic.ogg" }
Sound { ID 401 file "CustomT/CMusic/Music/Voc/Mario.ogg" }

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1472

http://wiki.eduke32....iki/Definesound

Then you need to add them to MUSICANDSFX sprites in the locations you want each individual sound.
1

#1473

Nice! It works. Thanks!
0

User is offline   OpenMaw 

  • Judge Mental

#1474

Having an issue.

NEVERMIND! Fixed dat business. Used the other form of flashlight code by Darkus which avoids this issue.

Woo.

This post has been edited by Commando Nukem: 21 May 2014 - 12:27 PM

0

User is offline   OpenMaw 

  • Judge Mental

#1475

How does one get the player's name?

I want to display the player's name on screen as part of a new HUD i'm working on. So, whatever the name is for multiplayer, will be displayed on the screen. I can't find anything in the Wiki about this. "Name" was the closest I could find, it and it doesn't do anything.

This is what my code looks like right now:





gamevar NAME 0 1

definequote 254 PLAYERNAME  // Just standin definition.

onevent EVENT_DISPLAYREST
{
getplayer[THISACTOR].Name NAME                                       // Name
redefinequote 254 %d                                                                // Changes quote to display whatever we tell it.
qsprintf 254 254 NAME                                                              // Print does it's mapping voodoo.
gametext STARTALPHANUM 320 10 254 0 0 0 0 0 xdim ydim
}
endevent



I tried using Idplayers too, and it didn't work either. Is there just no way to do this?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1476

getpname
1

User is offline   OpenMaw 

  • Judge Mental

#1477

View PostFox, on 21 May 2014 - 05:06 PM, said:

getpname


You rock.
0

#1478

What all do I need to do to the con file(s) to add new characters? I was wanting to make three different strippers because I was seeing that doing a pal replacement to the originals was making them change with the random lights lol.. The new one appear in the game. But you can't interact or shoot them. Also for some reason even after using editart to add the stripper gif files to the tiles so they work in 8bit as well. Those aren't showing up in build. But my added wall and floor textures are that are not ported to tiles yet are.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1479

If you have def files, you might as well use tilefromtexture instead of messing with EDITART.

Animated gifs don't automatically become animations in ART. You have to define the tiles separately and set the ART animation value (from defs, the animtilerange command).

The CON files are a scripting language containing elements from C and assembly, so there is no simple solution to what you ask. You just need to program it, and if you don't know programming, learning is the only way.
0

User is offline   OpenMaw 

  • Judge Mental

#1480

So i'm working on testing out an idea. I've got other things working more or less the way I want them, but there's something i'm building up to a piece at a time.

Right here, I want to project onto the screen the POV of another object. In this instance a pigcop with a palette of 200. I'm sure this will come off as a bit amusing to some of you, but i'm honestly stumped. http://forums.duke4.net/public/style_emoticons/default/sad.gif




gamevar ptemp 0 2
gamevar ptemp2 0 2

//  ('squadmate') Camera

onevent EVENT_DISPLAYREST
{
	getactor[THISACTOR].picnum ptemp
		ifvare ptemp PIGCOP
			getactor[THISACTOR].pal ptemp2
				ifvare ptemp2 200
				getactor[THISACTOR].x x
				getactor[THISACTOR].y y
				getactor[THISACTOR].z z
				getactor[THISACTOR].ang ang
				// getactor[THISACTOR].horiz horiz
				// getactor[THISACTOR].horizoff temp
				// addvarvar horiz temp
				updatesectorz x y z sect
showviewunbiased x y z ang horiz sect 16 41 56 69
}
endevent


Obviously, this is not working. Oh, It does project a view onto the screen, but it's behind the player.

I'm almost certain I need to call the pig stuff in an EVENT_LOADACTOR and then reference it into the EVENT_DISPLAYREST stuff. I was trying that before and it either wasn't showing up, or was just showing a view from the player's feet.

Note, I commented out a few lines that weren't working (for obvious reasons, they reference a camera setup for a player position.)


So, can someone point me in the right direction?

This post has been edited by Commando Nukem: 23 May 2014 - 01:48 PM

0

#1481

View PostHendricks266, on 22 May 2014 - 12:55 PM, said:

If you have def files, you might as well use tilefromtexture instead of messing with EDITART.

Animated gifs don't automatically become animations in ART. You have to define the tiles separately and set the ART animation value (from defs, the animtilerange command).

The CON files are a scripting language containing elements from C and assembly, so there is no simple solution to what you ask. You just need to program it, and if you don't know programming, learning is the only way.



Using tilesfromtexture would be a hell of a lot faster then loading each individual tile via editart. No I know how to make the 8bit tiles oscillate in editart from when I used to design levels before. It's just weird that when I copied over the tiles file(s) to my eduke folder. Nothing changed.

Guess I need to learn how to program now. It looks a bit like php but without the ; at the end of everything lol
0

User is offline   Mblackwell 

  • Evil Overlord

#1482

View PostCommando Nukem, on 23 May 2014 - 01:47 PM, said:

So i'm working on testing out an idea. I've got other things working more or less the way I want them, but there's something i'm building up to a piece at a time.

Right here, I want to project onto the screen the POV of another object. In this instance a pigcop with a palette of 200. I'm sure this will come off as a bit amusing to some of you, but i'm honestly stumped. http://forums.duke4.net/public/style_emoticons/default/sad.gif




gamevar ptemp 0 2
gamevar ptemp2 0 2

//  ('squadmate') Camera

onevent EVENT_DISPLAYREST
{
	getactor[THISACTOR].picnum ptemp
		ifvare ptemp PIGCOP
			getactor[THISACTOR].pal ptemp2
				ifvare ptemp2 200
				getactor[THISACTOR].x x
				getactor[THISACTOR].y y
				getactor[THISACTOR].z z
				getactor[THISACTOR].ang ang
				// getactor[THISACTOR].horiz horiz
				// getactor[THISACTOR].horizoff temp
				// addvarvar horiz temp
				updatesectorz x y z sect
showviewunbiased x y z ang horiz sect 16 41 56 69
}
endevent


Obviously, this is not working. Oh, It does project a view onto the screen, but it's behind the player.

I'm almost certain I need to call the pig stuff in an EVENT_LOADACTOR and then reference it into the EVENT_DISPLAYREST stuff. I was trying that before and it either wasn't showing up, or was just showing a view from the player's feet.

Note, I commented out a few lines that weren't working (for obvious reasons, they reference a camera setup for a player position.)


So, can someone point me in the right direction?


DISPLAYREST is always called from the player, so it will never be true.

What you want is this

gamevar temp 0 2
gamevar camera_exist -1 1
gamevar camera_x 0 1
gamevar camera_y 0 1
gamevar camera_z 0 1
gamevar camera_horiz 0 1
gamevar camera_sect 0 1

onevent EVENT_DISPLAYREST

    ifvarn camera_exist -1        // we shouldn't display if there's no existing camera actor
        showviewunbiased camera_x camera_y camera_z camera_ang camera_horiz camera_sect 16 41 56 69

endevent

onevent EVENT_GAME
    getactor[THISACTOR].picnum temp
    ifvare temp PIGCOP
    {        
        getactor[THISACTOR].pal temp
        ifvarvare camera_exist THISACTOR ifvarn temp 200 // if the pal is altered somehow we can remove it as the camera
            setvar camera_exist -1
        else ifvare temp 200
        {
            getactor[THISACTOR].x camera_x
            getactor[THISACTOR].y camera_y
            getactor[THISACTOR].z camera_z
            subvar camera_z 8192 // offset until you get to eye level
            getactor[THISACTOR].ang camera_ang
            getactor[THISACTOR].sectnum camera_sect
            setvar camera_horiz 100
            setvarvar camera_exist THISACTOR
        }
    }
endevent

1

User is offline   OpenMaw 

  • Judge Mental

#1483

Ohhh! Thank you. Works like a dream.


Thank you for commenting it too. I'm honestly trying to find my way through and learn CON, as much as lack the natural talent for coding. http://forums.duke4.net/public/style_emoticons/default/biggrin.gif
0

#1484

View PostHendricks266, on 22 May 2014 - 12:55 PM, said:

If you have def files, you might as well use tilefromtexture instead of messing with EDITART.

Animated gifs don't automatically become animations in ART. You have to define the tiles separately and set the ART animation value (from defs, the animtilerange command).

The CON files are a scripting language containing elements from C and assembly, so there is no simple solution to what you ask. You just need to program it, and if you don't know programming, learning is the only way.




Mapster error log below

Error on line 8bit.def:11: expecting symbol, got "0}"
Error on line 8bit.def:13: expecting symbol, got "0}"


Def Code below

// Stripper00 (3504)
tilefromtexture 3504 { file "CustomT/8bit/3504.png" xoffset -2 }
tilefromtexture 3505 { file "CustomT/8bit/3505.png" xoffset -2 }
tilefromtexture 3506 { file "CustomT/8bit/3506.png" xoffset -2 }
tilefromtexture 3507 { file "CustomT/8bit/3507.png" xoffset -2 }
tilefromtexture 3508 { file "CustomT/8bit/3508.png" xoffset -2 }       <<-- Line 11
animtilerange 3404 3508 2 2
                                                                                                <<-- Line 13
tilefromtexture 3509 { file "CustomT/8bit/3509.png" xoffset 0}         // For some reason if I don't define the X they don't appear in the tiles listing.
tilefromtexture 3510 { file "CustomT/8bit/3510.png" xoffset -1 }
tilefromtexture 3511 { file "CustomT/8bit/3511.gif" xoffset 0}            


Tiles appear in mapster. But she doesn't move.

This post has been edited by 1337DirtAlliance: 24 May 2014 - 08:25 AM

0

User is offline   OpenMaw 

  • Judge Mental

#1485

View Post1337DirtAlliance, on 24 May 2014 - 08:25 AM, said:

Mapster error log below

Error on line 8bit.def:11: expecting symbol, got "0}"
Error on line 8bit.def:13: expecting symbol, got "0}"


Def Code below

// Stripper00 (3504)
tilefromtexture 3504 { file "CustomT/8bit/3504.png" xoffset -2 }
tilefromtexture 3505 { file "CustomT/8bit/3505.png" xoffset -2 }
tilefromtexture 3506 { file "CustomT/8bit/3506.png" xoffset -2 }
tilefromtexture 3507 { file "CustomT/8bit/3507.png" xoffset -2 }
tilefromtexture 3508 { file "CustomT/8bit/3508.png" xoffset -2 }   	<<-- Line 11
animtilerange 3404 3508 2 2
                                                                                                <<-- Line 13
tilefromtexture 3509 { file "CustomT/8bit/3509.png" xoffset 0} 		// For some reason if I don't define the X they don't appear in the tiles listing.
tilefromtexture 3510 { file "CustomT/8bit/3510.png" xoffset -1 }
tilefromtexture 3511 { file "CustomT/8bit/3511.gif" xoffset 0}            


Tiles appear in mapster. But she doesn't move.


In the second group, you need a space between the 0 and }'s. :)

This post has been edited by Commando Nukem: 24 May 2014 - 09:07 AM

0

#1486

This is getting annoying now... I stripped out the entire 8bit folder and def and manually injected the sprites via editart and animated them and named them. "This normally works" and when I went into build there was no name for the tiles nor did they animate... No sounds are working also, only a new bar music thats not an overlay of the original surprisingly works. Every other sound doesn't work at all.


<SOLVED> But there is still minor issue

Ended up just saying eat a bag of shit to the duke folder and deleted it. Backed up my content but did a clean install of everything and now it works. Still have animation issues not working tho with the tiles defined in the def. And the spacing issue didn't change anything


Also.. I don't think any of the Warambiance work period. Because I went to upload new ones as an addition. And of course they don't work... tried to see if the normal ones worked,.. nope.

This post has been edited by 1337DirtAlliance: 25 May 2014 - 02:29 PM

0

User is offline   Micky C 

  • Honored Donor

#1487

Yet another attempt to stick my head into the world of eduke scripting.

So as someone who has only ever messed around with structured coding (specifically, fortran and VBA). What are the main differences between that type of programming, and how it's implemented in eduke32? I take it it's more of an object-oriented situation?

While in fortran you can write a block of code like a subroutine, and call it anywhere you want and have it run under certain conditions and a certain number of times, I remember reading somewhere that all the con code runs all the time during the game? Seems a bit different.
Also how sensitive is the code to where its placed in a file?
0

User is offline   Jblade 

#1488

I think the best idea is to crack open the default GAME.CON and take a look around - apart from a bunch of values that need to be defined you could strip the majority of stuff out and the game would work fine. I don't code otherwise so I can't really compare it to any other languages I'm afraid, but I doubt you'll have any trouble coding (especially if you already know other languages)

I remember a conversation a while ago about disabling saving...anybody remember that or could shed some light on it? There's a particular level I want to disable saving on.
0

User is offline   Mblackwell 

  • Evil Overlord

#1489

It's like C and Java meet Visual Basic.


Also there is an http://wiki.eduke32..../EVENT_SAVEGAME but I'm not sure if setting it to RETURN -1 would disable it.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1490

There are comparisons to be made with assembly too--the strictly imperative style and the requirement for global-scope variables.
0

User is offline   Anvil 

#1491

Hello,
I need a code that will cause every level in an episode to start with only 48 bullets of pistol and 100 health.
0

User is offline   Chip 

#1492

View PostAnvil, on 23 July 2014 - 09:44 AM, said:

Hello,
I need a code that will cause every level in an episode to start with only 48 bullets of pistol and 100 health.


This should work:

onevent EVENT_RESETPLAYER
setplayer[THISACTOR].ammo_amount PISTOL_WEAPON 48
setplayer[THISACTOR].ammo_amount SHOTGUN_WEAPON 0
setplayer[THISACTOR].ammo_amount CHAINGUN_WEAPON 0
setplayer[THISACTOR].ammo_amount RPG_WEAPON 0
setplayer[THISACTOR].ammo_amount HANDBOMB_WEAPON 0
setplayer[THISACTOR].ammo_amount SHRINKER_WEAPON 0
setplayer[THISACTOR].ammo_amount GROW_WEAPON 0
setplayer[THISACTOR].ammo_amount DEVISTATOR_WEAPON 0
setplayer[THISACTOR].ammo_amount TRIPBOMB_WEAPON 0
setplayer[THISACTOR].ammo_amount FREEZE_WEAPON 0

setplayer[THISACTOR].gotweapon SHOTGUN_WEAPON 0
setplayer[THISACTOR].gotweapon CHAINGUN_WEAPON 0
setplayer[THISACTOR].gotweapon RPG_WEAPON 0
setplayer[THISACTOR].gotweapon HANDBOMB_WEAPON 0
setplayer[THISACTOR].gotweapon SHRINKER_WEAPON 0
setplayer[THISACTOR].gotweapon GROW_WEAPON 0
setplayer[THISACTOR].gotweapon DEVISTATOR_WEAPON 0
setplayer[THISACTOR].gotweapon TRIPBOMB_WEAPON 0
setplayer[THISACTOR].gotweapon FREEZE_WEAPON 0

setplayer[THISACTOR].last_extra 100
endevent

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1493

I suppose the armor and inventory should also be reset.
0

User is online   Danukem 

  • Duke Plus Developer

#1494

I don't think that setting last_extra on the player will work. I'm pretty sure you need to set extra on the player sprite.
1

User is offline   Anvil 

#1495

I've found the code I've been looking for:

View PostHendricks420, on 17 June 2013 - 11:15 PM, said:

gamevar temp 0 0

onevent EVENT_ENTERLEVEL
getplayer[THISACTOR].i temp
setactor[temp].extra MAXPLAYERHEALTH
setplayer[THISACTOR].shield_amount 0
setplayer[THISACTOR].gotweapon PISTOL_WEAPON 1
setplayer[THISACTOR].gotweapon SHOTGUN_WEAPON 0
setplayer[THISACTOR].gotweapon CHAINGUN_WEAPON 0
setplayer[THISACTOR].gotweapon RPG_WEAPON 0
setplayer[THISACTOR].gotweapon HANDBOMB_WEAPON 0
setplayer[THISACTOR].gotweapon SHRINKER_WEAPON 0
setplayer[THISACTOR].gotweapon DEVISTATOR_WEAPON 0
setplayer[THISACTOR].gotweapon TRIPBOMB_WEAPON 0
setplayer[THISACTOR].gotweapon FREEZE_WEAPON 0
setplayer[THISACTOR].gotweapon GROW_WEAPON 0
setplayer[THISACTOR].ammo_amount PISTOL_WEAPON 48
setplayer[THISACTOR].ammo_amount SHOTGUN_WEAPON 0
setplayer[THISACTOR].ammo_amount CHAINGUN_WEAPON 0
setplayer[THISACTOR].ammo_amount RPG_WEAPON 0
setplayer[THISACTOR].ammo_amount HANDBOMB_WEAPON 0
setplayer[THISACTOR].ammo_amount SHRINKER_WEAPON 0
setplayer[THISACTOR].ammo_amount DEVISTATOR_WEAPON 0
setplayer[THISACTOR].ammo_amount TRIPBOMB_WEAPON 0
setplayer[THISACTOR].ammo_amount FREEZE_WEAPON 0
setplayer[THISACTOR].ammo_amount GROW_WEAPON 0
setplayer[THISACTOR].boot_amount 0
setplayer[THISACTOR].firstaid_amount 0
setplayer[THISACTOR].heat_amount 0
setplayer[THISACTOR].holoduke_amount 0
setplayer[THISACTOR].jetpack_amount 0
setplayer[THISACTOR].scuba_amount 0
setplayer[THISACTOR].steroids_amount 0
endevent


1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1496

I would recommend to use EVENT_RESETPLAYER instead since it's syncronized.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#1497

What is the correct way to display models on screen.
I was trying to use rotatesprite in DISPLAYREST but it just displays the dummy tile.

This post has been edited by The Angry Kiwi: 27 August 2014 - 05:13 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#1498

http://wiki.eduke32...._Language#model

Look under hud.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#1499

Thank you kind sir.
0

User is offline   Mblackwell 

  • Evil Overlord

#1500

You are quite welcome!
0

Share this topic:


  • 101 Pages +
  • « First
  • 48
  • 49
  • 50
  • 51
  • 52
  • 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