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

Jump to content

  • 119 Pages +
  • « First
  • 106
  • 107
  • 108
  • 109
  • 110
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   VGames 

#3211

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 offline   Danukem 

  • Duke Plus Developer

#3212

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

#3213

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

#3214

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 

#3215

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 

#3216

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

#3217

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

#3218

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 offline   Danukem 

  • Duke Plus Developer

#3219

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 

#3220

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 offline   Danukem 

  • Duke Plus Developer

#3221

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 

#3222

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

User is offline   Danukem 

  • Duke Plus Developer

#3223

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?


I don't see why you would want to make them blocking at all though. Hittable, yes, but why blocking?

EDIT: And in case anyone was wondering -- there is not going to be an ongoing beef about the credits thing as far as I am concerned as long as it is handled in the way we talked about over DMs, so that's now over in this thread.

This post has been edited by Danukem: 02 March 2023 - 04:58 PM

0

User is offline   VGames 

#3224

Agreed on the credits issue.

Back to my question. How do I make them destructible with bullets and explosions without making them blocking? I thought this was the only way.

EDIT
ok I get it. Only cstat 256 is needed. I feel stupid now. Carry on people.

This post has been edited by VGames: 02 March 2023 - 05:19 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3225

View PostVGames, on 02 March 2023 - 05:14 PM, said:

Agreed on the credits issue.

Back to my question. How do I make them destructible with bullets and explosions without making them blocking? I thought this was the only way.

EDIT
ok I get it. Only cstat 256 is needed. I feel stupid now. Carry on people.


It's as simple as not setting the blocking bit in their cstat. The blocking bit is the first bit. So literally any even numbered cstat value will be non-blocking (0, 4, 8, etc) Add the 256 to that for hittable
0

User is offline   VGames 

#3226

Ok so I was putting together a new episode with custom slaughter maps. For some reason I can't get the second map to start after the first map is completed. It just plays the first map again. But if I play through the first map the second time it's loaded up it will continue on to the second map like it should have done the first time. Has anybody had this issue? I know I have everything set up properly in the USER.CON file. I have named the maps E5L1, E5L2, E5L3, etc. This also happens when I skip to the first map of the new episode. What could be causing this?
0

#3227

Does your client have 5 episodes by default? Could be something with how you're adding one
0

User is offline   VGames 

#3228

I figured it out. The map in question was using the MP version of the nuke button because it’s palette was set to 1.
0

#3229

I don't understand how/why this is causing the kicking action and ifpdistl {} to loop forever. From the duke_grunt it sounds like the actioncount is hitting 2 and then resetting which makes me think the move is resetting it but the change to action (AJAGES) is being ignored.

action AJAGEKICK 41 2 1 1 12 //stuck on this action

state jagekick
  ifaction AJAGEKICK  //this should have become false after 2 frames
  {
    ifactioncount 2
    {
      ifpdistl 1152  //duke_grunt,pal, hp loss is spammed during the loop
      {
        sound DUKE_GRUNT
        palfrom 8 32
        addphealth -8
        getactor[THISACTOR].ang queens
        cos queenx queens
        sin queeny queens
        findnearactor APLAYER 1152 queenz
        movesprite queenz queenx queeny 0 CLIPMASK0 queens
      }
      move JAGESTOPPED faceplayerslow
      action AJAGES  //this line is not taking effect; ai should remain AIJAGEKICK with action AJAGES for use in svolley state
    }
  }
  else
  state svolley
ends



state jageseekstate
  ifcansee
  {
    ifaction AJAGEC
    {
      ifcount 24
        state cvolley
      break
    }
    else
    ifaction AJAGECFLASH
    {
      state cvolley
      break
    }
    ifpdistl 1280
      ifrnd 160
      {
        sound JGKICK
        ai AIJAGEKICK //Only call for kicking ai in the actor
        break
      }
//(truncated)
ends

...
    ifai AIJAGESEEKENEMY
      state jageseekstate
    else
    ifai AIJAGEKICK
      state jagekick
...

0

User is offline   Danukem 

  • Duke Plus Developer

#3230

View Postlllllllllllllll, on 14 March 2023 - 05:55 PM, said:

the change to action (AJAGES) is being ignored.


How have you verified that? If it was me I would have it log a variable or spawn an explosion or something when it reached the line, so that I would know for sure if it wasn't reaching it. Otherwise, it's possible that it is getting set for 1 or 2 tics and then some other part of your code you aren't showing is resetting the AI back to the AJAGEKICK action.
0

#3231

It is as you said. Spawning an enemy on the next line was popping out squads
0

User is offline   Danukem 

  • Duke Plus Developer

#3232

View Postlllllllllllllll, on 14 March 2023 - 09:11 PM, said:

It is as you said. Spawning an enemy on the next line was popping out squads


Did you actually look at your log when this is happening and verify there are no errors? I think there is an error:

findnearactor APLAYER 1152 queenz
movesprite queenz queenx queeny 0 CLIPMASK0 queens

The APLAYER sprite is not an actor (actor is defined as statnum 1). The player has a special statnum and will not be found by that command. This means that your queenz var is being set to -1. On the next line, you are using movesprite on sprite -1. This will cause an error, aborting code execution of that state, making it not reach the action set.

Instead of using those two lines, use this one line:

movesprite player[].i queenz queeny 0 CLIPMASK0 queens
0

#3233

The log for what I was using was filled with invalid move spam ><

To check I had put a spawn below the action AJAGES at the bottom so it's strange that was working but neither the action nor the state following it ever did.
Using player[]i stopped the loop but the movement only works on duke's corpse.
0

User is offline   Danukem 

  • Duke Plus Developer

#3234

View Postlllllllllllllll, on 15 March 2023 - 12:34 AM, said:

The log for what I was using was filled with invalid move spam ><

To check I had put a spawn below the action AJAGES at the bottom so it's strange that was working but neither the action nor the state following it ever did.
Using player[]i stopped the loop but the movement only works on duke's corpse.


I correctly diagnosed your problem. But no, movesprite will not move a live player. You would need to directly set the player's posxv and posyv, or alternatively fvel and svel in the input struct.
0

User is offline   VGames 

#3235

Is the way map objects like cardboard boxes, tires, or palm trees catch on fire when damaged by weapons hardcoded? Is there any way to manipulate the way they react to certain damage types so that they don’t always just catch on fire?
0

User is offline   Danukem 

  • Duke Plus Developer

#3236

Yes and probably.
0

#3237

The actor shrinks and spawns a growing fire, so for the fire you should be able to catch it at event_spawn with an ifactor - ifspawnedby entry, and for the main actor maybe sizeto or sizeat can negate the shrinking or by changing to a dupe actor which should also avoid the killit.
0

User is offline   VGames 

#3238

Great idea. Thanks.
0

User is offline   VGames 

#3239

How do u make the player taller? Like make the position of their view higher? I thought simply increasing their size would do the trick kind of like how making them smaller shrinks their camera view down to the floor when shrunk. But it doesnt
0

User is offline   Danukem 

  • Duke Plus Developer

#3240

Replace the steroids item with growth hormone.
0

Share this topic:


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