Duke4.net Forums: CON coders/mappers help needed - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CON coders/mappers help needed

User is offline   NightFright 

  • The Truth is in here

#1

Hey folks!

For my EDuke32 addon pack compilation, I am looking for some folks who know their stuff with CON coding and possibly some map editing who could take a look at remaining issues I am encountering in some of the addons I want to include with the release.

Mainly, it's about the infamous "sprite resize bug", but in a few cases also regarding stuff I am unable to solve with specific maps. You would need the CON/map files and probably also the groupfiles themselves which I can provide you on demand for investigation. A more detailled list about what kind of fixes I would need can be found here ("Remaining issues").

Thanks a lot in advance!
0

User is offline   Jblade 

#2

The fix for the sprite resize issue is fairly simple - find out the actor's name (or just use it's tile number) and use this code:
eventloadactor *actror name or tile number here* setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda

You'd have to create varients of that for different versions of the actors like stayput ones as well, but that'll make the sprite size down on mapload instead of when it sees the player.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #3

The standalone eventloadactor block is deprecated. Use EVENT_LOADACTOR. That way, you can use switch/case to keep the code clean.
1

User is offline   NightFright 

  • The Truth is in here

#4

But what follows after that command remains the same, right?
And: Where to put the code in general? Game.con, user.con... or does it even matter? It's relevant where I put the code in the con, beginning, end, anywhere?

This post has been edited by NightFright: 30 August 2014 - 04:14 PM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #5

I would suggest adding the line:

include patches.con

to the bottom of GAME.CON, and including a patches.con with anything that doesn't require modification of something already in the existing CONs.
1

User is offline   NightFright 

  • The Truth is in here

#6

And the values for <xsize> and <ysize> I also find in game.con (I guess it must be something with "sizeat") - if not, is there any other way to determine actor sizes?

Currently, I only put lines into patches.con like for "The Gate":
// Heavy Tank
EVENT_LOADACTOR 1870 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda

// Predator
EVENT_LOADACTOR 4806 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 4812 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 4818 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 4819 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 4839 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda

// Flying Brain
EVENT_LOADACTOR 5321 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 5326 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
EVENT_LOADACTOR 5331 setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda

(I know I have to replace the *xsize and *ysize parts with values still, but I haven't found them yet.)

EDuke32 then gives an error like
patches.con:6: error: expected a keyword but found `EVENT_LOADACTOR'

I have to put something else in there as well?

This post has been edited by NightFright: 31 August 2014 - 06:42 AM

0

User is offline   LeoD 

  • Duke4.net topic/3513

#7

View PostHendricks266, on 30 August 2014 - 06:53 PM, said:

I would suggest adding the line:
include patches.con
to the bottom of GAME.CON, and including a patches.con with anything that doesn't require modification of something already in the existing CONs.
What about the bottom of USER.CON? That would retain DukePlus compatibility for a number of episodes.

View PostNightFright, on 31 August 2014 - 06:40 AM, said:

EDuke32 then gives an error like
patches.con:6: error: expected a keyword but found `EVENT_LOADACTOR'

I have to put something else in there as well?
EVENT_LOADACTOR appears to be a constant. So your code probably should look something like:
onevent EVENT_LOADACTOR
{
setactor[THISACTOR].xrepeat *xsize setactor[THISACTOR].yrepeat *ysize enda
[...]
}

Maybe you can figure it out by looking into DUKEPLUS.CON
1

User is offline   NightFright 

  • The Truth is in here

#8

An example may help. "The Gate" should be the easiest since only one enemy is affected by the resize issue - the Predator.

In BDP.CON, I found info about the tilenums:
define PREDATOR        4818
define PREDSTAYPUT     4819


So I guess a fix for 4818 and 4819 is needed.

That's actually almost as far as I get. It's hard to find the size of the thing. The whole Predator code in BDP.CON is this:
Spoiler

Only conclusive sizeat I can see is 42 36, so maybe it's that.

But how to define the two entries for this EVENT_LOADACTOR stuff, then?

This post has been edited by NightFright: 31 August 2014 - 12:25 PM

0

User is offline   Jblade 

#9

by this method:
onevent EVENT_LOADACTOR
 switch sprite[THISACTOR].picnum
 case PREDATOR
 case PREDATORSTAYPUT
  setactor[THISACTOR].xrepeat 42
  setactor[THISACTOR].yrepeat 36
 break
 endswitch
endevent

Untested but that should work (not sure if you can access the variable directly like that with a switch, if not try this:
gamevar picnum 0 2
onevent EVENT_LOADACTOR
getactor[THISACTOR].picnum picnum
 switch picnum
 case PREDATOR
 case PREDATORSTAYPUT
  setactor[THISACTOR].xrepeat 42
  setactor[THISACTOR].yrepeat 36
 break
 endswitch
endevent


Place that after the con file includes the mod's Def file (or after the 'include' commands which are usually at the top of the file) If there are no defines for a tile/monster, just use it's tile number instead.

This post has been edited by Jblade: 31 August 2014 - 12:51 PM

1

User is offline   NightFright 

  • The Truth is in here

#10

Great! I will check! But wasn't it "PREDSTAYPUT" instead of "PREDATORSTAYPUT" (for 4819)?

This post has been edited by NightFright: 31 August 2014 - 01:30 PM

0

User is offline   Jblade 

#11

Yeah I didn't read it properly, use the correct tile name :)
0

User is offline   NightFright 

  • The Truth is in here

#12

In case of several entries with different sizes, one EVENT_LOADACTOR would still be enough?

Something like:
onevent EVENT_LOADACTOR
 switch sprite[THISACTOR].picnum

 case ACTOR1
 case ACTOR2
    setactor[THISACTOR].xrepeat 40
    setactor[THISACTOR].yrepeat 40
 break

case ACTOR3
case ACTOR4
case ACTOR5
    setactor[THISACTOR].xrepeat 30
    setactor[THISACTOR].yrepeat 30
break

 endswitch
endevent


This would kinda group entries that all have the same sizeat values (even if it's about completely different sprites) - does this work?

When looking at "Grins of Divinity", the code above seems to have little effect. All actors just have numbers in GOD1.con - I don't think that's a problem, but the thing is they added highres sprites which are apparently sized down later. It was already like that from the beginning, so I'm not sure if this method also works there.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#13

Use EVENT_SPAWN instead, since it applies to both loaded and spawning monsters.
0

User is offline   NightFright 

  • The Truth is in here

#14

Seems to work. I will need to do some playtesting to see whether it really fixes all occurring sprites in the levels, but a few checks look promising.

Here is what the current patch files look like:

The Gate
Spoiler

Grins of Divinity
Spoiler

Infestation in Time
Spoiler

Duke, It's ZeroHour
Spoiler

If there is any way to improve the code further, don't hesitate to point it out. Currently, I am adding the patches.con files at the end of any game.con.
0

User is offline   LeoD 

  • Duke4.net topic/3513

#15

View PostNightFright, on 01 September 2014 - 05:23 AM, said:

Currently, I am adding the patches.con files at the end of any game.con.

View PostLeoD, on 31 August 2014 - 07:19 AM, said:

What about the bottom of USER.CON? That would retain DukePlus compatibility for a number of episodes.
?

View PostNightFright, on 01 September 2014 - 05:23 AM, said:

If there is any way to improve the code further, don't hesitate to point it out.
When GAME.CON gets edited anyway you could put a line like
setgamename Infestation in Time

near the beginning to set the Window title bar.
0

User is offline   NightFright 

  • The Truth is in here

#16

I can check whether it makes any difference whether patches.con is loaded after user.con (so technically before game.con contents) or not. If it doesn't, I guess I can just as well do it. After all, only 4 addons are affected by this.

*EDIT September 1, 2014*
Seems to work. For "The Gate", I had to switch from actor names to tilenums in patches.con since Predator names aren't defined before bdp.con is loaded, which has to follow after game.con. Apparently this change doesn't make any difference, so fine by me.

*EDIT September 7, 2014*
Two more problems which require your assistance:
- "Nuclear Showdown" uses custom fullscreen HUDs, but they are not optimized for widescreen and leave gaps to the left and right. Is there a way to fix this in the CON files (I guess downloading and checking M210's CON patch would be enough) - and if so, how?
- Can it be done to reset player inventory to default (pistol start) only for specific levels via CON code (without altering the maps themselves)?

This post has been edited by NightFright: 07 September 2014 - 06:32 AM

0

User is offline   NightFright 

  • The Truth is in here

#17

Hope nobody kills me for this bump/doublepost, but it seems that newer EDuke32 snapshots change something about the sprite resize fix that I used in "The Gate" which has visible consequences ingame.

Using thegate.grp from my addon compilation release that used to work by the time of its release (Dec 2014), the addon now produces "fake" Predators which are scattered throughout the maps which look like statues and simply do nothing. They also cannot be shot. I have experimented with different setups:

- Addon compilation version --> behavior as above
- Original addon (unchanged archive download) --> works as intended
- Addon compilation version with "patches.con" (includes resize fix) removed --> works as intended

Contents of patches.con:
// Sprite resize bugfix for Predator (4818 PREDATOR/4819 PREDSTAYPUT)
onevent EVENT_SPAWN
   switch sprite[THISACTOR].picnum
   case 4818
   case 4819
      setactor[THISACTOR].xrepeat 42
      setactor[THISACTOR].yrepeat 36
   break
   endswitch
endevent


EDuke32 version: r5344 x64

Has anything changed about the functionality of this feature since December 2014 or did something possibly break in the meantime?

For testing purposes, download the isolated addon compilation version of "The Gate" here (14.1 MB zipped).

Usage:
- Extract "gatetest" dir into EDuke32 dir
- Launch EDuke32 with -jgatetest dir
- Select "The Gate" from launcher


*EDIT Sep 25, 2015*
Apparently it also doesn't work properly with snapshots from 2014 or earlier. I have no clue what's going on here, I am sure it used to work at some point. Code is still doing what it is supposed to do, but those dummy sprites which are spawned at the same spots all the time are really annoying.

This post has been edited by NightFright: 25 September 2015 - 02:34 AM

0

User is offline   F!re-Fly 

#18

Hi NightFright !

Is there any way to add in the basic GRP file of the game, the enemy "Predator" of add-on "The Gate" ? I try to find help to create different maps with the content add-ons, but no answer.

Francis
0

User is offline   NightFright 

  • The Truth is in here

#19

Off-topic discussion, but anyway:

I guess it is possible if you copy the artfile that contains the tiles plus the code. I dunno how much work that is, but I am sure if you put that request in a separate thread, someone will be able to assist you with it. To be honest, this exceeds my knowledge.
0

User is offline   F!re-Fly 

#20

Thank you ! There is something I do not understand, I thought the topic, it was .CON files programming ?! The problem is that I already create a topic about it, but nobody answers me.
0

User is offline   NightFright 

  • The Truth is in here

#21

Another thing to solve for the con coding specialists out there.

In Zaxtor's "Oblivion", there is a replacement weapon for the shrinker called the "Muddlelizer". According to the website, it's supposed to do this:

This isn't a shrinker... The Muddlelizer is quite an interesting rare weapon. It does minor harm to enemies but kills weak enemies with 1 shot. What the gun does is to cause the enemy to become disoriented/confused. For a short while if you shoot an enemy while he is disoriented, it will hurt him, but if his health is at zero when the disorientation wears off, the enemy will die. This gun can also make you immortal to certain things for several seconds until you hear a noise if the photon hits you. Pressing the button again will switch to the Expander gun.

The problem is that at least with recent EDuke32 snapshots, the Shrinker isn't making you invincible when you hit yourself with it. Instead you stay shrunk and you can't grow back to full size any more. Quite an annoying issue, and I wonder if it can be fixed via con code or it's something that broke at some point within EDuke32. Check out the con file below for analysis. Thanks in advance!

P.S.: Also check out this comparison between my modified oblivion.con and the original game.con. Apparently there seems to be a glitch there since it works with the original con file.

This post has been edited by NightFright: 10 August 2016 - 06:56 AM

0

User is offline   NightFright 

  • The Truth is in here

#22

New request:

I am trying to add additional static and dynamic music tracks to "Starship Troopers TC". This is done because I want to add some custom levels which replace existing music tracks. I don't want the new tracks to override the new ones (would affect other levels), so additional coding is needed since this TC works differently when it comes to music. A sprite (tile #487) is added to the level, and depending on its pal number, different static (nothing happens) or dynamic (enemies appear) music is used.

While I was able to add the new tracks and they are also played ingame, an issue occurs when changing levels - the track played in the previous level plays again, simultaneously with the new one.

The sounds I have added are these:
definesound 400 bts_mus.wav  0 0 255 1  -30000
definesound 401 eots_01.wav  0 0 255 0  0
definesound 402 eots_02.wav  0 0 255 0  0
definesound 403 eots_03.wav  0 0 255 0  0
definesound 404 eots_04.wav  0 0 255 0  0
definesound 405 eots_05.wav  0 0 255 0  0
definesound 406 eots_06.wav  0 0 255 0  0
definesound 407 eots_dyn.wav 0 0 254 1  -15000
definesound 408 eots_mus.wav 0 0 255 1  -30000
definesound 409 its_rein.wav 0 0 255 16 0
definesound 410 its_mus.wav  0 0 255 1  -30000


I have added definitions for spritepal 60-62 for actor 487 to realize the changes (ofc that meant that I had to edit the levels to change the palette of the music sprite).

Please check attached ssttc.con for details.

This post has been edited by NightFright: 19 September 2016 - 06:59 AM

0

Share this topic:


Page 1 of 1
  • 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