Duke4.net Forums: CON coding problems. - Duke4.net Forums

Jump to content

  • 17 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

CON coding problems.  "Improvements and progress."

User is offline   F!re-Fly 

#91

Frames is fixed !

action APIGSTANDSHOOT    0 3 5 1 45
action APIGSTANDSHOOT1    40 1 5 1 45
action APIGSTANDSHOOT2    0 1 5 1 45
action APIGSTANDSHOOTSTAND    0 1 5


New state is fixed !

state pigstandshootstate
  ifcansee  { } // needed to update the 'last seen' position
  ifaction APIGSTANDSHOOT
  {
//    ifcansee
//    {
      ifcount 12 nullop
      else
        ifcount 11
      { ifcansee
        {
          ifcanshoottarget
          {
            sound PIG_ATTACK
            shoot SHOTGUN
            shoot SHOTGUN
            shoot SHOTGUN
            shoot SHOTGUN
          }
          else
          { cactor PIGCOP ai AIPIGSEEKENEMY }
        }
        else
        { cactor PIGCOP ai AIPIGSEEKENEMY }
      }
      ifcount 25 nullop
      else
        ifcount 24
          sound SHOTGUN_COCK
      ifcount 48 nullop
      else
        ifcount 47
      {
        ifcansee
        {
          ifcanshoottarget
          {
            sound PIG_ATTACK
            shoot SHOTGUN
            shoot SHOTGUN
            shoot SHOTGUN
            shoot SHOTGUN
          }
          else
          { cactor PIGCOP ai AIPIGSEEKENEMY }
        }
        else
        { cactor PIGCOP ai AIPIGSEEKENEMY }
      }
      ifcount 60 nullop
      else
        ifcount 59
      {
        sound SHOTGUN_COCK
        ifgapzl 32
          ai AIPIGDIVING
        else
        {
          ifpdistl 4096
            { cactor PIGCOP ai AIPIGFLEEENEMY }
          else
            { cactor PIGCOP ai AIPIGSEEKENEMY }
        }
      }
//    }
//    else
//      ifgapzl 32
//        ai AIPIGSTANDSHOOT
//      else
//        { cactor PIGCOP ai AIPIGSEEKENEMY }
  }
  else
  ifaction APIGSTANDSHOOT1
  { ifactioncount 1 { cactor PIGCOPSTANDSHOOT action APIGSTANDSHOOT2 } }
  else
  ifaction APIGSTANDSHOOT2
  { ifactioncount 1
    { ifp palive
      {
        resetcount
        action APIGSTANDSHOOT
      }
      else { cactor PIGCOP action APIGSTANDSHOOT1 }
    }
  }
ends


I can not properly animate the other actions for the created frame. Killing, shrinking shrunker, killing with expander ...
0

User is offline   F!re-Fly 

#92

New animation of the fixed Pigcop. He can now attack you standing straight, just like his squatting animation.

Now, I'm going to improve the different tank destructions.
0

User is offline   F!re-Fly 

#93

I met in the end, still bugs. The animation of PIGCOP when shot at him has a bad frame. I'm going to put the "action" and the "ai" in the right place in the code.
0

User is offline   F!re-Fly 

#94

Hello. Back on the forum after a happy Christmas. That's fine, I had a question about NW. How to add new jibs for Santa? There are two tiles that represent this boss. I do not know how to make the guts fall to the ground.
0

User is offline   F!re-Fly 

#95

Idea?!
0

User is offline   F!re-Fly 

#96

I have another question for NW. I finished importing the sounds and additional codes. My question is the following.

How to make an item appear when an actor is destroyed ? I have a Christmas tree, where I would like to show gifts when it is destroyed.

Thank you for your answers

P.S. : My two Caribbean women do not spawned monsters when they are killed.

This post has been edited by Firefly_Trooper: 03 January 2019 - 10:01 AM

0

User is offline   F!re-Fly 

#97

Unresolved issues

1. Use a RESPAWN when a woman is killed.

2. Adding additional items with the same value as the originals.

3. Use a RESPAWN when an object is destroyed

4. Santa's jibs to code.
0

User is offline   F!re-Fly 

#98

No solution for these problems
0

User is offline   F!re-Fly 

#99

Let's start from the beginning.

I could not define an object that appears when I destroy my Christmas tree.

I think it's the function "respawnhitag" but I'm not sure. Normally to make an object appear, I put the number of the tile with a corresponding lotag.
Same thing for a woman killed. Can not make monsters appear with them.
0

User is offline   F!re-Fly 

#100

All added monsters are fixed. I reworked all the code and it was missing particular cstat.
I noticed size problems too, problems with RESPAWN and GROW actions.

Addition of cstat 257 in the general code of the monsters, so that they can be touched without going in Mapster32.

Added sizeat 40 40, which corrects the problem of RESPAWN and the GROW action.

Added clipdist 40 in useractor.

I added these values ​​with "{}" so that it works without any problem.

This post has been edited by Firefly_Trooper: 14 January 2019 - 11:46 AM

0

User is offline   F!re-Fly 

#101

Let's go back to the unresolved issues at the beginning. I could not bring up an item when my Christmas trees were destroyed. Should we add a specific RESPAWN?
0

User is offline   F!re-Fly 

#102

I made an important update, concerning the score of the monsters killed. Thanks to the work of Darkus, many parameters of the scoring have been corrected. For example, the egg score was poorly coded and now sharks are counted. However, I have a small concern about my corpses and my tank wrecks.

When I coded all the corpses of the monsters, I defined in useractor like this:

useractor enemy LIZTROOPDEADSPRITE
  fall
  state special_corpses_checksquished
  cstat 0
  strength 0
  ifhitweapon
  {
    ifwasweapon RADIUSEXPLOSION
    {
      state troop_body_jibs
      state standard_jibs
      sound SQUISHED
      killit
    }
  }
enda


The problem is that every corpses are added to the scoring of monsters to kill, except that I do not want them to be counted. How to fix this problem? If you just tell me to define "useractor enemy" in "notenemy" I already tried and it does not work. Moreover, if I put "notenemy" all my code is nonexistent.

I will start with this first problem, before settling the others.

Thanks !
0

User is online   Mark 

#103

Instead of killit make the corpses invisible when hit. That way they won't affect the count.
0

User is offline   F!re-Fly 

#104

Invisible to the touch? Do not destroy then? This is no longer of interest in the end. Unless I set a gamevar to avoid being counted on scoring.

This post has been edited by Firefly_Trooper: 17 January 2019 - 08:12 AM

0

User is online   Mark 

#105

I'm sure there is a way to code them so they don't to add to the count using killit, but I don't know what it would be. My suggestion is an easy compromise that accomplishes the same thing.
0

User is offline   F!re-Fly 

#106

Here are the codes provided by Darkus, concerning the score of the monsters killed:

gamevar ISDEADFIX 0 2 // Tell if the monster is dead or not
gamevar KILLCOUNTFIX 0 0    // Number of monsters killed
gamevar MAXKILLCOUNTFIX 0 0 // Maximum number of monsters

onevent EVENT_SPAWN
  ifvarn MONSTERS_OFF 1
  { switch sprite[THISACTOR].picnum
    case LIZTROOP
    case LIZTROOPRUNNING
    case LIZTROOPSTAYPUT
    case LIZTROOPSHOOT
    case LIZTROOPJETPACK
    case LIZTROOPONTOILET
    case LIZTROOPJUSTSIT
    case LIZTROOPDUCKING
      ifspritepal 21
        addstrength TROOPSTRENGTH // Captains have double hitpoint vals
    break
    case EGG
    case SHARK // Count egg and shark as enemies and apply skill settings for eggs
      getuserdef[THISACTOR].player_skill TEMPFIX1
      addvar TEMPFIX1 1
      ifvarvarl sprite[THISACTOR].lotag TEMPFIX1
      { getplayer[THISACTOR].max_actors_killed TEMPFIX2
        addvar TEMPFIX2 1
        setplayer[THISACTOR].max_actors_killed TEMPFIX2
      }
      else { setvar ISDEADFIX 1 killit }
    break
    endswitch
  }
endevent

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum // Apply skill settings for monsters (fixes lotag 4)
  case LIZTROOP
  case LIZTROOPRUNNING
  case LIZTROOPSTAYPUT
  case LIZTROOPSHOOT
  case LIZTROOPJETPACK
  case LIZTROOPONTOILET
  case LIZTROOPJUSTSIT
  case LIZTROOPDUCKING
  case OCTABRAIN
  case OCTABRAINSTAYPUT
  case DRONE
  case COMMANDER
  case COMMANDERSTAYPUT
  case RECON
  case TANK
  case PIGCOP
  case PIGCOPSTAYPUT
  case PIGCOPDIVE
  case LIZMAN
  case LIZMANSTAYPUT
  case LIZMANSPITTING
  case LIZMANFEEDING
  case LIZMANJUMP
  case ROTATEGUN
  case GREENSLIME
  case ORGANTIC
  case NEWBEAST
  case NEWBEASTSTAYPUT
  case NEWBEASTHANG
  case NEWBEASTJUMP
  case BOSS1
  case BOSS1STAYPUT
  case BOSS2
  case BOSS2STAYPUT
  case BOSS3
  case BOSS3STAYPUT
  case BOSS4
  case BOSS4STAYPUT
    getuserdef[THISACTOR].player_skill TEMPFIX1
    ifvarvarg sprite[THISACTOR].lotag TEMPFIX1
    { setvar ISDEADFIX 1 killit }
  break
  endswitch
endevent

onevent EVENT_GAME
// Set the old kill count to variable KILLCOUNTFIX
  getplayer[THISACTOR].actors_killed TEMPFIX1
  ifvarvarl KILLCOUNTFIX TEMPFIX1
    setplayer[THISACTOR].actors_killed KILLCOUNTFIX
  else 
  ifvarvarg KILLCOUNTFIX TEMPFIX1
    setplayer[THISACTOR].actors_killed KILLCOUNTFIX

// Don't allow the maximum number of monsters decrease (exept if manually set)
  getplayer[THISACTOR].max_actors_killed TEMPFIX2
  ifvarvarl TEMPFIX2 MAXKILLCOUNTFIX
    setplayer[THISACTOR].max_actors_killed MAXKILLCOUNTFIX
  else ifvarvarg TEMPFIX2 MAXKILLCOUNTFIX
    setvarvar MAXKILLCOUNTFIX TEMPFIX2
endevent

onevent EVENT_KILLIT
  ifvarn MONSTERS_OFF 1
  {
  switch sprite[THISACTOR].picnum
  case RECON // Special case for these
  case DRONE
  case ROTATEGUN
    addvar KILLCOUNTFIX 1
  break
  case EGG // If variable ISDEADFIX is 0 (the monster is alive), add one kill count
  case SHARK
  case LIZTROOP
  case LIZTROOPRUNNING
  case LIZTROOPSTAYPUT
  case LIZTROOPSHOOT
  case LIZTROOPJETPACK
  case LIZTROOPONTOILET
  case LIZTROOPJUSTSIT
  case LIZTROOPDUCKING
  case OCTABRAIN
  case OCTABRAINSTAYPUT
  case COMMANDER
  case COMMANDERSTAYPUT
  case TANK
  case PIGCOP
  case PIGCOPSTAYPUT
  case PIGCOPDIVE
  case LIZMAN
  case LIZMANSTAYPUT
  case LIZMANSPITTING
  case LIZMANFEEDING
  case LIZMANJUMP
  case ORGANTIC
  case NEWBEAST
  case NEWBEASTSTAYPUT
  case NEWBEASTHANG
  case NEWBEASTJUMP
    ifvare ISDEADFIX 0
      addvar KILLCOUNTFIX 1
  break
  case BOSS1
  case BOSS1STAYPUT
  case BOSS2
  case BOSS3
    ifvare ISDEADFIX 0
      addvar KILLCOUNTFIX 1
    ifspritepal 0  // end the game if is a boss
      endofgame 52
  break
  case BOSS4
    ifvare ISDEADFIX 0
      addvar KILLCOUNTFIX 1
    endofgame 52  // end the game
  break
  case GREENSLIME // special case for green slime
  case 2371
  case 2372
  case 2373
  case 2374
  case 2375
  case 2376
  case 2377
    ifvarg sprite[THISACTOR].statnum 0
    ifvarl sprite[THISACTOR].statnum 3
      addvar KILLCOUNTFIX 1
  break
  endswitch
  }
endevent

onevent EVENT_ENTERLEVEL // reset the counters at map start
  setvar KILLCOUNTFIX 0
  setvar MAXKILLCOUNTFIX 0
endevent


To be able to add a "DEADSPRITE" without it being counted, I have to add it somewhere.
0

User is offline   F!re-Fly 

#107

The King Cobra is fixed ! :)... Just miss bite attack and projectile venom.

This post has been edited by Firefly_Trooper: 18 January 2019 - 09:09 AM

0

User is offline   F!re-Fly 

#108

No solution found for the cadaver counter
0

User is offline   F!re-Fly 

#109

Another of my unresolved issues. I defined for the bosses, bloodpools of big sizes (sizeat 60 60) and for the code of the shrunker, a smaller size (sizeat 15 15). How can the big bloodpool be reduced by walking on it and canceling the size reduction for the small bloodpool? Can we use the values ​​"Footprintshade" or "Footprintpal"?
0

User is offline   F!re-Fly 

#110

My projects are progressing well and soon I will make a list of all the unsolved problems.
I took care to make a list for the next codes to add and improve.

This post has been edited by Firefly_Trooper: 19 January 2019 - 11:07 AM

0

User is offline   F!re-Fly 

#111

Here is the list of problems to solve:

1. The pal 4 to create shadow monsters, is not assigned when I use RESPAWN.
+ How can I also add a shadow on a new sprite? My new monsters refuse to keep the shadow property (assigned in Mapster32 by pressing "T").

2. The new Liztroop become lockable sprites after performing their dying death action (SUFFERING DEAD).

3. Corpses and tank wrecks, must be removed from the score counter.

4. BLOODPOOL smaller, linked to shrinker. Prevent further reduction of the puddle when Duke walks on it (size chosen sizeat 15 15).

5. BLOODPOOL bigger, related to BOSS. Force the reduction, when Duke walks on it (size chosen sizeat 60 60).

6. Unassigned general camera codes: flying camera, breakable viewscreen, breakable camera and camera controllable (code for Wiki).

7. Texture of the kind "SCREENBREAK" which does not destroy itself when it is used for a wall. This is the prototype of "OJ"

8. New switch, not functional. This is the prototype of "SLOTDOOR"

9. Code of "Space Suit" to add.

10. Impossibility of adding an extra sound, when the Dragon gets crushed in the shrinker (SQUISHABLEDISTANCE and PSTOMP).
+ Same procedure for women. Added a cry of pain at the same time of the crash.

11. No blood generated, when a frozen monster is destroyed.

12. Creation of new jibs for Santa Claus. The guts do not fall on the ground.

13. Possibility to put a different pal, for the RECON. When I assign for example on the RECON, a pal 14 or 21, it disappears from the map.

14. Disable completely, the recognition sound only for "stayput" enemies.

15. Be able to generate an item when the sprite of the Christmas tree is destroyed (value with a Lotag). When I try to assign a lotag of 50, the sprite disappears from the map.

Here ! We will begin to solve these problems, little by little. Thanks you for your answers.

This post has been edited by Firefly_Trooper: 21 January 2019 - 03:01 AM

0

User is online   Mark 

#112

15. Lotag 50 is used for making spotlights in Polymer. Maybe its messing up what you want to use that lotag for? If you use a different lotag does your effect work?

8. A new switch should be easy coding. :)

Me and other mappers have found that sometimes a switch won't activate if it is placed a little too high or low on the wall. Find a working switch in Mapster and see how many clicks up from the floor it is and do that same amount for testing your new switch. I was never able to figure out why some switches are so picky.

This post has been edited by Mark: 21 January 2019 - 08:12 AM

0

User is offline   F!re-Fly 

#113

Thank you Mark! I will test your suggestions tonight. Lotag 50 was an example. I probably wanted to say 100 or 49.
0

User is online   Mark 

#114

49 is also a polymer light tag :)
0

User is offline   F!re-Fly 

#115

Ok lol!

Show an item defined in Mapster32 with a lotag. :)
0

User is offline   F!re-Fly 

#116

I tested and it does not work. There is still some simple coding that escapes me again.

Here are the basic basic codes:

Proto SLOTDOOR

useractor notenemy PROTO_SLOTDOOR
  ifpdistl 1024
  ifp pfacing
  ifhitspace
  {
    cactor 7029
    sound SWITCH_ON
    activate 0
  }
enda


Xmas Tree

useractor notenemy XMASTREE MEDIUMSTRENGTH
  cstat 257
  ifhitweapon
  {
    ifdead
    {
      ifactor XMASTREE
      {
        sound GLASS_HEAVYBREAK
        debris SCRAP3 5
        debris SCRAP3 5
        killit
      }
    }
  }
enda

0

User is online   Mark 

#117

usually you would change "activate 0" to "operateactivators 222 0"
instead of 222, use the lotag you gave the switch in the map BUT... You are releasing just the mod and no maps. So I think you also have to include code to get the lotag that the mapper gives your switch actor and put in into a gamevar.

Someone smarter than me needs to help you.

This post has been edited by Mark: 21 January 2019 - 12:00 PM

0

User is offline   F!re-Fly 

#118

View PostMark, on 21 January 2019 - 11:59 AM, said:

usually you would change "activate 0" to "operateactivators 222 0"
instead of 222, use the lotag you gave the switch in the map BUT... You are releasing just the mod and no maps. So I think you also have to include code to get the lotag that the mapper gives your switch actor and put in into a gamevar.

Someone smarter than me needs to help you.


Ok Mark ! I remember seeing a thread on creating a new switch, but I could not get my hands on it again :)

Preview map:

Posted Image
Posted Image
0

User is offline   Perro Seco 

#119

It's very easy to make a switch. Just save its lotag into a gamevar:

getactor[THISACTOR].lotag TEMP


Now you need to activate TEMP if player is near, hit space, etc.
0

User is offline   F!re-Fly 

#120

View PostPerro Seco, on 21 January 2019 - 03:02 PM, said:

It's very easy to make a switch. Just save its lotag into a gamevar:

getactor[THISACTOR].lotag TEMP


Now you need to activate TEMP if player is near, hit space, etc.


It looks simple but sometimes I have trouble understanding the code "simple" because I have no example in the wiki and it does not seem obvious to me. :)

It's correct ?

gamevar TEMP 0 1

useractor notenemy PROTO_SLOTDOOR
  ifpdistl 1024
  ifp pfacing
  ifhitspace
  {
    cactor 7029
    sound SWITCH_ON
    getactor[THISACTOR].lotag TEMP
    activate 1
  }
enda


This post has been edited by Firefly_Trooper: 21 January 2019 - 05:30 PM

0

Share this topic:


  • 17 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • 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