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

Jump to content

  • 119 Pages +
  • « First
  • 52
  • 53
  • 54
  • 55
  • 56
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Jblade 

#1591

Welcome! CON scripting is easier than Decorate from what I've seen but there's less hand holding in certain places - I'd recommend first taking a look at the basic game's CON files (which you can open with any old text editor) and getting a feel for it. Than grab an Eduke32 mod and take a look at the code there - it gets complex fast but the upside is you have a huge amount of control over pretty much every single thing in the game. Look at WGR2, DNF2013, or AMC TC for some examples of what's possible :)
0

User is offline   DavoX 

  • Honored Donor

#1592

Do you guys use plain notepad or some code program with colors and shit?
0

User is offline   Mark 

#1593

Notepad++ is a popular one.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#1594

View PostDavoX, on 24 February 2015 - 03:21 PM, said:

some code program with colors and shit?

I lol'd...
The colours and shit are there for a reason...

But yes, notepad++ is what most programmers use.
You would have to be a idiot to try edit with notepad/word.
It removes all the formatting and indentation.

Also, if you want to learn LUA, the best place to start would be to look around the Garry's Mod community.
It's the main coding language used for all the mods/addons.
The structure *should* be identical to how it's used in EDuke32.

This post has been edited by Commander Cody: 24 February 2015 - 03:48 PM

1

User is offline   xenoxols 

#1595

Umm... wow this is way more complicated than DECORATE. Is there a way to have a sprites name not be a tile number?
0

User is offline   Jblade 

#1596

Yeah, you need to define it first though - so for instance if your sprite is called ROBOTDUDE you would have this code:
define ROBOTDUDE *tilenumber*

and then you can simply use ROBOTDUDE if you want to refer to that actor in other code.
0

User is offline   Danukem 

  • Duke Plus Developer

#1597

  ifvare vaca_pose 1
    {
      ai AIBEACHBABEPOSE
      break
    }


What is this? Vars are an eduke thing; the original Vacation did not have them.

If vaca_pose is set to 1, that will cause the sprite to do that ai and break, so that would make it freeze (since the ai in question doesn't move).
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1598

1. Use the attach function instead of pasting files in the body of your post.
2. You are on the right track by using the Vaca+ con instead of the original one, because the original used nasty hacks to support v1.3D, which I removed in Vaca+ in the name of modularity. In addition, Vaca+ supported Duke Plus for a time until it added the Super Trooper in a non-modular fashion, so you have a better chance of it working right off the bat.
3. Remove the block Trooper Dan posted from your code; you won't need it. I added it to assist in taking screenshots: "vaca_pose" is a gamevar that is never changed during normal gameplay; I would set it from the console.
4. Be sure you defined all the sounds the beach babe uses. These come in two parts: a "define" for the label, which assigns the sound an ID number, and a "definesound", which gives the sound a file name and a few properties.
5. Be sure all the states that the code calls are included in the cons. For example, I don't see where you included "state stopbeachbabebathersounds".
0

User is offline   Danukem 

  • Duke Plus Developer

#1599

Maybe I'm just really rusty with my CON coding, but I don't understand why it says it is expecting '{'

Usually when those errors happen it is the RIGHT bracket that is missing, not the left. The code you have attached looks like it should work. It could be a compiler bug, but, in my experience the cause is usually something that is not being shown. There's a lot of stuff being loaded that you aren't showing us, including your custom def file.

You might want to try typing the girl code into a new CON file, just in case there are hidden characters in your file that are messing with the compiler. I have actually had that issue (long, long ago). While you are at it, replace the defined labels with constants.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1600

 1337DirtAlliance, on 21 March 2015 - 06:31 PM, said:

Whats a constant??? I'm far from being a CON coder myself.

Use just 5225 instead of BEACHBABE1.
0

User is offline   Danukem 

  • Duke Plus Developer

#1601

 1337DirtAlliance, on 21 March 2015 - 11:13 PM, said:

Tried that for both the beach and my custom girl and still nothing. Same { errors


Have you tried using a debug build to see if it gives you more information in the log file when it fails?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1602

 Trooper Dan, on 20 March 2015 - 11:57 PM, said:

There's a lot of stuff being loaded that you aren't showing us, including your custom def file.

Speaking of, are these ALL the CON files you are using?
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1603

^ Yup, that's an important point.

GIRLS.CON compiles fine as a module for me ("-mx GIRLS.CON"). It may really be helpful if we could see all CON files that get translated. From the log, it seems like GAME.CON is the root file for you. I don't understand why the error spam appears long after the script has been compiled. Also, r4410 is somewhat outdated; please try the most recent synthesis build.
0

User is offline   Mblackwell 

  • Evil Overlord

#1604

-x uses girls.con as your main CON file. -mx includes it in addition to whatever's defined in GAME.CON. Also you should include your CON files in GAME.CON, not in the def.
0

User is offline   Mblackwell 

  • Evil Overlord

#1605

You have such an odd assortment of CON files. When debugging CON you strip everything down to the fewest number of CON files/last known "good" state and then add things in until it breaks.

And that log actually says you don't have palette.dat.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1606

Do you have a copy of DUKE3D.GRP in the directory?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1607

 1337DirtAlliance, on 26 March 2015 - 02:08 PM, said:

it appears that the game con right out of the box has issues.

True. But it doesn't break the game.

This post has been edited by Fox: 26 March 2015 - 02:18 PM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1608

 1337DirtAlliance, on 26 March 2015 - 02:08 PM, said:

I deleted all game data and did a fresh install and it appears that the game con right out of the box has issues.

The original cons have warnings, yes, but they don't affect the game.
0

User is offline   Mblackwell 

  • Evil Overlord

#1609

it says in the warning you have a stray "ends". You probably wanted "enda".
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1610

No, it's more than just that. Apparently there is an open actor prior to his CON.
0

User is offline   Lava Grunt 

#1611

Just asking if dev build 5118 is capable of loading USER.CON, as I have it in my EDuke32 folder but it isn't used at all when I launch the game.

Nevermind, latest release on the port's webpage fixed the corrupted save game problem and also seems to load my con file again.

This post has been edited by Lava Grunt: 10 April 2015 - 10:47 AM

0

User is offline   xenoxols 

#1612

Is there a way to add recoil (view tilting upwards) to weapon firing?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1613

Yes. But it depends on how you want to do it.
0

User is offline   xenoxols 

#1614

Well I'm kind of a noob and I don't know how to find an example of duke3d's EVENT_DOFIRE, so I can't find any firing states. They're not in the weapons.con.sample included with eduke32, as far as I know.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1615

This should work:

gamevar TEMP 0 0
gamevar TILT 0 1

onevent EVENT_DOFIRE
  switch player[THISACTOR].curr_weapon
  case PISTOL_WEAPON
  case CHAINGUN_WEAPON
    setvar TILT 3
  break
  case SHOTGUN_WEAPON
    setvar TILT 10
  break
  endswitch
endevent

onevent EVENT_GAME
  ifactor APLAYER
  ifvarn TILT 0
  {
    getplayer[THISACTOR].horizoff TEMP
    addvarvar TEMP TILT
    setplayer[THISACTOR].horizoff TEMP
    setvar TILT 0
  }
endevent


This post has been edited by Fox: 27 April 2015 - 05:34 PM

1

User is offline   xenoxols 

#1616

Hey thanks, I just added the other weapon in there (minus pipebombs and the mighty foot) and it worked great.
1

User is offline   Chip 

#1617

I've made enemies get bigger each time they are struck by the Expander, and with it made their sounds get deeper using "setactorsoundpitch".

However, a problem occurs - it appears that the setactorsoundpitch command doesn't set the sound pitch but instead adds/subtracts from what's already there (assuming it modifies the sound after any defined properties are added). This means sound files defined to have a random pitch will affect how setactorsoundpitch is applied. So if by random the defined sound pitch for the sound file gives it +256, then if setactorsoundpitch is set to -512, I end up with only -256 sound pitch.

Is there any way to have the sound pitch for a sound file be exactly what setactorsoundpitch sets? Can I reset the sound pitch for a sound before using setactorsoundpitch? Or is the only solution to remove all defined sound pitch flags from the sound files and use setactorsoundpitch to add them back, but not when my enemies get expanded?

This post has been edited by Chip: 22 May 2015 - 05:59 AM

1

User is offline   Hendricks266 

  • Weaponized Autism

  #1618

 Chip, on 22 May 2015 - 05:53 AM, said:

However, a problem occurs - it appears that the setactorsoundpitch command doesn't set the sound pitch but instead adds/subtracts from what's already there (assuming it modifies the sound after any defined properties are added). This means sound files defined to have a random pitch will affect how setactorsoundpitch is applied. So if by random the defined sound pitch for the sound file gives it +256, then if setactorsoundpitch is set to -512, I end up with only -256 sound pitch.

The behavior you've described is exactly as intended.
1

User is offline   Chip 

#1619

Ok, I can work around that, now that I know exactly how it works.

Next question: Can I prevent the player from saving the game? I tried using "setvar RETURN -1" from within EVENT_SAVEGAME, but the event continues as normal and a saved game is created.

This post has been edited by Chip: 28 May 2015 - 04:51 AM

0

User is offline   Perro Seco 

#1620

Is there any way via CON files to hide or delete some functions from this list?

Also, can I hide other options from the options menu like "Duke Talk" or "Screen Size"? They'll be unused in my TC.

This post has been edited by Perro Seco: 13 June 2015 - 03:57 AM

0

Share this topic:


  • 119 Pages +
  • « First
  • 52
  • 53
  • 54
  • 55
  • 56
  • 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