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

Jump to content

  • 95 Pages +
  • « First
  • 92
  • 93
  • 94
  • 95
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Danukem 

  • Duke Plus Developer

#2791

View Postjimbob, on 28 October 2021 - 10:10 AM, said:

the ifvar templ 10 is redundant anyway with the ifge sprite[PANZER].extra 0 line


Not really because even if extra is > 0 that doesn't mean extra/50 is > 0
0

User is offline   jimbob 

#2792

i guess, i'll test some more and if i dont get anymore hangups i'll just leave it remmed.
0

User is offline   Danukem 

  • Duke Plus Developer

#2793

View Postjimbob, on 28 October 2021 - 11:31 AM, said:

i guess, i'll test some more and if i dont get anymore hangups i'll just leave it remmed.


It won't cause a hang because the drawing loop won't even start if temp is 0 after the division. I was just pointing out that there are cases where the break will be executed.
0

User is offline   RPD Guy 

#2794

Hello,

I don't know if someone asked this before, but, is there a way to tint a sector without affecting its containing sprites' pal?

I know that "spritenopal" kinda "solves" this, but I don't want to set every game sprite with this definition.
0

User is offline   Danukem 

  • Duke Plus Developer

#2795

Maybe? On the wiki it says you press N on a sprite to toggle its auto-shading, so there maybe something undocumented for pal. In game, those settings are stored in the htflags bitfield, but that member doesn't seem to be stored in the map. The "flags" member in mapster is for cstat, which is different. However, the "no shade" bit is duplicated in cstat, which I'm guessing they did so that it could be stored in the map file.
0

User is offline   Danukem 

  • Duke Plus Developer

#2796

Since this is the scripting thread, you may want a scripting solution. It's a bit cumbersome, but you could define a new sprite and then put it into the sector where you want the sprites to ignore pal:

define NOPALSPRITE ####
gamevar tempsprite 0 0
gamevar tempvar 0 0

eventloadactor NOPALSPRITE

cstat 32769
headspritesect tempsprite sprite[].sectnum
whilevarn tempsprite -1
{
  geta[tempsprite].htflags tempvar
  orvar tempvar 64
  seta[tempsprite].htflags tempvar
  nextspritesect tempsprite tempsprite
}

enda


I think that will work but I'm not entirely sure because the htflags might get overwritten after map load. If that's the case then the code would need to run later.
0

#2797

If Duke has 1 hp, for example, and is hit by his own projectile in the same tick as an opponent hits him, it's pretty random whether he suicides or the opponent gets the kill. Perhaps, it seems that he mostly suicides. I've tried set it up so that Duke has 1000hp and hits himself every tick with a 1 dmg projectile. Then, when I, an opponent, shoots him with a 2000 dmg projectile, Duke suicides (which is weird IMO).

It seems that all dmg incurred at the same tick is actually accumulated, but htowner and htpicnum and so on contains a "random" value among those that hit Duke in that tick.

I thought I could manipulate some value, e.g. setactor[THISACTOR].htowner some_id_that_is_not_the_actor_itself, but that doesn't seem to have any influence on whether Duke suicides or not.

Same but different: Whenever Duke is hit, the opponent hitting Duke is notified (say, by a hitmarker), but if multiple opponents hit Duke in the same tick, how would I go about notifying all opponents? Atm I'm using htowner, which obviously only holds a single value, so how would I go about this?
0

User is offline   Reaper_Man 

  • Once and Future King

#2798

EVENT_DAMAGESPRITE maybe?
1

User is offline   Danukem 

  • Duke Plus Developer

#2799

View PostReaper_Man, on 14 December 2021 - 06:14 PM, said:

EVENT_DAMAGESPRITE maybe?


I'll bet you are right. That event should be triggered every time there is damage, even if it happens to the same sprite multiple times in one tic.

gamevar htowner2 -1 1
gamevar damagetime 0 1
gamevar playerID 0 1

onevent EVENT_DAMAGESPRITE

ife sprite[RETURN].picnum APLAYER
{
  geta[RETURN].yvel playerID
  ife playervar[playerID].damagetime player[playerID].player_par setplayervar[playerID].htowner2 sprite[THISACTOR].owner
  else setplayervar[playerID].htowner2 -1
  setplayervar[playerID].damagetime player[playerID].player_par
}

endevent


I don't normally work with different player IDs since I have only been scripting singleplayer stuff for a long time, but if that code above is correct what it will do is put a second sprite ID into the htowner2 var for the specific player who got damaged by two sprites in the same tic. I think the likelihood of there being a third sprite doing damage in the same tic is pretty low, so having two IDs should be sufficient. Even assuming that works, it won't save how much damage was done by each, so more work would be needed for that feature. However, if one sprite was the same player who got hit and the other sprite is a different player, it would then be easy to always set the htowner to one or the other in that situation, giving credit where it is desired.

EDIT: Also, htowner2 should be cleared back to -1 by the damage handling code that gives credit; otherwise, it stays set until the player is damaged again.

This post has been edited by Danukem: 14 December 2021 - 07:41 PM

2

#2800

That worked, thanks!

Is it possible to make sprites only visible to some of the players in a multiplayer game? I want to show trailing footsteps of players if nightvision is turned on, but I don't want all players to see these footsteps, only those who have nightvision on.
1

#2801

Turns out that by using myconnectindex I can test if getplayer[myconnectindex].heat_on is 1 and draw the footprints accordingly. This means that even if a game contains 3 dukes, it is only when your own duke has goggles turned on that the sprites are drawn - they are in turn not drawn on the screen for other players (unless they also have goggles turned on). Since it is only visual effects that uses myconnectindex it does not cause a desync :)
0

User is offline   Danukem 

  • Duke Plus Developer

#2802

You rediscovered some ancient EDuke knowledge.
0

User is offline   jimbob 

#2803

is it possible to overlay text using screentext during cinematics? particularly .IVF files?

so far i tried using onevent EVENT_CUTSCENE, using IFCUTSCENE cutscene { screentext etc etc } endevent
but it doesnt seem to render, atleast not as an overlay, so before i waste more time on this, i wonder if it is at all possible?

[edit] it seems possible, but using redefinequote makes it hard to pinpoint the exact video file, since im using a custom episode intro video using redefinequote the overlay appears on the 'logo' video file rather than my custom one.

This post has been edited by jimbob: 06 February 2022 - 01:20 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2804

If screentext works during the cutscene, then I would just try setting a custum gamevar to specific value for that cutscene right before you use the startcutscene command, then have the screentext for that cutscene display depending on the variable -- that way you don't have to worry about IFCUTSCENE and it won't display during the wrong one
0

User is offline   jimbob 

#2805

i'll give that a try
0

User is offline   jimbob 

#2806

the overlay being garbage colors wasnt limited to logo.anm it seems, and it fails to render the actual video, so im canning the idea, but using the vars worked, so thats nice.
0

User is offline   jimbob 

#2807

not sure if there is a Eduke32 suggestions thread, a quick search came up with nothing, but i was working on a random speech system, and i noticed there is a stopallsounds, a stopactorsound command, but no stopallactorsounds command, wich would be very usefull to stop all of the audio the actor is currently playing ( for example make him shup up ) before starting a new soundfile. with a large batch or dedicated audio que's excluding every instance would be a pain in the ass to do. even with as little as 6 pain reactions, you'd have to program a multitude of that. so unless im missing something, and if eduke is still in development something like that would seem very helpfull.

anyway, back to mucking about.
0

User is offline   Danukem 

  • Duke Plus Developer

#2808

View Postjimbob, on 18 February 2022 - 03:35 PM, said:

not sure if there is a Eduke32 suggestions thread, a quick search came up with nothing, but i was working on a random speech system, and i noticed there is a stopallsounds, a stopactorsound command, but no stopallactorsounds command, wich would be very usefull to stop all of the audio the actor is currently playing ( for example make him shup up ) before starting a new soundfile. with a large batch or dedicated audio que's excluding every instance would be a pain in the ass to do. even with as little as 6 pain reactions, you'd have to program a multitude of that. so unless im missing something, and if eduke is still in development something like that would seem very helpfull.

anyway, back to mucking about.


AFAIK there is no way to do that. I have this problem as well. So I end up with code like this:

ifactorsound THISACTOR EDFL_PAIN1 nullop else
ifactorsound THISACTOR EDFL_PAIN2 nullop else
ifactorsound THISACTOR EDFL_PAIN3 nullop else
{
	rand temp 2
	ife temp 0 sound EDFL_PAIN1
	ife temp 1 sound EDFL_PAIN2
	ife temp 2 sound EDFL_PAIN3
}


And believe me I have much worse examples than that, that's just the first one I found on a quick search of my code.
0

User is offline   jimbob 

#2809

i was afraid of that, well time to crack some knuckles and get to work then :o :(
0

User is offline   jimbob 

#2810

is there a way to make 2 sprites "stick" together, think sticky bombs in shadow warrior for instance. and if so, can i get one of them to have a different angle relative to the original sprite? say like a tank hull, and turret, so i can rotate the turret individually while moving in a different direction? in situation 1 it can use a bit of leeway, or wiggleroom but in situation 2 the sprites need to be alligned absolutely perfectly at all times.

This post has been edited by jimbob: 20 March 2022 - 07:14 AM

0

User is offline   dandouglas 

#2811

Is there away to edit/disable individual stats on the bonus/intermission screen (times/kills/secrets)?

Reason being is that I'm using map caching code but I can't get it to retain the correct stats between linked maps (when the nuke button is hit or the player enters an end-level sector, only stats from the specific map it's located in are displayed, not the accumulated total between linked maps).

I've tried studying the AMC Squad map caching code but I can't work out how it's retaining these stats within hubs (something to do with saving arrays I think, but I'm way too inexperienced with CON to work out what).

I know I can disable the bonus/intermission screens entirely, but I don't want to, as I want breaks between certain maps in my mod, and while I've tried custom intermissions using the startscreen command, they're too abrupt and easily skipped by the player (unless I can completely disable player input for a specified amount of time when one of these screens is displayed?) Besides, I'd like to keep the animation of Duke reloading his shotgun.

The only other option I can think of is drawing sprites on bonus/intermission screen using EVENT_DISPLAYBONUSSCREEN to literally conceal the times/kills/secrets popping up, but that seems somewhat clumsy, and the RPG sound effect will still play when each stat is displayed.

Cheers!
0

User is online   Mark 

#2812

If you decide to go the last route, I used this code which disables sounds you specify only when in a menu screen. Somewhere in the wiki is a list of the possible screens to use this in. In this example I used 1,4,6,8. Hopefully the screens you wish to use it in are available. I put this at the bottom of my game.con file.
// disable menu sounds

state remove_explosion
ifvare RETURN PIPEBOMB_EXPLODE
setvar RETURN -1
ends

state remove_kickhit
ifvare RETURN KICK_HIT
setvar RETURN -1
ends

state remove_lasertrip
ifvare RETURN LASERTRIP_EXPLODE
setvar RETURN -1
ends

onevent EVENT_SOUND
getplayer[THISACTOR].gm temp
getplayer[THISACTOR].palette temp
ifvare temp 6 state remove_explosion state remove_kickhit state remove_lasertrip // ANMs
ifvare temp 4 state remove_explosion state remove_kickhit state remove_lasertrip // title screen

ifvarand temp 1 state remove_explosion state remove_kickhit state remove_lasertrip // menus
ifvarand temp 8 state remove_explosion state remove_kickhit state remove_lasertrip // end-of-level
endevent
0

User is offline   dandouglas 

#2813

Cheers Mark, that's a great shout - I can't find the number which references the bonus screen but I'll keep digging on the wiki. Removing "ifvare temp x" turns off the explosion SFX on the bonus screen, so it's definitely possible somehow!

In the meantime I've knocked up a Dukeless intermission which I'm pretty happy with, hiding the stats but retaining the "press any key to continue" prompt.
0

#2814

Might be a long shot, but you have shown to be helpful time and time again.

In our dukematches, I get these logs in netduke32.log:

Line 884, setactor: tried to set ang on invalid target sprite (-1) from spr 503 pic 1405 gv RETURN
Line 896, setactor: tried to set zvel on invalid target sprite (-1) from spr 503 pic 1405 gv RETURN


These lines are repeated maybe 1000 times in a 10 minute game. It seems they come and go. I can't use the line numbers, they don't match anything in my GAME.CON it seems.

What I've tried so far is to have a guard every time I get/set ang or zvel (but it doesn't work):

setvarvar tempsixteen THISACTOR
ifvarn tempsixteen -1 getplayer[THISACTOR].ang tempone


and

setvarvar tempten RETURN
ifvarn tempten -1 getactor[RETURN].zvel tempone


Does the error logs tell me something I can use to find/solve the issue?
0

User is offline   jimbob 

#2815

any way to turn off the map title thats being loaded from the loading screen? just loading is fine for me, i dislike the map title in the screen because it can give away hints, unless i call all my maps something cryptic or just numeric.
0

User is offline   Danukem 

  • Duke Plus Developer

#2816

https://wiki.eduke32...Show_level_text
0

User is offline   jimbob 

#2817

thanks, i missed that one :)
0

#2818

wiki.eduke32.com returns 500, Internal server error atm
0

User is offline   oasiz 

  • Dr. Effector

#2819

Probably a service crashed or something, let's see when TX gets to it.
0

User is offline   oasiz 

  • Dr. Effector

#2820

fixed, apparently an update changed how the installation path is handled in config and that broke things.
0

Share this topic:


  • 95 Pages +
  • « First
  • 92
  • 93
  • 94
  • 95
  • 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