CGS - Forums

Duke Nukem Boards => Duke 3D Resources => Topic started by: MrScienshit on 06 July 2014, 15:59:39

Title: Con editing questions
Post by: MrScienshit on 06 July 2014, 15:59:39
Hello Im new, and I want to ask a question on editing the CON files of duke.
Will the following be possible by just editing the CON files

1. make the pistol and shotgun reload by adding or replacing a key to reload.
2. change reload time
  -shotgun shoots 2 times before reloading
  -pistol shoots 7 times before reloading
3. increase or decrease the delay of shooting on weapons.
  -pistol 1 second delay on shooting
  -rapid firing rpg
4. Make the chain gun overheat
   -after shooting maybe 50 bullets it must cooldown for 10 seconds
5. completely remove autoaim
6. Make duke use the vending machines and regain health, but hurts him if used more than 3 three times.
7. Change the color of the weapons or items at certain times
   - like the chaingun turning red when heating up
8. Hurt duke if he tries to shoot the heating chaingun.
9. What is the maximum swear frequency?
10. Get less likely to be hit when jumping and crouching.
11. Roaming enemies instead of waiting for duke.

If this topic on the wrong place Ill move it. If it should not be a topic, please tell.
My goal here is to create a custom con for everyone with those customizations.
Title: Re: Con editing questions
Post by: MSandt on 06 July 2014, 16:16:26
The answer to probably all of those is yes. There are mods that already have many of those features (check DukePlus & WGRealms for example).
Title: Re: Con editing questions
Post by: MrScienshit on 06 July 2014, 16:58:07
will all this still be possible by editing only the con files? Without using a fancy mod? It doesnt matter if its hard, coding them all and stuff, as long as its possible.
Title: Re: Con editing questions
Post by: MSandt on 06 July 2014, 17:28:59
You don't need mods so long as you're using EDuke32.
Title: Re: Con editing questions
Post by: Micky C on 07 July 2014, 14:53:29
The problem with making the chaingun turn red is that it'll be a sudden thing; no smooth colour transition which probably won't look that good, unless you include extra art with the chaingun having different tints of red at different levels of overheating.
Title: Re: Con editing questions
Post by: MrScienshit on 07 July 2014, 16:18:40
never thought of that, I always thought of it to change color abruptly. Its a really nice idea, but how will the coding be done? I dont know if its possible by manipulating game.con
Title: Re: Con editing questions
Post by: Forge on 07 July 2014, 16:46:24
try reading some FAQs

http://dukertcm.com/knowledge-base/downloads-rtcm/duke3d-faqs-con/
http://dukertcm.com/knowledge-base/downloads-rtcm/duke3d-tools-con/
Title: Re: Con editing questions
Post by: MSandt on 07 July 2014, 19:21:02
You've got a lot of work ahead of you and no one will do any of that stuff for you. The best way is to learn by example; if you see a cool effect somewhere, check the cons to see how it's done. EDuke32 wiki is a very useful database when it comes to variables, events & such that come across in con files.
Title: Re: Con editing questions
Post by: James on 07 July 2014, 23:55:01
You can check out my old mod Nuclear Showdown (http://dukerepository.com/index.php?getFile=1999) which does a few of those things on your list (manual reloading for pistol and shotgun, .etc) The mod is old and buggy, but you're welcome to any and all of the stuff inside to help you on your way. Unfortunately the best way to learn CON is to jump straight in, there are tutorials on the Eduke32 wiki but it's best to examine mods like that and the AMC TC as well.
Title: Re: Con editing questions
Post by: MrScienshit on 09 July 2014, 01:33:24
Thanks James! The nuclear showdown was exactly what I want to do, gameplay weapon enchancement, by con editing. I havent seen this mod so Im going to go play it and study the scripting in this. Im going to keep the thread open if someone ask another con editing question.
Title: Re: Con editing questions
Post by: anvil on 10 July 2014, 22:34:53
I've created an episode by substituting the original duke levels with user maps in user.con.
After finishing the first level, it was loaded again instead of the second one.
what's the solution?
Title: Re: Con editing questions
Post by: Puritan on 10 July 2014, 22:48:56
You've named the levels properly I assume?
E1L1....E1L2....etc.

Title: Re: Con editing questions
Post by: anvil on 10 July 2014, 22:59:47
Yes I did.
Title: Re: Con editing questions
Post by: Puritan on 10 July 2014, 23:08:30
Check one more time  :)


And how does the map end?
Nukebutton, ending zone or boss?
You've remember to tag the button or ending zone = 0,65535 ? ( If the nuke button is palletted the engine will look for a "secret" level. Typical the last map in the E1LX series).

Title: Re: Con editing questions
Post by: anvil on 10 July 2014, 23:21:27
Quote from: Puritan on  10 July 2014, 23:08:30
Check one more time  :)
Checked.
Quote from: Puritan on  10 July 2014, 23:08:30
And how does the map end?
Nukebutton, ending zone or boss?
Nukebutton.
Quote from: Puritan on  10 July 2014, 23:08:30
You've remember to tag the button or ending zone = 0,65535 ? ( If the nuke button is palletted the engine will look for a "secret" level. Typical the last map in the E1LX series).
It isn't my map.
Title: Re: Con editing questions
Post by: Puritan on 10 July 2014, 23:27:01
It's almost impossible to sort out this problem without having your entire Duke folder to drag apart.
I've raised close to twenty questions by now...


Why don't you download my sucky episode "Vermin Clearance".
I've replaced the fourth episode in this episode.
Open User.con and have a look.
See the files folder and look at the map names.
Also open the maps and see the tags ( I've used nukebuttons, ending zones and boss ).
Title: Re: Con editing questions
Post by: anvil on 10 July 2014, 23:49:49
If it helps anything, the maps are:

definelevelname 1 0 dmeat.map 02:30 01:19 dmeat
definelevelname 1 1 mppower.map 02:30 01:26 mppower
definelevelname 1 2 ballroom.map 05:00 02:26 ballroom
definelevelname 1 3 FRUIT.map 04:30 02:14 FRUIT
definelevelname 1 4 _balley.map 03:00 01:26 _balley
definelevelname 1 5 POLARISO.map 02:30 01:04 POLARISO
definelevelname 1 6 NUKED1.map 04:45 02:15 NUKED1
definelevelname 1 7 Hell-st.map 11:30 04:59 Hell-st
definelevelname 1 8 WATERBAS.map 05:00 02:26 WATERBAS
definelevelname 1 9 FETUSBOY.map 03:00 01:19 FETUSBOY
definelevelname 1 10 ALIENS2.map 03:00 00:52 ALIENS2
Title: Re: Con editing questions
Post by: Puritan on 11 July 2014, 08:18:49
If this is a direct quote from your User.con I can tell that this wont work.
I'm at work atm but from the top of my head the lines would look something like this:


definelevelname 0 0 E1L1.map 02:30 01:19 Dead Meat
definelevelname 0 1 E1L2.map 02:30 01:26 MPpower
definelevelname 0 2 E1L3.map 05:00 02:26 Ballroom


Rename the maps accordingly.
Title: Re: Con editing questions
Post by: Puritan on 11 July 2014, 08:58:27
This way of naming the maps....E1L1 - E1L2....etc, would display Duke shooting the battlelord in the head as the final cutscene ( you know, when the game is over )


If you wanna have Duke to shit down the overlords neck:
Rename levels to: E2-L1 - E2L2....etv


If you wanna have Duke to kick the cycloid emperors head:
Rename the levels to: E3L1 - E3L2...etc


If you wanna have Duke to abort the queens species:
Rename the levels to: E4L1 - E4L2....
Title: Re: Con editing questions
Post by: anvil on 11 July 2014, 14:23:02
I did what you'd suggested and the result was the same.
Title: Re: Con editing questions
Post by: Forge on 11 July 2014, 15:22:36
Quote from: anvil on  10 July 2014, 22:34:53
After finishing the first level, it was loaded again instead of the second one.
are you playing it from the episode menu, or are you just browsing to the first user map and playing it?
Title: Re: Con editing questions
Post by: anvil on 11 July 2014, 16:09:11
I'm playing it from the episode menu.
Title: Re: Con editing questions
Post by: Forge on 11 July 2014, 19:41:18
the episode starts fine and launches the first map in the list, but after finishing the first map it restarts the game with the first map?

lets keep it simple for now and just use two maps until we can figure out where the problem is:
(make sure you rename dmeat.map to E1L1.map & mppower.map to E1L2.map and that they're both in the main Duke3D directory)

user.con should look like:

// Volume titles cannot excede 32 characters.

definevolumename 0 MY COLLECTION
definevolumename 1 LUNAR APOCALYPSE
definevolumename 2 SHRAPNEL CITY
definevolumename 3 THE BIRTH


// Skill titles cannot excede 32 characters.

defineskillname 0 PIECE OF CAKE
defineskillname 1 LET'S ROCK
defineskillname 2 COME GET SOME
defineskillname 3 DAMN I'M GOOD


// Level file names cannot excede 128 characters.
// Level par cannot excede 5 characters (min:sec)
// Level titles cannot excede 32 characters.

definelevelname 0 0 E1L1.map 02:30 01:19 Dead Meat
definelevelname 0 1 E1L2.map 02:30 01:26 MPpower

definelevelname 1 0 E2L1.map 02:30 01:19 SPACEPORT
definelevelname 1 1 E2L2.map 02:30 01:26 INCUBATOR
definelevelname 1 2 E2L3.map 05:00 02:26 WARP FACTOR
definelevelname 1 3 E2L4.map 04:30 02:14 FUSION STATION
definelevelname 1 4 E2L5.map 03:00 01:26 OCCUPIED TERRITORY
definelevelname 1 5 E2L6.map 02:30 01:04 TIBERIUS STATION
definelevelname 1 6 E2L7.map 04:45 02:15 LUNAR REACTOR
definelevelname 1 7 E2L8.map 11:30 04:59 DARK SIDE
definelevelname 1 8 E2L9.map 05:00 02:26 OVERLORD
definelevelname 1 9 E2L10.map 03:00 01:19 SPIN CYCLE
definelevelname 1 10 E2L11.map 03:00 00:52 LUNATIC FRINGE

definelevelname 2 0 E3L1.map 02:30 01:11 RAW MEAT
definelevelname 2 1 E3L2.map 04:45 02:18 BANK ROLL
definelevelname 2 2 E3L3.map 03:00 01:57 FLOOD ZONE
definelevelname 2 3 E3L4.map 03:15 01:46 L.A. RUMBLE
definelevelname 2 4 E3L5.map 02:30 01:04 MOVIE SET
definelevelname 2 5 E3L6.map 03:30 01:30 RABID TRANSIT
definelevelname 2 6 E3L7.map 02:00 00:55 FAHRENHEIT
definelevelname 2 7 E3L8.map 02:15 01:09 HOTEL HELL
definelevelname 2 8 E3L9.map 02:45 01:17 STADIUM
definelevelname 2 9 E3L10.map 00:45 00:10 TIER DROPS
definelevelname 2 10 E3L11.map 02:00 01:07 FREEWAY

definelevelname 3 0 E4L1.map 03:04 01:32 IT'S IMPOSSIBLE
definelevelname 3 1 E4L2.map 04:00 02:00 DUKE-BURGER
definelevelname 3 2 E4L3.map 03:30 01:45 SHOP-N-BAG
definelevelname 3 3 E4L4.map 06:32 03:16 BABE LAND
definelevelname 3 4 E4L5.map 02:02 01:01 PIGSTY
definelevelname 3 5 E4L6.map 03:04 01:52 GOING POSTAL
definelevelname 3 6 E4L7.map 01:24 00:42 XXX-STACY
definelevelname 3 7 E4L8.map 03:18 01:59 CRITICAL MASS
definelevelname 3 8 E4L9.map 05:02 02:51 DERELICT
definelevelname 3 9 E4L10.map 10:50 05:25 THE QUEEN
definelevelname 3 10 E4L11.map 04:20 02:10 AREA 51


Title: Re: Con editing questions
Post by: anvil on 12 July 2014, 22:18:50
Same result.
Title: Re: Con editing questions
Post by: Forge on 12 July 2014, 22:52:53
try a different map for the first level besides Dead Meat
Title: Re: Con editing questions
Post by: High Treason on 13 July 2014, 00:03:25
Or, add this to the bottom of the CON file;

gamevar PA_PAL 0 2 // Per Actor in case there are multiple, might be OK with 0 1 instead with this event.

ONEVENT EVENT_LOADACTOR
ifactor NUKEBUTTON
{
  getactor[THISACTOR].pal PA_PAL
  ifvare PA_PAL 0
  {
    setactor[THISACTOR].lotag 65535
  }
}
endevent




I have not tested this, but it should force and Pal 0 nuke button to a lotag of 65535. If it DOES have a palette it will not do anything.

Edit: Assumes the use of EDuke32 of course, sorry, I only skimmed and scanned the thread.
Title: Re: Con editing questions
Post by: anvil on 13 July 2014, 05:57:52
You mean game.con, right?
Can't launch the game:
error: expected a keyword but found 'ONEVENT'.
Title: Re: Con editing questions
Post by: High Treason on 13 July 2014, 06:54:16
Any.

Try lowercase "onevent" as most of the language is case sensitive.
Title: Re: Con editing questions
Post by: anvil on 13 July 2014, 22:49:35
Tried it, and once again: after finishing the first level, it was loaded again.
Title: Re: Con editing questions
Post by: High Treason on 13 July 2014, 22:58:35
How odd... Could you send me the map, I can't find it anywhere (MSDN link is dead, doesn't appear to be here or at Dukeworld) and I'll try to figure out what's wrong with the nuke button. I'm starting to think somebody changed the pal of it and didn't tag it properly.

Assuming it's not a secret level nuke button (I think they are green or brown, can never remember) you may be able to substitute "ifvare PA_PAL 0" for "ifvarn PA_PAL 14" which will then act on any NUKEBUTTON that isn't Pal 14, but I'd like to look into the map myself and figure out what's actually going on as this is strange behavior indeed.
Title: Re: Con editing questions
Post by: anvil on 13 July 2014, 23:06:22
http://dukeworld.duke4.net/2001-current/maps/a-e/Dmeat.zip (http://dukeworld.duke4.net/2001-current/maps/a-e/Dmeat.zip)
Title: Re: Con editing questions
Post by: High Treason on 13 July 2014, 23:24:34
Aha, it is correctly tagged but the Pal is set to 24, this seems to work;

gamevar PA_PAL 0 1

onevent EVENT_LOADACTOR
ifactor NUKEBUTTON
{
  getactor[THISACTOR].pal PA_PAL
  ifvarn PA_PAL 14
  {
    setactor[THISACTOR].pal 0
    setactor[THISACTOR].lotag 65535
  }
}
endevent



This should force it back to pal 0 as well (though visually it is taking the palette of the sector it is located in anyway) and cause the game to treat it as a proper nuke button instead of looking for a nonexistent secret level... I thought only Pal 14 buttons went to secret levels, apparently not. This code shouldn't run on Pal 14 buttons however.
Title: Re: Con editing questions
Post by: Forge on 13 July 2014, 23:47:34
since he's making his own personal episode out of user maps, wouldn't it be easier to just set the pal to 0 in the map itself?
Title: Re: Con editing questions
Post by: anvil on 14 July 2014, 09:50:09
This works indeed, thank you  :)
However, since this isn't a full solution, as you wrote, I'll probably encounter issues like this in the future.
Title: Re: Con editing questions
Post by: High Treason on 14 July 2014, 12:15:05
This is why I suggested code, that will run at the start of every level and thus correct any other nuke button that either isn't tagged right or isn't the correct palette. Of course if a different problem arises it should probably be possible to expand or add code to get rid of it... Or you can edit the maps as Forge suggests.
Title: Re: Con editing questions
Post by: anvil on 17 July 2014, 17:10:08
I got another related question:
What is the code for all the items to be reseted at the beginning of each level in the episode?
Title: Re: Con editing questions
Post by: anvil on 03 August 2014, 03:52:23
I've encountered an issue when playing "military madness" map within an episode:
After I'd finished this map, which ends with an ending zone, the episode ended instead of loading the next level.
Title: Re: Con editing questions
Post by: MrScienshit on 04 August 2014, 12:41:23
I thought that was just a single map? Anyway answer
what is the episode?
What should be the next level?
Did you alter the user.con?
Title: Re: Con editing questions
Post by: anvil on 04 August 2014, 17:16:28
It's an episode I made out of user maps.
Anyway, I've solved the problem:
The next level wasn't loaded because I'd inserted its original file name which contained more than one word to user.con.
I didn't know that map's file name in user.con cannot contain more than one word.