EDuke32 Scripting "CON coding help"
#3229 Posted 21 January 2023 - 11:43 PM
lllllllllllllll, on 21 January 2023 - 11:22 PM, said:
I forgot about that one.
#3230 Posted 24 January 2023 - 12:27 PM
#3231 Posted 25 January 2023 - 02:22 AM
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
#3232 Posted 26 January 2023 - 11:08 AM
#3233 Posted 26 January 2023 - 12:50 PM
lllllllllllllll, on 25 January 2023 - 02:22 AM, said:
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.
VGames, on 26 January 2023 - 11:08 AM, said:
Of course, it's not even hardcoded. Just modify the state that makes the jib sounds in the CON code.
#3234 Posted 26 January 2023 - 01:25 PM
With gapz they would trigger a squish by roaming into a tiny sector when they're shrunk. I didn't know gapz existed though.
#3235 Posted 26 January 2023 - 03:19 PM
RPD Guy, on 24 January 2023 - 12:27 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.
#3236 Posted 28 January 2023 - 10:35 AM
Reaper_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".
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
Reaper_Man, on 26 January 2023 - 03:19 PM, said:
#3237 Posted 28 January 2023 - 10:59 AM
Reaper_Man, on 26 January 2023 - 03:19 PM, said:
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
#3238 Posted 28 January 2023 - 12:11 PM
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
#3239 Posted 03 February 2023 - 12:56 AM
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?
#3240 Posted 03 February 2023 - 01:09 AM
lllllllllllllll, on 03 February 2023 - 12:56 AM, said:
No.
lllllllllllllll, on 03 February 2023 - 12:56 AM, said:
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.
#3241 Posted 01 March 2023 - 06:57 AM
#3242 Posted 01 March 2023 - 11:20 AM
VGames, on 01 March 2023 - 06:57 AM, said:
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.
#3243 Posted 01 March 2023 - 12:39 PM
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
#3244 Posted 02 March 2023 - 04:56 PM
VGames, on 01 March 2023 - 06:57 AM, said:
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
#3245 Posted 02 March 2023 - 05:14 PM
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
#3246 Posted 02 March 2023 - 05:20 PM
VGames, on 02 March 2023 - 05:14 PM, said:
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
#3247 Posted 06 March 2023 - 08:36 AM
#3248 Posted 07 March 2023 - 02:50 PM
#3249 Posted 07 March 2023 - 06:04 PM
#3250 Posted 14 March 2023 - 05:55 PM
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
...
#3251 Posted 14 March 2023 - 07:58 PM
lllllllllllllll, on 14 March 2023 - 05:55 PM, said:
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.
#3252 Posted 14 March 2023 - 09:11 PM
#3253 Posted 14 March 2023 - 09:57 PM
lllllllllllllll, on 14 March 2023 - 09:11 PM, said:
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
#3254 Posted 15 March 2023 - 12:34 AM
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.
#3255 Posted 15 March 2023 - 02:21 AM
lllllllllllllll, on 15 March 2023 - 12:34 AM, said:
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.

Help
Duke4.net
DNF #1
Duke 3D #1


