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

Jump to content

  • 17 Pages +
  • « First
  • 14
  • 15
  • 16
  • 17
  • You cannot start a new topic
  • You cannot reply to this topic

CON coding problems.  "Improvements and progress."

User is offline   F!re-Fly 

#451

I got the full tutorial to make new weapons, from the Spanish forum "Duke Espana" is anyone here interested in a copy in PDF file?
0

User is offline   F!re-Fly 

#452

View PostF!re-Fly, on 25 March 2020 - 06:11 AM, said:

Back for code corrections ! Here is an example of one of my switches:

action NUKEBUTTONDNA_SWITCHONA    1
action NUKEBUTTONDNA_SWITCHONB    1
action NUKEBUTTONDNA_SWITCHOFFA    0
action NUKEBUTTONDNA_SWITCHOFFB    0

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifpdistl 1309
  ifp pfacing
  {
    ifhitspace
    { ifaction NUKEBUTTONDNA_SWITCHOFFB
      { sound SWITCH_ON
        ifvarg NEWSWITCHDOOR 0 { operateactivators NEWSWITCHDOOR 0 }
        ifvarg SOUNDSWITCH 0 { stopsoundvar SWITCH_ON soundvar SOUNDSWITCH }
        action NUKEBUTTONDNA_SWITCHONA
        break
      }
      else ifaction NUKEBUTTONDNA_SWITCHONB
      { sound SWITCH_ON
        ifvarg NEWSWITCHDOOR 0 { operateactivators NEWSWITCHDOOR 0 }
        ifvarg SOUNDSWITCH 0 { stopsoundvar SWITCH_ON soundvar SOUNDSWITCH }
        action NUKEBUTTONDNA_SWITCHOFFA
        break
      }
    }
    else
    { ifaction NUKEBUTTONDNA_SWITCHOFFA
        action NUKEBUTTONDNA_SWITCHOFFB
      else ifaction NUKEBUTTONDNA_SWITCHONA
        action NUKEBUTTONDNA_SWITCHONB
    }
  }
enda


All this works very well and the doors open very well. Only, I can not make it so that the switch can not come to life, only when it is not assigned to a lotag. Did I misplace any order?


Does anyone have an idea to solve this little problem?
0

User is offline   Darkus 

#453

I improved the code, maybe it works now?

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda

0

User is offline   F!re-Fly 

#454

View PostDarkus, on 28 March 2020 - 04:21 AM, said:

I improved the code, maybe it works now?

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda



Hello Darkus! The code does not work. I had the same problem with the break commands placed as well. The switch trips automatically and without any interruptions when Duke approaches it.
0

User is offline   Darkus 

#455

My bad. The break commands are well placed, but I forgot to put ifhitspace ;)
Also, added stopsound to prevent player making grunts. It should work for good now.

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    ifhitspace
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      stopsound DUKE_SEARCH stopsound DUKE_SEARCH2
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda

0

User is offline   F!re-Fly 

#456

View PostDarkus, on 28 March 2020 - 11:57 AM, said:

My bad. The break commands are well placed, but I forgot to put ifhitspace ;)
Also, added stopsound to prevent player making grunts. It should work for good now.

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    ifhitspace
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      stopsound DUKE_SEARCH stopsound DUKE_SEARCH2
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda



It still does not work. The switch without any "lotag" still works, with "action" on. I admit that I don't understand what's going on.
0

User is offline   Darkus 

#457

Maybe you forgot to retrieve lotag/hitag into sprite's variables? That's why it does nothing.
Add this into your code:

onevent EVENT_LOADACTOR
  ifactor NUKEBUTTON_DNA
  { getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  }
endevent

0

User is offline   F!re-Fly 

#458

View PostDarkus, on 28 March 2020 - 01:26 PM, said:

Maybe you forgot to retrieve lotag/hitag into sprite's variables? That's why it does nothing.
Add this into your code:

onevent EVENT_LOADACTOR
  ifactor NUKEBUTTON_DNA
  { getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  }
endevent



I had this:

// new switch code
gamevar NEWSWITCHDOOR 0 2
gamevar SOUNDSWITCH 0 2

/*------------*/
/* V0.99 BETA */
/*------------*/

state newswitch_code
  {
    getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
  }
ends

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case FLICKERINGREDBUTTON
  case PROTO_SLOTDOOR
  case BDP_SLOT1
  case BDP_SLOT2
  case NUKEBUTTON_DNA
  case AREA51_SWITCH
  case ALIENSHIP_SWITCH
  case EGYPT_SWITCH
  case LEVEL_SWITCH
    setvarvar SOUNDSWITCH sprite[THISACTOR].hitag
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent

eventloadactor NUKEBUTTON_DNA
  state newswitch_code
enda


This post has been edited by F!re-Fly: 28 March 2020 - 01:40 PM

0

User is offline   Darkus 

#459

eventloadactor is deprecated, it may not working on newer versions of EDuke (it's replaced by EVENT_LOADACTOR). Just delete it and put your state newswitch_code below the cases like this:

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case FLICKERINGREDBUTTON
  case PROTO_SLOTDOOR
  case BDP_SLOT1
  case BDP_SLOT2
  case NUKEBUTTON_DNA
  case AREA51_SWITCH
  case ALIENSHIP_SWITCH
  case EGYPT_SWITCH
  case LEVEL_SWITCH
    state newswitch_code
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent

0

User is online   Danukem 

  • Duke Plus Developer

#460

View PostDarkus, on 28 March 2020 - 01:48 PM, said:

eventloadactor is deprecated, it may not working on newer versions of EDuke


I hope that's not true. Lots of mods use it.

It's good for readability and portability. I can bundle both the actor code and the eventloadactor code in one place, read it all together, or drop it into a different mod. Then I don't have to search a different file for whether that actor gets mentioned in EVENT_LOADACTOR. Yes, one could use appendevent EVENT_LOADACTOR to keep the code together, but that's not quite the same. For example, it's possible that the code earlier in the event has a break or return, and in that case your appended code won't work (I'm assuming that the append literally appends the code and doesn't run it as a separate instance.)
0

User is offline   F!re-Fly 

#461

View PostTrooper Dan, on 28 March 2020 - 01:55 PM, said:

I hope that's not true. Lots of mods use it.

It's good for readability and portability. I can bundle both the actor code and the eventloadactor code in one place, read it all together, or drop it into a different mod. Then I don't have to search a different file for whether that actor gets mentioned in EVENT_LOADACTOR. Yes, one could use appendevent EVENT_LOADACTOR to keep the code together, but that's not quite the same. For example, it's possible that the code earlier in the event has a break or return, and in that case your appended code won't work (I'm assuming that the append literally appends the code and doesn't run it as a separate instance.)


I also hope the same, because if not, a good part of my code will be ruined. From my memories of past sons, Trooper Dan or Darkus (definitely see you two), suggested that I use eventloadactor. I used it for the famous coding "lotag respawn" for the items and it worked very well and I also never had a performance problem (lotag 4 skill).
0

User is offline   Darkus 

#462

Well it's written in the wiki. I always assumed that this command would eventually stop working. But maybe it still functional (or partially), the page has not been edited since 2011.
0

User is offline   F!re-Fly 

#463

View PostDarkus, on 28 March 2020 - 02:08 PM, said:

Well it's written in the wiki. I always assumed that this command would eventually stop working. But maybe it still functional (or partially), the page has not been edited since 2011.


I had read this page. It is true that it is still functional now, finally it works birn for me. If that’s all truth, I wouldn’t really care. I have assigned "eventloadactor" only for switches and respawn coding.

I will however continue my work on DNA and will post the demo of the mod very soon.

For this switch problem, I tried "EVENT_LOADACTOR" and I meet the same shit.
0

User is offline   F!re-Fly 

#464

Last attempt. All this should then be correct:

gamevar NEWSWITCHDOOR 0 2
gamevar SOUNDSWITCH 0 2

state newswitch_code
  {
    getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
  }
ends

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    ifhitspace
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      stopsound DUKE_SEARCH stopsound DUKE_SEARCH2
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case FLICKERINGREDBUTTON
  case PROTO_SLOTDOOR
  case BDP_SLOT1
  case BDP_SLOT2
  case NUKEBUTTON_DNA
  case AREA51_SWITCH
  case ALIENSHIP_SWITCH
  case EGYPT_SWITCH
  case LEVEL_SWITCH
    state newswitch_code
    getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent


This post has been edited by F!re-Fly: 28 March 2020 - 02:34 PM

0

User is offline   Darkus 

#465

You should remove also state newswitch_code completely since it's duplicated, it retrieves the NEWSWITCHDOOR variable twice.
0

User is offline   F!re-Fly 

#466

View PostDarkus, on 28 March 2020 - 02:44 PM, said:

You should remove also state newswitch_code completely since it's duplicated, it retrieves the NEWSWITCHDOOR variable twice.


That is true! In the rush, I forgot this detail. I will test this for tomorrow. Thank you !
0

User is offline   F!re-Fly 

#467

View PostDarkus, on 28 March 2020 - 02:44 PM, said:

You should remove also state newswitch_code completely since it's duplicated, it retrieves the NEWSWITCHDOOR variable twice.


I tried again and nothing helped! It's always the same result.

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    ifhitspace
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      stopsound DUKE_SEARCH stopsound DUKE_SEARCH2
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
//  case FLICKERINGREDBUTTON
//  case PROTO_SLOTDOOR
//  case BDP_SLOT1
//  case BDP_SLOT2
  case NUKEBUTTON_DNA
//  case AREA51_SWITCH
//  case ALIENSHIP_SWITCH
//  case EGYPT_SWITCH
//  case LEVEL_SWITCH
    getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent

0

User is offline   Darkus 

#468

I tried the code and it worked with me. I suspect you're haven't set Lotag/hitag properly in your map.
0

User is offline   F!re-Fly 

#469

View PostDarkus, on 29 March 2020 - 05:32 AM, said:

I tried the code and it worked with me. I suspect you're haven't set Lotag/hitag properly in your map.


Mmmh ok! In general, I do this: 0,1 lotag (active switch) and 0,0 (inactive switch).
0

User is offline   F!re-Fly 

#470

View PostDarkus, on 29 March 2020 - 05:32 AM, said:

I tried the code and it worked with me. I suspect you're haven't set Lotag/hitag properly in your map.


Sorry Darkus for bothering you with this again, but now I don't understand what's going on. However, I put the code well as you had suggested:

gamevar NEWSWITCHDOOR 0 2
gamevar SOUNDSWITCH 0 2

action NUKEBUTTONDNA_SWITCHONA    1
action NUKEBUTTONDNA_SWITCHONB    1
action NUKEBUTTONDNA_SWITCHOFFA    0
action NUKEBUTTONDNA_SWITCHOFFB    0

useractor notenemy NUKEBUTTON_DNA
  ifaction 0 action NUKEBUTTONDNA_SWITCHOFFB
  ifaction NUKEBUTTONDNA_SWITCHOFFA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHOFFB
  }
  else ifaction NUKEBUTTONDNA_SWITCHONA
  { ifhitspace break
    action NUKEBUTTONDNA_SWITCHONB
  }
  else
  { ifpdistl 1309
    ifp pfacing
    ifcansee
    ifhitspace
    { ifvarg NEWSWITCHDOOR 0 operateactivators NEWSWITCHDOOR 0
      ifvarg SOUNDSWITCH 0 soundvar SOUNDSWITCH
      else sound SWITCH_ON
      stopsound DUKE_SEARCH stopsound DUKE_SEARCH2
      ifaction NUKEBUTTONDNA_SWITCHOFFB action NUKEBUTTONDNA_SWITCHONA
      else ifaction NUKEBUTTONDNA_SWITCHONB action NUKEBUTTONDNA_SWITCHOFFA
    }
  }
enda

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case NUKEBUTTON_DNA
    getactor[THISACTOR].lotag NEWSWITCHDOOR
    setactor[THISACTOR].lotag 0
    getactor[THISACTOR].hitag SOUNDSWITCH
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent


And I did put 0.1 for an active switch. The second inactive switch has nothing in lotag. I do not understand at all why this is not wanted. Maybe giving me an example of how you did it could help me fix this problem. Do you think it could interfere with other "eventloadactor" present in the global code?
0

User is offline   F!re-Fly 

#471

New enemy added ! Trooper for Duke Nukem Advance
0

User is offline   F!re-Fly 

#472

NEW VIDEO TEST !!! (with Goldeneye 007 soundtrack)


1

User is offline   F!re-Fly 

#473

Good ! Since the command "eventloadactor" is obsolete, I will therefore use "EVENT_LOADACTOR" instead

But obviously, when I wanted to redo all the famous code "lotag et respawn" I found the same old problem as before. first of all, this is how my code was before:

gamevar L_RESPAWN 0 2
gamevar L_RESPAWN2 0 2
gamevar H_RESPAWN 0 2
gamevar OPERATES 0 2

state respawnitems // respawn items
  {
    getactor[THISACTOR].lotag L_RESPAWN
    setactor[THISACTOR].lotag 0
  }
ends

state lotag_operates_code // open / close doors
  {
    getactor[THISACTOR].lotag OPERATES
    getactor[THISACTOR].lotag L_RESPAWN2
    setactor[THISACTOR].lotag 0
  }
ends

state respawnitems // part of the code where the enemy generates an item when he is killed
  ifvare L_RESPAWN 15 { espawnvar ACCESSCARD setactor[RETURN].pal 21 }
  else ifvare L_RESPAWN 16 { espawnvar ACCESSCARD setactor[RETURN].pal 23 }
  else espawnvar L_RESPAWN
ends

state checktroophit // part of the code where the enemy is killed
  state respawnitems
  ifvarg H_RESPAWN 0 { operaterespawns H_RESPAWN setvar H_RESPAWN 0 }
  ifvarg OPERATES 0 { operateactivators OPERATES 0 }
  sound PRED_DYING
  addkills 1
  addvar KILLCOUNTFIX 1
  setvar ISDEADFIX 1
ends

eventloadactor LIZTROOP
  state lotag_code
enda

eventloadactor LIZTROOP
  state lotag_operates_code
enda

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case LIZTROOP
    setvarvar H_RESPAWN sprite[THISACTOR].hitag
    setactor[THISACTOR].hitag 0
  break
  endswitch
endevent

onevent EVENT_KILLIT
  ifvarn MONSTERS_OFF 1
  {
  switch sprite[THISACTOR].picnum
  case LIZTROOP
    ifvare ISDEADFIX 0
      addvar KILLCOUNTFIX 1
    ifvarg H_RESPAWN 0 { operaterespawns H_RESPAWN setvar H_RESPAWN 0 }
    ifvarg OPERATES 0 { operateactivators OPERATES 0 }
  break
  endswitch
  }
endevent


Note that I had created the gamevar "L_RESPAWN2" so that the two actions are taken into account (items that appear and door opening).

And now, I use the code as Darkus had suggested to me:

gamevar L_RESPAWN 0 2
gamevar L_RESPAWN2 0 2
gamevar H_RESPAWN 0 2
gamevar OPERATES 0 2

state respawnitems
  ifvare L_RESPAWN 15 { espawnvar ACCESSCARD setactor[RETURN].pal 21 }
  else ifvare L_RESPAWN 16 { espawnvar ACCESSCARD setactor[RETURN].pal 23 }
  else espawnvar L_RESPAWN
ends

state checktroophit
  state respawnitems
  ifvarg H_RESPAWN 0 { operaterespawns H_RESPAWN setvar H_RESPAWN 0 }
  ifvarg OPERATES 0 { operateactivators OPERATES 0 }
  sound PRED_DYING
  addkills 1
  addvar KILLCOUNTFIX 1
  setvar ISDEADFIX 1
ends

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
    case LIZTROOP
    getactor[THISACTOR].lotag L_RESPAWN
    getactor[THISACTOR].lotag L_RESPAWN2
    getactor[THISACTOR].lotag OPERATES
    setactor[THISACTOR].lotag 0
  break
    endswitch
endevent

onevent EVENT_KILLIT
  ifvarn MONSTERS_OFF 1
  {
  switch sprite[THISACTOR].picnum
  case LIZTROOP
    ifvare ISDEADFIX 0
      addvar KILLCOUNTFIX 1
    ifvarg H_RESPAWN 0 { operaterespawns H_RESPAWN setvar H_RESPAWN 0 }
    ifvarg OPERATES 0 { operateactivators OPERATES 0 }
  break
  endswitch
  }
endevent


And the problem is that I can no longer define in the game, the two possibilities. I still end up with this problem here:






When an enemy has all of this code and is killed in the air, the platforms react as if they were doors or elevators.

I noticed that it affected the enemies who had a lotage of 1 to 3, that is to say the skill level.

This is the current problem!

This post has been edited by F!re-Fly: 03 April 2020 - 03:19 AM

0

User is offline   F!re-Fly 

#474

I found the solution for my problem for the lotag respawn code. The skill lotages (0-4), are disabled like this and this avoids the problem mentioned in the video:

state respawnitems
  ifvare L_RESPAWN 15 { espawnvar ACCESSCARD setactor[RETURN].pal 21 }
  else ifvare L_RESPAWN 16 { espawnvar ACCESSCARD setactor[RETURN].pal 23 }
  else ifvare L_RESPAWN 0 break
  else ifvare L_RESPAWN 1 break
  else ifvare L_RESPAWN 2 break
  else ifvare L_RESPAWN 3 break
  else ifvare L_RESPAWN 4 break
  else espawnvar L_RESPAWN
ends


This also fixes a recent improvement in Darkus:

// fix radius damage to inactive actors (statnum 2) which is handled differently
state overrideexpldamagefix
  switch sprite[THISACTOR].htpicnum
    case HEAVYHBOMB
    case OOZFILTER
    case EXPLODINGBARREL
    case SEENINE
    case MORTER
    case CANNONBALL
    case 1818 // CANNONBALLS
    case DRONE
    case TANK
    case TRIPBOMB
    case GUNPOWDERBARREL
      setactor[THISACTOR].htpicnum RADIUSEXPLOSION
    break
  endswitch
ends


When inactive enemies were killed with this code, the lotag "0" was buggy and Eduke32 stopped working.

So I have (I think I haven't made a mistake yet), correctly put the code like this:

onevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
    case LIZTROOP
    getactor[THISACTOR].hitag OPERATES
    getactor[THISACTOR].lotag L_RESPAWN
    setactor[THISACTOR].hitag ZERO
    setactor[THISACTOR].lotag ZERO
  break
  endswitch
endevent


Someone here will tell me if the latter solution is correct, or if there is another solution.

Thanks for confirming me guys!
0

User is offline   F!re-Fly 

#475

New test, very cool !


1

User is offline   F!re-Fly 

#476

I got a "proto jibs5" and a "proto scrap" e the BETA version. However, I have trouble correcting the random trajectory correctly, as well as the appearance of a JIBS6 when it falls to the ground:

defineprojectile PROTO_JIBS5 PROJ_WORKSLIKE 6274
defineprojectile PROTO_JIBS5 PROJ_SPAWNS -1
defineprojectile PROTO_JIBS5 PROJ_VEL 110
defineprojectile PROTO_JIBS5 PROJ_EXTRA 0
defineprojectile PROTO_JIBS5 PROJ_DROP -200
defineprojectile PROTO_JIBS5 PROJ_CSTAT 0
defineprojectile PROTO_JIBS5 PROJ_XREPEAT 20
defineprojectile PROTO_JIBS5 PROJ_YREPEAT 20
defineprojectile PROTO_JIBS5 PROJ_HITRADIUS 0
defineprojectile PROTO_JIBS5 PROJ_BSOUND -1

action PROTOJIBS5FRAMES 0 4 1 1 15
useractor notenemy PROTO_JIBS5 0 PROTOJIBS5FRAMES
  ifmove 0
  {
    move STOPPED
    sizeat 20 20
    ifrnd 128 cstat 0
    else cstat 4
    cstator 256
    strength 0
  }
  fall
    killit
enda

state proto_jibs
  {
    rand zdist 1024
    sub zdist 3500
    zshoot zdist PROTO_JIBS5
    setactor[RETURN].cstat 4
    rand angvar 2047
    seta[RETURN].ang angvar
    // seta[RETURN].pal 0
  }
ends


Anyone have an idea to fix this?
0

User is online   Danukem 

  • Duke Plus Developer

#477

By the way, eventloadactor works fine and always has. Darkus was just reacting to it being called "deprecated" in the wiki (like a lot of old commands).
0

User is offline   F!re-Fly 

#478

View PostTrooper Dan, on 17 April 2020 - 01:03 PM, said:

By the way, eventloadactor works fine and always has. Darkus was just reacting to it being called "deprecated" in the wiki (like a lot of old commands).


Okay, thanks for the info. Finally, I preferred the "EVENT_LOADACTOR" function to simply have clean files and no mess.

Is the solution I found in my penultimate post a good solution? I would like to have a clarification. To avoid any performance problem, I had put the "break" command to avoid that the enemies of the original game (with their skill lotage) could not create problems.
0

User is offline   Kyanos 

#479

I'm planning through a project and want to bounce it off you guys to look for anything I may have missed.
The idea is old, easy, and difficult. A proper view weapon mode for third person and multiplayer.
So far "in my head" it goes like this.
1. set up APLAYER mdflag to use event animate sprites for tspr manipulation
2. in event animatesprites addvar picnum (currentweapon * 10000)
3. define the new art to tiles APLAYER + 10,000 = pistol, +20,000 = shotgun...

My questions.
i) Am I missing anything?
ii) Any forseeable sync issues?
iii) Will this be very resource heavy? / How will its performance scale to 8 players?
0

User is online   Danukem 

  • Duke Plus Developer

#480

I know there's a maximum tile number but I'm not sure what it is. Obviously you don't want to exceed it.
Also, and this is pretty obvious, but there are gaps in the player art with blank tiles and your new tile sets with the other weapons have to include those gaps or the numbers will be wrong.
You might get some hitches when tiles are loaded in, I know I get these already in my mods sometimes when a new enemy spawns into the map. There's a command to preload tiles though.
1

Share this topic:


  • 17 Pages +
  • « First
  • 14
  • 15
  • 16
  • 17
  • 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