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

Jump to content

  • 124 Pages +
  • « First
  • 107
  • 108
  • 109
  • 110
  • 111
  • 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

#3214

View PostVGames, on 11 January 2023 - 06:21 AM, said:

Ok I’ll give it a try. Thanks for the help. To be clear you’re telling me to use a cstat value higher then 65535 correct?


nonono, I was saying they don't exist. You literally can't enter a higher value than that, mapster won't even let you.
0

User is offline   VGames 

  • Extra Crispy

#3215

Oh ok. Dang I thought this was gonna do what I wanted lol. Oh well.
0

#3216

Having a problem with a single corpse sprite refusing to stay in place when changing from the dead enemy to the corpse. I added empty pixels to the bottom of each corpse and then cstat them so they sink halfway into the ground to mimic the normal corpses' bottom few rows being hidden.
This one is popping up as if it has not yet been cstat'd while none of the others have this problem.
Spoiler

Attached thumbnail(s)

  • Attached Image: hop.gif
  • Attached Image: so855c.png
  • Attached Image: 1855.png

0

User is online   Danukem 

  • Duke Plus Developer

#3217

Don't toggle the half-submerged cstat and you don't need to edit the art, either. Just adjust the yoffset in the .art editor to put the corpse where you want it.
0

#3218

It worked, thank you
0

User is offline   jimbob 

#3219

i noticed the HEAVYHBOMB actor doesnt have a whole lot of code to it in the game.con, i want the weapon to be non pick back uppable. for example once thrown its out there and it should not be able to be picked back up, any wasy way to do it or do i have to make the actor spawn a faux bomb replacement actor when it comes to a standstill?
speaking of the heavyhbomb, would it theotretically work if i check if its moving to play a random "rolling on the floor" sound like in Powerslave/Exumed? with a iffloordist check ofcourse.

This post has been edited by jimbob: 12 January 2023 - 02:15 AM

0

User is online   Danukem 

  • Duke Plus Developer

#3220

View Postjimbob, on 12 January 2023 - 02:13 AM, said:

i noticed the HEAVYHBOMB actor doesnt have a whole lot of code to it in the game.con, i want the weapon to be non pick back uppable. for example once thrown its out there and it should not be able to be picked back up, any wasy way to do it or do i have to make the actor spawn a faux bomb replacement actor when it comes to a standstill?


If it was me I would just replace it with my own actor as you suggested. It's a cleaner solution than trying to fight the hardcoding.

View Postjimbob, on 12 January 2023 - 02:13 AM, said:

speaking of the heavyhbomb, would it theotretically work if i check if its moving to play a random "rolling on the floor" sound like in Powerslave/Exumed? with a iffloordist check ofcourse.


Yes, but also stop the sound when it stops moving or when it blows up.
0

User is offline   jimbob 

#3221

View PostDanukem, on 12 January 2023 - 02:30 AM, said:

If it was me I would just replace it with my own actor as you suggested. It's a cleaner solution than trying to fight the hardcoding.

well im going to chalk that up to the "fix it in the patch"

Quote

Yes, but also stop the sound when it stops moving or when it blows up.

nice, i'll look into it.
0

#3222

I found the problem with the octabrain death is it uses an 8-frame action for just 5 actual tiles. The final 3 frames are supposed to use the corpse and it only happened to be displaying the correct frame because it was the last defined tile at that time
0

User is offline   RPD Guy 

#3223

Is there any weapon coding tutorial?
0

User is offline   jimbob 

#3224

there is, but its in spanish
i think i did a rough google translate version of it but i dont know if i still have it.

This post has been edited by jimbob: 20 January 2023 - 01:23 AM

0

User is online   Danukem 

  • Duke Plus Developer

#3225

Okay, here's my tuturial for making a basic weapon in EDuke32 that makes use of the built-in weapon gamevars:

1) Put all of the graphics you need for displaying the weapon in the game (.art tiles, DEFed in models, or whatever medium you are using)

2) Add all the sounds, too, with definesound and whatever sound files you are using

3) Decide what weapon slot your weapon is going on, and set the predefined values for that weapon slot to the values you want. https://wiki.eduke32...efined_gamevars
3.1 For example, if it is going on the pistol slot and you want it to shoot ROCKETS, then in your code declare "gamevar WEAPON1_SHOOTS RPG 1"
3.2 Study the list of weapon variables and experiment with changing the values on them. Spend some time on this. Just try changing the SHOTSPERBURST on a weapon, its TOTALTIME, what it SHOOTS, the sound it makes when it shoots, etc etc etc. Spend hours on this if necessary and do not move on until you are competent at changing the more important vars and understanding what they do.

4) If needed, define a custom projectile for your weapon to shoot. Skip this step if it is going to shoot one of the projectiles already in the base game. https://wiki.eduke32...efineprojectile

4.1 Look at the linked entry on defineprojectile. It's accurate and even has an example. If you set WEAPONX_SHOOTS to your custom projectile tile number, your weapon will shoot that projectile.
4.2 There are literally hundreds and probably thousands of custom projectiles defined in various released mods. Maybe take a look at them if you aren't sure on what values to use. You are looking for entries that say "defineprojectile" in the code.
4.3 If your custom projectile spawns something and/or has a trail, select the relevant actors for that or make them if needed.

5) If you are using your own weapon art, then use https://wiki.eduke32...VENT_DRAWWEAPON to cancel out the hardcoded display of the weapon on your slot and then display your weapon.
5.1. E.g. if you are using the pistol slot then use "ife currentweapon PISTOL_WEAPON set RETURN -1" to cancel out the hardcoded display of the pistol.
5.2 Use the rotatesprite command to draw your weapon. This may require multiple draws depending on what is going on (.e.g if the weapon is reloading you may be drawing the weapon plus a separate hand sprite and also a clip sprite)
5.3 Weapon positioning is somewhat trial and error ,but there are many examples to look at in various mods. In general, though, you start with base x and y values for the screen coordinates that put the weapon in the right place, and you adjust those based on certain hardcoded values relating to weapon sway and bob. You want to subtract looking_angSR1 from x, add weapon_xoffset to x, add looking_arc to y, and subtract gun_pos from y (all of those constantly updated vars have wiki entries and most of the examples I alluded to use those vars to adjust positioning).
5.4 You can disregard the hardcoded weapon sway and bob stuff and make your own, though.
5.5 weaponcount in the display event is equivalent to player[].kickback_pic and obviously you want your display to change depending on the weaponcount in most cases. Since you studied the weapon properties page and experimented, you know that the max weaponcount is the WEAPONX_TOTALTIME.
4

User is offline   VGames 

  • Extra Crispy

#3226

Is there any way to keep a non-enemy useractor from flashing when they shoot a projectile? I've got some dead bodies that squirt blood out for a short time and when they shoot out the projectiles for the blood their shade goes to the brightest setting everytime they shoot the projectile and then it returns to the correct shade. I have them using the shade of the floor because they stayed completely lit up if I just made them use the shade of the body that spawned them. Any ideas?
0

User is online   Danukem 

  • Duke Plus Developer

#3227

I think if you set mdflags to 16 on the body and then set the tsprite to the shade you want in ANIMATESPRITES that would do it.
0

#3228

PROJECTILE_NOSETOWNERSHADE?
2

User is online   Danukem 

  • Duke Plus Developer

#3229

View Postlllllllllllllll, on 21 January 2023 - 11:22 PM, said:

PROJECTILE_NOSETOWNERSHADE?


I forgot about that one.
0

User is offline   RPD Guy 

#3230

What is the correct way to check if an actor has been squished without using "ifsquished"?
0

#3231

I guess ifceilingdistl
If by correct you're talking about sleeping actors getting squished it won't matter what method is used when it's placed inside the actor's code (it won't work during sleep).

This post has been edited by lllllllllllllll: 25 January 2023 - 02:24 AM

1

User is offline   VGames 

  • Extra Crispy

#3232

Is there a way to add to the list of VO lines duke says when he kills enemies or blows them to pieces?
0

User is online   Danukem 

  • Duke Plus Developer

#3233

View Postlllllllllllllll, on 25 January 2023 - 02:22 AM, said:

I guess ifceilingdistl
If by correct you're talking about sleeping actors getting squished it won't matter what method is used when it's placed inside the actor's code (it won't work during sleep).


Why not use ifgapzl ?? The distance to the ceiling alone is not a reliable indicator since an actor could jump or fly near the ceiling and be quite far from the floor.


View PostVGames, on 26 January 2023 - 11:08 AM, said:

Is there a way to add to the list of VO lines duke says when he kills enemies or blows them to pieces?


Of course, it's not even hardcoded. Just modify the state that makes the jib sounds in the CON code.
0

#3234

The actor would be pushed by the ceiling and [should] not be able to reach the amount being checked for squish without having both floor+ceiling forcing it close to the ceiling.
With gapz they would trigger a squish by roaming into a tiny sector when they're shrunk. I didn't know gapz existed though.
0

User is offline   Reaper_Man 

  • Once and Future King

#3235

View PostRPD Guy, on 24 January 2023 - 12:27 PM, said:

What is the correct way to check if an actor has been squished without using "ifsquished"?

Why is ifsquished not viable?

Looking at the source code, the short answer of how it works is it checks if the difference between the sprite's sector floor and ceiling is less than or equal to 3072, and if so then it is "squished".

There's a bunch of other checks - if the sprite is PAL 1 (meaning they are frozen) then the distance is actually 8192, if they are NOT in an "above water" sector or a ST 23 Swinging Door sector, so on - but depending on what you're doing or why ifsquished isn't viable, they may not necessarily be relevant to replicate.
1

User is offline   RPD Guy 

#3236

View PostReaper_Man, on 26 January 2023 - 03:19 PM, said:

Why is ifsquished not viable?

Looking at the source code, the short answer of how it works is it checks if the difference between the sprite's sector floor and ceiling is less than or equal to 3072, and if so then it is "squished".

There's a bunch of other checks - if the sprite is PAL 1 (meaning they are frozen) then the distance is actually 8192, if they are NOT in an "above water" sector or a ST 23 Swinging Door sector, so on - but depending on what you're doing or why ifsquished isn't viable, they may not necessarily be relevant to replicate.


I don't want to use "ifsquished" because of the hard-coded quote #10 "SQUISHED!" that keeps showing up.

I'll try this one

View PostReaper_Man, on 26 January 2023 - 03:19 PM, said:

Looking at the source code, the short answer of how it works is it checks if the difference between the sprite's sector floor and ceiling is less than or equal to 3072, and if so then it is "squished".

0

User is offline   RPD Guy 

#3237

View PostReaper_Man, on 26 January 2023 - 03:19 PM, said:

Looking at the source code, the short answer of how it works is it checks if the difference between the sprite's sector floor and ceiling is less than or equal to 3072, and if so then it is "squished".


It seems to be working fine.

var b_is_squished FALSE 2
var b_distance 0 2

defstate b_global_check_squished
    set b_is_squished FALSE
    set b_distance 0

    geta[THISACTOR].sectnum b_sectnum
    ife b_sectnum -1 {
        set b_is_squished TRUE // out of bounds?
    } else {
        gets[b_sectnum].ceilingz b_ceilingz
        gets[b_sectnum].floorz b_floorz
        set b_distance b_floorz
        sub b_distance b_ceilingz
        ifg b_distance 3072 {
            nullop
        } else {
            set b_is_squished TRUE
        }
    }
ends


This post has been edited by RPD Guy: 28 January 2023 - 11:01 AM

0

User is offline   Reaper_Man 

  • Once and Future King

#3238

If you're just trying to cancel out the display of the quote, you can either A.) just make quote 10 empty (although this will still print to the console and log), or if blank log spam is not acceptable, B.) use the .fta and .ftq player members to manipulate it and cancel it directly.

Otherwise if you still want to go with a custom route, you may run into problems with TROR sectors and actors being "squished" by portals they should be able to pop through. Also you could streamline your code a fair bit:

var b_is_squished FALSE 2
var b_distance 0 2

defstate b_global_check_squished
    set b_is_squished FALSE
    set b_distance 0

    geta[THISACTOR].sectnum b_sectnum
    ife b_sectnum -1
        set b_is_squished TRUE // out of bounds?
    else
    {
        set b_distance sector[b_sectnum].floorz
        sub b_distance sector[b_sectnum].ceilingz
        ifl b_distance 3072
            set b_is_squished TRUE
    }
ends

0

#3239

Can you target actor B for current actor conditionals from within actor A's code? (not structure)
actor A
  ifhitweapon
    ifdead
      iffloordistl 8 //for actor B's floordist
enda


And are states purely for convenience? Putting them behind conditionals won't make an actor lighter up until it fires?
0

User is online   Danukem 

  • Duke Plus Developer

#3240

View Postlllllllllllllll, on 03 February 2023 - 12:56 AM, said:

Can you target actor B for current actor conditionals from within actor A's code? (not structure)


No.

View Postlllllllllllllll, on 03 February 2023 - 12:56 AM, said:

And are states purely for convenience?


Convenience and reducing the amount of code that needs to be compiled, on the assumption that a state will be called in more than one place.
0

User is offline   VGames 

  • Extra Crispy

#3241

So I have destructible gibs in my mod and of course they have their cstats set up to take hitscan damage and block. It all works great but is there any way to keep the player from bobbing up and down when walking over gibs? It’s not a huge issue but it can be annoying in certain situations due to the player kind of sliding down and off the gibs when on top of them. Could I maybe set their clip dist to something to keep this from happening without removing their ability to be destroyed by bullets?
0

User is online   Danukem 

  • Duke Plus Developer

#3242

View PostVGames, on 01 March 2023 - 06:57 AM, said:

So I have destructible gibs in my mod and of course they have their cstats set up to take hitscan damage and block. It all works great but is there any way to keep the player from bobbing up and down when walking over gibs? It’s not a huge issue but it can be annoying in certain situations due to the player kind of sliding down and off the gibs when on top of them. Could I maybe set their clip dist to something to keep this from happening without removing their ability to be destroyed by bullets?


Hey VGames, this isn't an answer to your question but I feel I need to say something about the Savior Of Babes mod that you released recently. I downloaded it today and took a look. It has a lot of material, both art and code that have been taken from other projects. I think the amount of stuff taken from other EDuke32 projects is excessive and that the credits are grossly inadequate given how much you have taken. For example in my case there are whole scripts files for enemies that I wrote (some still have my name on them; I guess I should see that as a positive) and other code for very tricky things such as the lightsaber animation display. Also, there is lots of art for enemies made by sebabdukeboss20. That is not an exhaustive list, just some things I noticed.

I graciously helped you with your code questions, for example in this thread: https://forums.duke4...babes-dev-help/ but if I had known this was your plan I honestly would not have helped, and now this makes me less likely to help others. That's why I think it's relevant to mention it in this thread.

I don't think that you are being malicious. In fact I'm pretty sure that you are just having a good time making your mod and that you do appreciate all the help and resources at your disposal. I imagine that you are an eager young person who just wants to make a fun mod and had no intention of ruffling feathers. But I don't think you understand how it feels if you have been slaving away on projects for many years and then someone comes along and uses your stuff without permission and then gets credit for it from youtubers and other people who just think it is a cool mod without realizing how much of it was made by other people who didn't consent.

In your readme you do have a thanks section where you list various mods that you have learned/taken stuff from. What I'm saying is that it is grossly inadequate to just list a mod and say thanks for "sprites and coding features" if you have largely copied and pasted significant amounts of someone else's work without their permission. Now as a modder I do understand that we "borrow" a lot of stuff! But there are rules we try should follow. The most important one to me is that if we are using significant amounts of content from another in mod our own community that we discuss it with those mod authors first and get their permission to include it. In some cases we have a working relationship with each other -- for example, between AMC TC and Alien Armageddon, but that is because we share team members and the traffic goes both ways.
7

User is offline   VGames 

  • Extra Crispy

#3243

My apologies I didn’t think it would be a big deal since credit was given for everything I borrowed. I never claimed to make everything on my own and I do intend to elaborate a lot more on the read me which includes the thank you section. This is just a pre 1.0 release and there is still much more to do. But I will definitely clarify a lot more in the thank you section for the next release. I hope I didn’t upset you. I won’t be adding content from other mods from here on out. I have a good base to work with now.
I’m not young by any means. I’ve been modding for a long time across many games and I’ve borrowed from other’s mods the entire way. And I’ve given thanks exactly like this with every mod. So I didn’t see an issue with how I went about it since I’ve been doing it like this since my very first release of a mod without anybody saying anything. People have already come to me asking about some of the resources I got because they were interested in playing the mods that I borrowed from, I’m referring to newcomers of course. I have a decent following and people know my capabilities by now so they know I didn’t make this stuff all by myself. And I am the first person to put in a good word for the mods that I took resources from. Plus I seriously doubt the vast majority who play my mod haven’t played any of your work. No way would they not know where some of the resources in my mod came from. Your work is legendary

This post has been edited by VGames: 01 March 2023 - 01:04 PM

-2

Share this topic:


  • 124 Pages +
  • « First
  • 107
  • 108
  • 109
  • 110
  • 111
  • 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