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

Jump to content

  • 117 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

View PostMark., on 21 February 2015 - 04:22 AM, said:

Could we please have that extra snippet of code Jblade? Thanks.

Well I don't actually know if it's more efficient this way, it's just a case of checking to see if a variable is equal to 0, if it is than run the check and set that variable then to something like 5 and take away 1 from it if it doesn't equal 0 to create a basic counter. I think that will do what helix described as only checking every few tics but it might be not as efficient as it could be. I doubt you really need to worry about that anyways unless you're using lots and lots of enemies and lots of sprites in the same sector.
0

User is offline   Mark 

#1592

Okey Dokey.
0

User is offline   xenoxols 

#1593

Yo, I'm new around here and I have no Idea where to start with CON scripting. Can anyone point me in the direction of an easy to understand tutorial? I have been modding GZDoom for about a year, but I'm guessing that that will not help.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1594

There is a tutorial on the beginning of GAME.CON. But in the future CON language will be replaced with Luna.
0

User is offline   xenoxols 

#1595

So should I wait for luna? Or will that be a while?
0

User is offline   Micky C 

  • Honored Donor

#1596

View PostFox, on 24 February 2015 - 02:40 PM, said:

There is a tutorial on the beginning of GAME.CON. But in the future CON language will be replaced with Luna.


It's lua, not luna. CON won't be replaced, it'll always be around. But it does seem like lua will ultimately be the more powerful and flexible language (I mean they wouldn't have bothered implementing it if it didn't have significant advantages). So it would be worth learning lua straight up. There's a probably a guide floating around the forum somewhere.

It'd be worth looking up the wiki though, since familiarizing yourself with various aspects of the coding system will give you a leg up when it comes to learning lua for eduke. http://wiki.eduke32.com/wiki/Scripting
0

User is offline   Jblade 

#1597

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

#1598

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

User is offline   Mark 

#1599

Notepad++ is a popular one.
0

User is offline   The Commander 

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

#1600

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 

#1601

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 

#1602

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

#1603

I'm trying to import the beachbabe from vacation and so far all I have is just the model walking in place in game. I went through the Def,Game and User cons and added all the coding for the beachbabe via copy past and defined her tile num where my custom content/model is, still nothings happening. I'm sticking the game code on the very bottom of the document. What am I doing wrong for it not to work?

move BEACHBABEWALKSPEED 70
move BEACHBABERUNSPEED  140
move BEACHBABESHRUNKSPEED  40
move BEACHBABESTOP

action BEACHBABEWALK   0 3 5 1 20
action BEACHBABERUN    0 3 5 1 13
action BEACHBABEFROZE  0 1 5

ai AIBEACHBABEROAM BEACHBABEWALK BEACHBABEWALKSPEED randomangle geth getv
ai AIBEACHBABEWANTDUKE BEACHBABEWALK BEACHBABEWALKSPEED faceplayerslow geth getv
ai AIBEACHBABERUNAWAY BEACHBABERUN BEACHBABERUNSPEED randomangle geth getv
ai AIBEACHBABESHRUNK BEACHBABEWALK BEACHBABESHRUNKSPEED randomangle geth getv
ai AIBEACHBABEGROW BEACHBABEWALK BEACHBABESTOP faceplayerslow
ai AIBEACHBABEFROZEN BEACHBABEFROZE BEACHBABESTOP
ai AIBEACHBABEPOSE BEACHBABEFROZE BEACHBABESTOP

ai AIBEACHBABEFLEE BEACHBABEWALK BEACHBABEWALKSPEED fleeenemy geth getv

state BABEREMARK
   ifactioncount 1
     {
       ifrnd 254 nullop else
     {
       resetactioncount
       ifrnd 1 sound BABECOMM1
  else ifrnd 1 sound BABECOMM2
  else ifrnd 1 sound BABECOMM3
  else ifrnd 1 sound BABECOMM4
  else ifrnd 1 sound BABECOMM5
     }
     }

ends

state BABEHURTREMARK
ends

state BEACHBABEFLEESTATE
   state BABEREMARK

   ifcount 5
     {
       ifpdistl 2000
         {
           ai AIBEACHBABEFLEE
           resetcount
           break
         }
       ai AIBEACHBABEWANTDUKE
     }
ends

state BEACHBABEROAMSTATE
   ifrnd 16 ai AIBEACHBABEROAM

   ifcansee
     ifpdistl 10000
       ifrnd 32
         ai AIBEACHBABEWANTDUKE
ends

state BEACHBABEWANTDUKESTATE
ifpdistl 2000 ai AIBEACHBABEFLEE

ifpdistg 10000
  ifrnd 32
    {
      ai AIBEACHBABEROAM
      break
    }

state BABEREMARK
ends


state BEACHBABERUNAWAYSTATE
   ifactioncount 1
     {
       resetactioncount

       ifrnd 2 sound BABESCREAM1
  else ifrnd 2 sound BABESCREAM2
  else ifrnd 2 sound BABESCREAM3
  else ifrnd 2 sound BABESCREAM4
     }

   ifrnd 16 ai AIBEACHBABERUNAWAY
ends

state BEACHBABESTATE
   fall
   cstator 257

   state babechecksquished

   ifai 0
     {
       ifrnd 64 sound BABECOMM1
  else ifrnd 85 sound BABECOMM2
  else ifrnd 128 sound BABECOMM3
  else sound BABECOMM4

       ai AIBEACHBABEROAM
     }

  ifvare vaca_pose 1
    {
      ai AIBEACHBABEPOSE
      break
    }

  ifai AIBEACHBABEPOSE ai AIBEACHBABEROAM

   ifai AIBEACHBABESHRUNK
     {
       ifcount SHRUNKDONECOUNT
         {
           ai AIBEACHBABERUNAWAY
           cstat 257
         }
       else
         {
           ifcount SHRUNKCOUNT sizeto 40 40
           else state genericshrunkcode
         }
     }
  else ifai AIBEACHBABEGROW
        {
          ifcount 32
            {
              state stopbeachbabebathersounds
              respawnhitag
              guts JIBS4 20
              guts JIBS6 20
             // guts JIBS4 20
             // guts JIBS6 20
              spawn EXPLOSION2
              sound PIPEBOMB_EXPLODE
             // spritepal 6
              soundonce BABESCREAM4
             // debris SCRAP3 4
              sound SQUISHED
              killit
            } 
          else
            {
               sizeto MAXXSTRETCH MAXYSTRETCH
               break 
            }
        }

  ifai AIBEACHBABEFROZEN
    {
      ifhitweapon
        {
          ifwasweapon FREEZEBLAST
            {
              strength 0
              break
            }
          lotsofglass 30
          sound GLASS_BREAKING
          respawnhitag
          ifrnd 84 spawn BLOODPOOL
          killit
        }
      else
        { 
          ifp pfacing
            ifpdistl FROZENQUICKKICKDIST
              pkick
        }
      ifcount THAWTIME
        {
          getlastpal
          ai AIBEACHBABERUNAWAY
        }
      else
          ifcount FROZENDRIPTIME
              ifactioncount 26
               {
                 spawn WATERDRIP
                 resetactioncount
               }
    }

  ifhitweapon
    {
      sound SQUISHED
      ai AIBEACHBABERUNAWAY 
      ifdead
        {
          ifwasweapon GROWSPARK
            {
              cstat 0
              move 0
              sound ACTOR_GROWING
              ai AIBEACHBABEGROW
              break
           }
    else ifwasweapon FREEZEBLAST
           {
 	     ai AIBEACHBABEFROZEN
             move 0
             spritepal 1
             strength 0
             sound SOMETHINGFROZE
             break
           }

          state stopbeachbabebathersounds
          ifrnd 128 sound DUKE_HIT_STRIPPER1 else sound DUKE_HIT_STRIPPER2

          respawnhitag
         // state standard_bjibs
          state standard_bjibs
          state random_wall_jibs
          spawn BLOODPOOL
         // spritepal 6
          soundonce BABESCREAM4
          killit
        }
      else
        {
          ifwasweapon SHRINKSPARK
            {
              sound ACTOR_SHRINKING
              move 0
              ai AIBEACHBABESHRUNK
              cstat 0
              break
            }
         else
           {
             guts JIBS6 1
           }

    // else ifwasweapon GROWSPARK sound EXPANDERHIT
        }
    }



/*
   ifdead
     {
       state standard_bjibs
       sound SQUISHED
       killit
     }
*/

      ifai AIBEACHBABEROAM state BEACHBABEROAMSTATE
 else ifai AIBEACHBABEWANTDUKE state BEACHBABEWANTDUKESTATE 
 else ifai AIBEACHBABERUNAWAY state BEACHBABERUNAWAYSTATE
 else ifai AIBEACHBABEFLEE state BEACHBABEFLEESTATE
ends

useractor notenemy BEACHBABE1 BEACHBABESTRENGTH BEACHBABEWALK
  state BEACHBABESTATE
enda



0

User is offline   Danukem 

  • Duke Plus Developer

#1604

  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

#1605

That code was from the Vacation hrp SVN DL. Figured it was the same. I got the one from the vanilla vacation and just threw the con in instead of just putting the code in the game.con

BEACHBAB.CON:

Spoiler


Edukelog:

Spoiler

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1606

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

#1607

I added the defs to the def.con,user and my own custom con for my custom content. After defining the sounds and reverting back to the beachgirl you wrote and removed that bit of code. It's still throwing the 'Error on line BEACHBAB.CON:48: expecting '{' ..ect codes. Beachbather has her own con file. I'm not adding her con files till I'm done modeling her. I didn't write any of the beachbab.con. I just grabbed it straight from your svn filesource.

Attached File(s)


0

#1608

Also for following the wiki in making new breakable objects. I'm not getting anywhere. I wanted to start on adding the girls but for some reason it's not working. I already defined the girls in the def.con but still it cries about those stupid brackets when they are there. Something so simple and still it doesn't work. For the sake of compatibility issues I made a new folder to test the beacbbitch in and my new Girls.con and still it doesn't work. Didn't add the log file here this time with beachbitch cause she's still throwing the same tears over brackets.

Attached File(s)


0

#1609

Am I seriously thee only one who has tried to implement the wiki con examples and they not work???
0

User is offline   Danukem 

  • Duke Plus Developer

#1610

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

#1611

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


I deleted the girls con and made a new one to see if that would help and it's still crying over the brackets when they are clearly there. I even deleted all the duke files and did a fresh install of everything and it still bitches.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1612

View Post1337DirtAlliance, 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

#1613

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

User is offline   Danukem 

  • Duke Plus Developer

#1614

View Post1337DirtAlliance, 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!

#1615

View PostTrooper 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

#1616

^ 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

#1617

View PostTrooper Dan, on 22 March 2015 - 06:33 AM, said:

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


I have never done that before nor have I ever heard of it.


View PostFox, on 22 March 2015 - 07:37 AM, said:

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



[b]Duke3d - Invasion[/b]

DEF.CON
GAME.CON
USER.CON

     [b]1337DA[/b]
          BEACHBAB.CON
          GIRLS.CON

     [b]DUKEPLUS[/b]
          EDUKE.CON
               dpcons
                    CIVILIANS.CON
                    DEFSPLUS.CON
                    DNE.CON
                    DUKEPLUS.CON
                    HUDPLUS.CON
                    LIGHTS.CON
                    MONSTERPLUS.CON
                    PLAYERPLUS.CON
                    USERPLUS.CON








View PostHelixhorned, on 22 March 2015 - 08:41 AM, said:

^ 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.


I'll go update that. Ahh theres the debug files I don't have. I'll run those 'n see what happens.







Also I wasn't aware that you need to use the command line to call out con files.

This is my def layout it's a txt because it said i wasn't allowed to upload a def

Attached File(s)



This post has been edited by 1337DirtAlliance: 22 March 2015 - 07:32 PM

0

#1618

Now if I use the '-x girls.con' tag in the target line I get whats in the log file and it wont even load. It says there are errors in the con file and ask me if I want to load internals and if I say yes it says I don't have a grp file lol.

Attached File(s)


0

User is offline   Mblackwell 

  • Evil Overlord

#1619

-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

#1620

This is with -mx. It throws a message saying there are errors in EDUKE.CON now. I really hate con code this makes php look easy

Attached File(s)


0

Share this topic:


  • 117 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