Duke4.net Forums: CON coding problems. - Duke4.net Forums

Jump to content

  • 17 Pages +
  • « First
  • 13
  • 14
  • 15
  • 16
  • 17
  • You cannot start a new topic
  • You cannot reply to this topic

CON coding problems.  "Improvements and progress."

User is offline   F!re-Fly 

#421

View PostOttopartz460, on 23 March 2020 - 02:04 AM, said:

Ok. I think itll be fine. So, whats next?


Ok, let's go !

Here is a simple example for a destructible sprite (here a sushi dish):

useractor notenemy SUSHIPLATE6 WEAK
  cstat 257
  ifhitweapon
  {
    lotsofglass 7
    sound GLASS_BREAKING
    killit
  }
enda


For all new destructible sprites, here are the details:

01. - define a new actor by adding "define xxx" in the DEFS.CON file (or in GAME.CON, if you want to bring everything together in one place).

02. - create your actor in GAME.CON, or in a new CON file. Above all, use "useractor notenemy" and not "actor" because it might not work properly.

03. - the value "WEAK" in the example is the health of the actor. You can of course define a new health, by making another value "define"

04. - to know the other values ​​added in this example, you can help better helped by going here: https://wiki.eduke32.com/wiki/Confaq42

For any other questions, I am always available.

After this little-tutorial, we will move on to the most delicate, the wall textures.
0

#422

Ok. I already did this last night. I was able to do it with a bottle from Lameduke and I was able to hang the tile in question on the wall as a sprite.

By the way, what is "cstat 257?"

This post has been edited by Ottopartz460: 23 March 2020 - 10:02 AM

1

User is offline   Perro Seco 

#423

View PostOttopartz460, on 23 March 2020 - 10:01 AM, said:

By the way, what is "cstat 257?"
This: https://wiki.eduke32.com/wiki/Cstat

So 257 uses the value 256 to make the sprite able to be hit by weapons and the value 1 to block player and enemies (they can't walk through the sprite).
1

User is offline   F!re-Fly 

#424

View PostPerro Seco, on 23 March 2020 - 10:26 AM, said:

This: https://wiki.eduke32.com/wiki/Cstat

So 257 uses the value 256 to make the sprite able to be hit by weapons and the value 1 to block player and enemies (they can't walk through the sprite).


Exactly ! If I understood correctly, you want to make sure to destroy objects, which are positioned flat on a wall? Are you ready for the future?
0

User is offline   F!re-Fly 

#425

Here now is the part of the breakable walls:

damageeventtilerange 5385 5386

onevent EVENT_DAMAGEWALL

  ife wall[RETURN].picnum PARISSCREEN1
  {
    sound GLASS_BREAKING lotsofglass 30
    ifrnd 128
    setw[RETURN].picnum 358
    else
    setw[RETURN].picnum 359
  }

  ife wall[RETURN].picnum PARISSCREEN2
  {
    sound GLASS_BREAKING lotsofglass 30
    ifrnd 128
    setw[RETURN].picnum 358
    else
    setw[RETURN].picnum 359
  }

endevent


01. - The tile numbers used with "damageeventtilerange" are examples based on "World Tour" screens.

02. - You can put all the breakable textures in place, of course respecting the number of the tile. P.S: the name of tiles "PARISSCREEN" 1 and 2, are exactly the same as "5385" and "5386" #tiles positions.

03. - For the "DAMAGEWALL" event to function properly, the value "damageeventtilerange" must be correctly entered like this, just above the event:

damageeventtilerange 5385 5386


P.S: if you have only one image to break, put this. For example:

damageeventtilerange 5385 5385 or damageeventtilerange 5386 5386


04. - the first important entry "ife wall [RETURN] .picnum" corresponds to the first image you would use to be destroyed. This will of course be the "intact" image.

05. - the second entry "setw[RETURN].picnum" will match the final "broken" image.

P.S: In this example, you will notice this:

ifrnd 128
    setw[RETURN].picnum 358
    else
    setw[RETURN].picnum 359


The value "ifrnd" corresponds to a synchronous value as explained on the wiki "an if condition stating the probability of it 'doin somethin!' in this case" this means that the image to be destroyed will randomly generate the image "358" or the image "359" The numbers 358-359 "correspond to the original images of the game, corresponding to the breakable screens.

06. - for a realistic value on breakable screens, add this:

sound GLASS_BREAKING lotsofglass 30


"lotsofglass" of course corresponds to broken glass "hard coded", the value "30" indicates the number of breaks to generate and of course, the sound "GLASS_BREAKING" that follows.

Last thing ! You can have fun adding debris or bloody guts instead or it will all depend on what you do with your textures and also your destroyers sprites.

I remind you that the value "cstat" is important for sprites / breakable walls. Look in the wiki for more.

This post has been edited by F!re-Fly: 23 March 2020 - 01:57 PM

0

#426

So, my unbroken wall is 5965 defined as W_TECHWALL20. The broken wall is tile #5875 and is defined as W_HITTECHWALL20.
"
tilefromtexture 5965 { file "duke3d/extra artwork/W_TECHWALL20.PNG"}
tilefromtexture 5875 { file "duke3d/extra artwork/W_HITTECHWALL20.PNG"}"

So then I should put

"
damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 358
else
setw[RETURN].picnum 359
}

ife wall[RETURN].picnum 5875
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 358
else
setw[RETURN].picnum 359
}

endevent
"
0

#427

No, it should be

"
damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent

"

Right? If I want tile 5965 to turn into 5875 and produce glass shards and the glass breaking sound effect, right?
0

#428

Ok, I think I got it. I misread the instructions. If I only have one image to break, then I need to do it like this, right?

"
damageeventtilerange 5965 5965

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent
"
0

User is offline   F!re-Fly 

#429

View PostOttopartz460, on 23 March 2020 - 06:33 PM, said:

No, it should be

"
damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent

"

Right? If I want tile 5965 to turn into 5875 and produce glass shards and the glass breaking sound effect, right?


Take it for a test and you will tell me if it works. Do not forget to put at the beginning of the code, the first image "intact" and at the end of the code, the second "broken" When you post a piece of code, use the "insert code snippet" function represented by "<>" thank you!
0

User is offline   F!re-Fly 

#430

View PostOttopartz460, on 23 March 2020 - 06:33 PM, said:

Ok, I think I got it. I misread the instructions. If I only have one image to break, then I need to do it like this, right?

"
damageeventtilerange 5965 5965

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent
"



This is incorrect!

This post has been edited by F!re-Fly: 23 March 2020 - 06:47 PM

0

#431

So, this is the right one?

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent
0

User is offline   F!re-Fly 

#432

View PostOttopartz460, on 23 March 2020 - 07:46 PM, said:

So, this is the right one?

damageeventtilerange 5875 5965

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
ifrnd 128
setw[RETURN].picnum 5875

}

endevent


No! If there is only one image, there is no need to add "ifrnd" This is correct:

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
  sound GLASS_BREAKING lotsofglass 30
  setw[RETURN].picnum 5875
}
endevent


Put in order the number of tiles in "damageeventtilerange" to make it easier.

You can also simply name your two images, reversing the one that is broken and the other intact.

I had specified that the value "ifrnd" is used only if you want to generate two images "broken" at random (like # 358 and # 359). The number "128" that follows is the percentage of chance that the change from one image to another is done more frequently.

This post has been edited by F!re-Fly: 23 March 2020 - 08:13 PM

0

#433

Ok. Forgot to take that out. So if tile #5965 is the nonbroken, and #5875 is broken, I should reverse the order in damageeventtilerange? Or leave it the way it is?

This post has been edited by Ottopartz460: 23 March 2020 - 08:36 PM

0

#434

I added

"
damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
sound GLASS_BREAKING lotsofglass 30
setw[RETURN].picnum 5875
}
endevent

"

No effect on the wall.
0

#435

Nothing when I put

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum W_TECHWALL20
{
sound GLASS_BREAKING lotsofglass 30
setw[RETURN].picnum W_HITTECHWALL20
}
endevent
0

User is offline   F!re-Fly 

#436

View PostOttopartz460, on 23 March 2020 - 09:33 PM, said:

Nothing when I put

damageeventtilerange 5875 5965

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum W_TECHWALL20
{
sound GLASS_BREAKING lotsofglass 30
setw[RETURN].picnum W_HITTECHWALL20
}
endevent


damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
  sound GLASS_BREAKING lotsofglass 30
  setw[RETURN].picnum 5875
}
endevent


Sorry this time it was I who got it wrong. I tested at home and you were right. It was the right order.

It's funny enough for me to explain to someone on this forum how to do coding, when I myself was "shot" for my lack of discipline and attendance. Now, over the years, I have learned to manage on my own and ask for help, unless it's really boring. I started a mod since 2017 and it is still running today. I still have a lot of things to do. At first it was supposed to be something very small. But in the end, I aimed for the moon.

:lol: ;)

This post has been edited by F!re-Fly: 23 March 2020 - 11:06 PM

0

User is offline   F!re-Fly 

#437

Please use this to insert code into a message.




Posted Image
0

#438

I tried it that way. It didnt work.
0

#439

Also, what is "cactor"?

I see this every once in a while.

Im trying to use soda cans for health. I got that down just fine, but Id like to have Duke leave a crushed can on the ground. I saw another mod where the author did this and I looked at his code and it says "cactor (WHATEVER he defined the crushed can as)."
0

#440

View PostF!re-Fly, on 23 March 2020 - 11:22 PM, said:

Please use this to insert code into a message.




Posted Image



ok,

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
    sound GLASS_BREAKING lotsofglass 30
    setw[RETURN].picnum 5875
}
endevent

0

User is online   Mark 

#441

View PostOttopartz460, on 24 March 2020 - 01:18 AM, said:

Also, what is "cactor"?

I see this every once in a while.

Im trying to use soda cans for health. I got that down just fine, but Id like to have Duke leave a crushed can on the ground. I saw another mod where the author did this and I looked at his code and it says "cactor (WHATEVER he defined the crushed can as)."

https://wiki.eduke32...ll_command_list
0

User is offline   F!re-Fly 

#442

View PostOttopartz460, on 24 March 2020 - 01:14 AM, said:

I tried it that way. It didnt work.


You surely forgot a step. It works very well for me. I really don't know why you can't do it.
0

User is offline   F!re-Fly 

#443

View PostMark, on 24 March 2020 - 04:05 AM, said:



"cactor" can also be used for objects to destroy, or to modify an "atomic health" which gives 100hp at once, instead of 50hp of the game. Cactor can also be used to use again, a main actor (Liztroop) when the latter has been frozen.

But other than that, why didn't the tutorial help you? Do you meet what type of problem ?? You really don't use Eduke32 ???

This post has been edited by F!re-Fly: 24 March 2020 - 04:51 AM

0

User is offline   F!re-Fly 

#444

Back for code corrections ! Here is an example of one of my switches:

action NUKEBUTTONDNA_SWITCHONA    1
action NUKEBUTTONDNA_SWITCHONB    1
action NUKEBUTTONDNA_SWITCHOFFA    0
action NUKEBUTTONDNA_SWITCHOFFB    0

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifpdistl 1309
  ifp pfacing
  {
    ifhitspace
    { ifaction NUKEBUTTONDNA_SWITCHOFFB
      { sound SWITCH_ON
        ifvarg NEWSWITCHDOOR 0 { operateactivators NEWSWITCHDOOR 0 }
        ifvarg SOUNDSWITCH 0 { stopsoundvar SWITCH_ON soundvar SOUNDSWITCH }
        action NUKEBUTTONDNA_SWITCHONA
        break
      }
      else ifaction NUKEBUTTONDNA_SWITCHONB
      { sound SWITCH_ON
        ifvarg NEWSWITCHDOOR 0 { operateactivators NEWSWITCHDOOR 0 }
        ifvarg SOUNDSWITCH 0 { stopsoundvar SWITCH_ON soundvar SOUNDSWITCH }
        action NUKEBUTTONDNA_SWITCHOFFA
        break
      }
    }
    else
    { ifaction NUKEBUTTONDNA_SWITCHOFFA
        action NUKEBUTTONDNA_SWITCHOFFB
      else ifaction NUKEBUTTONDNA_SWITCHONA
        action NUKEBUTTONDNA_SWITCHONB
    }
  }
enda


All this works very well and the doors open very well. Only, I can not make it so that the switch can not come to life, only when it is not assigned to a lotag. Did I misplace any order?
0

#445

View PostF!re-Fly, on 24 March 2020 - 04:50 AM, said:

"cactor" can also be used for objects to destroy, or to modify an "atomic health" which gives 100hp at once, instead of 50hp of the game. Cactor can also be used to use again, a main actor (Liztroop) when the latter has been frozen.

But other than that, why didn't the tutorial help you? Do you meet what type of problem ?? You really don't use Eduke32 ???


I AM using eDuke32. The problem Im getting is that the wall is not breaking when shot. I made a new notepad file, named it TILES.DEF.In TILES.DEF, I put
tilefromtexture 5965 { file "duke3d/extra artwork/W_TECHWALL20.PNG"}
tilefromtexture 5875 { file "duke3d/extra artwork/W_HITTECHWALL20.PNG"}


In GAME.CON in both the "custom game content" directory (c:\DUKE3D\DUKE3D-PLUTMOD) and the directory eDuke32 is in (C:\DUKE3D), I put at the end

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
    sound GLASS_BREAKING lotsofglass 30
    setw[RETURN].picnum 5875
}
endevent


In DEFS.CON, I defined the walls as

define W_TECHWALL20 5965
define W_HITTECHWALL20 5875


Also, they are defined in NAMES.H, even and show up on Mapster

DEF.CON and TILES.DEF are in both directories as well.

So, where did I go wrong?
0

User is offline   F!re-Fly 

#446

View PostOttopartz460, on 25 March 2020 - 09:07 PM, said:

I AM using eDuke32. The problem Im getting is that the wall is not breaking when shot. I made a new notepad file, named it TILES.DEF.In TILES.DEF, I put
tilefromtexture 5965 { file "duke3d/extra artwork/W_TECHWALL20.PNG"}
tilefromtexture 5875 { file "duke3d/extra artwork/W_HITTECHWALL20.PNG"}


In GAME.CON in both the "custom game content" directory (c:\DUKE3D\DUKE3D-PLUTMOD) and the directory eDuke32 is in (C:\DUKE3D), I put at the end

damageeventtilerange 5965 5875

onevent EVENT_DAMAGEWALL

ife wall[RETURN].picnum 5965
{
    sound GLASS_BREAKING lotsofglass 30
    setw[RETURN].picnum 5875
}
endevent


In DEFS.CON, I defined the walls as

define W_TECHWALL20 5965
define W_HITTECHWALL20 5875


Also, they are defined in NAMES.H, even and show up on Mapster

DEF.CON and TILES.DEF are in both directories as well.

So, where did I go wrong?


Okay ! I will explain again, based on my own folders and files:

01. inside the def file + the destination path for the tiles

tilefromtexture 10100 { file "tiles/official/advance/10100.png" } unbroken tile = W_TECHWALL20
tilefromtexture 10103 { file "tiles/official/advance/10103.png" } break tile = W_HITTECHWALL20 


02. inside the con file "GAME" or personal con file

onevent EVENT_DAMAGEWALL
  ife wall[RETURN].picnum W_TECHWALL20 // 10100
  {
    sound GLASS_BREAKING2 lotsofglass 30
    sound VENT_BUST2
    setw[RETURN].picnum W_HITTECHWALL20 // 10103
  }
endevent


03. Inside the CON file "DEFS"

define W_TECHWALL20 10100
define W_HITTECHWALL20 10103


I actually forget something else and I apologize. Just putting the number of the tile in the code, it only corresponds to the tile. "define" is just a name you give to the tile. If you only give the number, ignore the "DEFS" file

In your Eduke32 folder, did I tell you about the main "EDUKE.CON" file? Well there is also the "duke3d.def" file to modify. Open this file and add the following line:

include defs/advance.def


EDUKE.CON file:

include cons/defs.con

include cons/user.con

include cons/game.con


duke3d.def file:

include defs/advance.def


Here ! With that, you should get there. All of this is of course based on my example. Rename properly for your work.

This post has been edited by F!re-Fly: 26 March 2020 - 04:45 AM

0

#447

View PostF!re-Fly, on 26 March 2020 - 04:25 AM, said:

Okay ! I will explain again, based on my own folders and files:

01. inside the def file + the destination path for the tiles

tilefromtexture 10100 { file "tiles/official/advance/10100.png" } unbroken tile = W_TECHWALL20
tilefromtexture 10103 { file "tiles/official/advance/10103.png" } break tile = W_HITTECHWALL20 


02. inside the con file "GAME" or personal con file

onevent EVENT_DAMAGEWALL
  ife wall[RETURN].picnum W_TECHWALL20 // 10100
  {
    sound GLASS_BREAKING2 lotsofglass 30
    sound VENT_BUST2
    setw[RETURN].picnum W_HITTECHWALL20 // 10103
  }
endevent


03. Inside the CON file "DEFS"

define W_TECHWALL20 10100
define W_HITTECHWALL20 10103


I actually forget something else and I apologize. Just putting the number of the tile in the code, it only corresponds to the tile. "define" is just a name you give to the tile. If you only give the number, ignore the "DEFS" file

In your Eduke32 folder, did I tell you about the main "EDUKE.CON" file? Well there is also the "duke3d.def" file to modify. Open this file and add the following line:

include defs/advance.def


EDUKE.CON file:

include cons/defs.con

include cons/user.con

include cons/game.con


duke3d.def file:

include defs/advance.def


Here ! With that, you should get there. All of this is of course based on my example. Rename properly for your work.



Ok, Ill try. I don't have a EDuke.con or a duke3d.def file, though.
0

#448

Ok, so I got this message...

Posted Image

This is how my directories are set up. I have eDuke32 in C:\duke3d and Im using the material from C:\Duke3d\DukePlut-mod directory. That's were the modified Duke3d.grp, Game.con, User.con, Defs,con, all the tileart and everything is.

Posted Image

This is the DukePlut-Mod directory

Posted Image

This is the Tiles.DEF file I made in the DukePlut-Mod directory...

Posted Image

This is what I put in GAME.CON in the DukePlut-Mod directory. There was no VENT_BURST2 or GLASS_BREAKING2. so I just went with the original sounds.

Posted Image

Also, in GAME.CON I added TILES.DEF.

Posted Image

This is directory where the art is at. c:\Duke3d\Extra Artwork

Posted Image

This is DEFS.CON in Duke3d/DukePlut-Mod directory.

Posted Image

So, the error says Im missing a keyword before "tilefromtexture" in TILES.DEF. Its recognizing the file in GAME.CON.

And, like I said, theres no duke3d.def or EDUKE.CON files, at least none I can see
0

User is offline   Perro Seco 

#449

View PostOttopartz460, on 26 March 2020 - 06:55 PM, said:

And, like I said, theres no duke3d.def or EDUKE.CON files, at least none I can see
If you're using DukeRes to insert your new tiles into the game, then there's no need to use .def files, so you can forget about the tilefromtexture stuff. You don't need any eduke.con file either, because I see you're already using the game.con file to insert your new code. I say this just to simplify your work a bit.
0

User is offline   F!re-Fly 

#450

View PostOttopartz460, on 26 March 2020 - 06:55 PM, said:

Ok, so I got this message...

Posted Image

This is how my directories are set up. I have eDuke32 in C:\duke3d and Im using the material from C:\Duke3d\DukePlut-mod directory. That's were the modified Duke3d.grp, Game.con, User.con, Defs,con, all the tileart and everything is.

Posted Image

This is the DukePlut-Mod directory

Posted Image

This is the Tiles.DEF file I made in the DukePlut-Mod directory...

Posted Image

This is what I put in GAME.CON in the DukePlut-Mod directory. There was no VENT_BURST2 or GLASS_BREAKING2. so I just went with the original sounds.

Posted Image

Also, in GAME.CON I added TILES.DEF.

Posted Image

This is directory where the art is at. c:\Duke3d\Extra Artwork

Posted Image

This is DEFS.CON in Duke3d/DukePlut-Mod directory.

Posted Image

So, the error says Im missing a keyword before "tilefromtexture" in TILES.DEF. Its recognizing the file in GAME.CON.

And, like I said, theres no duke3d.def or EDUKE.CON files, at least none I can see


I'm having trouble understanding your organization. I understand now by seeing your files, that there are not the two files to which I alluded. Which means that you simply did not have the files of "Megaton Edition" with HD textures in a folder called "hides" In addition, as Perro Seco said, it is indeed not necessary to have a file .DEF at the root of Eduke32, if you work with DukeRes. But I feel like you're doing both at the same time.

I noticed two strange things:

it is not useful to add "c: / duke3d / ..." to the DEF file. And also why did you put "include Tiles.def" in a .CON file? In my humble opinion, we must avoid doing this.
0

Share this topic:


  • 17 Pages +
  • « First
  • 13
  • 14
  • 15
  • 16
  • 17
  • 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