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

Jump to content

  • 124 Pages +
  • « First
  • 82
  • 83
  • 84
  • 85
  • 86
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Mav3r1ck 

#2477

View PostTrooper Dan, on 05 December 2018 - 05:16 PM, said:

I'm pretty sure it will not shoot itself if you are using a relatively recent EDuke32. Verify that it does before worrying about it. If the position of the rockets bothers you, there are fixes but you will need to be more specific about the positioning.


Hmm, the firing position does bother a little. The rockets spawn above the Overlord Sentry. I also understand that when monsters are scaled the projectiles will match the scaled monster.

View PostTrooper Dan, on 05 December 2018 - 05:16 PM, said:

All you have to do is change cstat on the corpse.

https://wiki.eduke32.com/wiki/Cstat

EDIT: I should add, if the corpse is coded to be destroyed when hit with splash damage ("ifhitweapon RPG ...") then obviously you should remove that code for the corpse in question.


The code below is what I have for an experiment.

    ifwasweapon RPG
    {
      sound PRED_DYING
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      cstat 0
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      strength 0
      move TROOPSTOPPED
      action ATROOPDEAD
      cstator 32768


This will allow me to blow up the Trooper but it will leave an invisible corpse behind and will respawn in the spot where it died. The goal is to attempt to replicate Doom's Nightmare difficulty respawning and by that I mean to have the monsters respawn regardless of what weapon you kill them with. So far it's been successful but the issue I'm facing is that if you shoot an explosive at the invisible corpse it will explode with guts until the monster respawns. I'm trying to get it to where it doesn't do this.
0

User is offline   Danukem 

  • Duke Plus Developer

#2478

There might be hardcoded positioning specific to BOSS3. If that's the case, you could probably remedy that using "cactor COMMANDER" right before "shoot RPG" then immediately after use "cactor BOSS3". If my suspision is correct that will make the RPG spawn lower. It will also probably reduce the damage quite a bit, and if that's a problem there is a solution for that as well.

As for the invisible corpse problem, I would define a new move, let's say "move JIBRESPAWN" and then when killed by RPG or RADIUSEXPLOSION, you have the enemies use that move instead of "move TROOPSTOPPED" or whatever that particular actor uses. Then, in the actor's code where the corpse is checking for explosions, add the line "ifmove JIBRESPAWN break" before any of the code that makes them spawn jibs. But also make sure that the "ifrespawn" check happens before the break, otherwise they will be stuck invisible forever. You migth have to move some code around to make it work.
0

User is offline   Mav3r1ck 

#2479

View PostTrooper Dan, on 06 December 2018 - 02:47 AM, said:

There might be hardcoded positioning specific to BOSS3. If that's the case, you could probably remedy that using "cactor COMMANDER" right before "shoot RPG" then immediately after use "cactor BOSS3". If my suspision is correct that will make the RPG spawn lower. It will also probably reduce the damage quite a bit, and if that's a problem there is a solution for that as well.


Hmm, I can give it a shot and see what happens.

View PostTrooper Dan, on 06 December 2018 - 02:47 AM, said:

As for the invisible corpse problem, I would define a new move, let's say "move JIBRESPAWN" and then when killed by RPG or RADIUSEXPLOSION, you have the enemies use that move instead of "move TROOPSTOPPED" or whatever that particular actor uses. Then, in the actor's code where the corpse is checking for explosions, add the line "ifmove JIBRESPAWN break" before any of the code that makes them spawn jibs. But also make sure that the "ifrespawn" check happens before the break, otherwise they will be stuck invisible forever. You migth have to move some code around to make it work.


This gave me an idea.

state standard_jibs
  guts JIBS2 4
  guts JIBS3 8
  guts JIBS4 12
  guts JIBS5 8
  guts JIBS6 12
  ifrnd 6
  {
    guts JIBS1 1
    spawn BLOODPOOL
  }         // a badly drawn spine

  state jib_sounds
ends


The above is a modified jibs code (love the idea of more jibs when blowing something up) in my external GAME.CON that spawns more guts when blowing monsters up. That being said, what if I can duplicate this code and remove all the parts that spawn jibs and add it to the invisible corpse part as a dummy state for the jibs and then whenever I shoot the invisible corpse, no jibs will spawn. Could that method work instead?

This post has been edited by Mav3r1ck: 06 December 2018 - 04:15 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2480

View PostMav3r1ck, on 06 December 2018 - 04:08 PM, said:

what if I can duplicate this code and remove all the parts that spawn jibs


I'm sorry but that broke me. The entire state does nothing but spawn jibs until the very last line which plays sounds.
0

User is offline   Mark 

#2481

Is there a way from within actor A to determine if actor B is alive or dead? The 2 actors are a guy and his boombox in an alley. I have the simple basic effects for each actor working. But, one of the effects from within the boombox actor is the sound of the guy saying something if the boombox is shot at. If the guy is killed first I no longer want the boombox to trigger the man's voice when hit. So I need to determine how to check for the guy's status so the boombox either plays the voice clip or not when hit.

This post has been edited by Mark: 16 December 2018 - 04:37 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2482

The easiest way involves actor A having the sprite ID of actor B stored in a per-actor gamevar. This is one of those things that is easier to do than to explain. If the guys is the only one of his picnum anywhere near the boombox, then you could grab his ID with findnearactor -- use that command just once when the boombox initializes to put his ID in a gamevar, then monitor the actor to see if his extra drops below 1.
2

#2483

hello all! I have some issue in m32 script.
EVENT_ANALYZE_SPRITES has no effect in newer version of mapster32.
In the old version (Mapster32 2.0.0devel r4488 (32-bit) Compiled May 28 2014 15:48:34) this method works correctly. In the version (Mapster32 r6332 Built Jul 6 2017 07:49:55, GCC 6.3.0, 32-bit) and later it does not work.

code for exemple:
onevent EVENT_ANALYZESPRITES
  for i drawnsprites {
    // set any property of tsprite[] has no effect :-(
    set tsprite[i].shade -64
   }
endevent


This post has been edited by Mr. Alias Nameless: 10 January 2019 - 06:22 AM

0

User is offline   Mark 

#2484

View PostTrooper Dan, on 16 December 2018 - 05:27 PM, said:

The easiest way involves actor A having the sprite ID of actor B stored in a per-actor gamevar. This is one of those things that is easier to do than to explain. If the guys is the only one of his picnum anywhere near the boombox, then you could grab his ID with findnearactor -- use that command just once when the boombox initializes to put his ID in a gamevar, then monitor the actor to see if his extra drops below 1.


I forgot to post here that I was able to figure it out with your suggestion. Thanks.
0

#2485

What exactly do I need to do in order to play other music on custom maps? I thought I would start off by using "music { id "E1L1" file "grabbag.ogg" }" in DEFS.CON to see the command work, but it didn't. Couldn't put it in USER or GAME either. I tried making a somename.def file and included in GAME but i just get this
Compiling: GAME.CON (161162 bytes)
Including: DEFS.CON (35992 bytes)
Including: USER.CON (45661 bytes)
Including: g.def (38 bytes)
g.def: At top level:
g.def:1: error: parameter `{' is undefined.
g.def:1: error: found more `}' than `{'.
GAME.CON: In state `setwinner':
GAME.CON:69: error: found more `}' than `{'.

g.def only contains "music { id "E1L1" file "grabbag.ogg" }".
- Or, I really just want to play the grabbag theme when a player wins a multiplayer game. If I play the theme in the APLAYER actor code you can hear it multiple times from the different players on the map...

This post has been edited by thisbecasper: 12 January 2019 - 12:39 PM

0

User is offline   Mark 

#2486

I just took a look at my USER.CON file and the music lines for the levels do not use any braces.
1

#2487

View PostMark, on 12 January 2019 - 02:56 PM, said:

I just took a look at my USER.CON file and the music lines for the levels do not use any braces.


Yup, thanks, that made it possible to play another song at Holly. Although this doesn't work
music 1 stalker.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid

even though this worked
music 1 GRABBAG.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

and that has always been my problem. I can't play other music than dethtoll on usermaps...
0

#2488

Does anyone know why I get out of sync when I'm trying to alter .max_player_health or .htextra??????? I've isolated the problem, and it occurs consistently. I'm of course using the EDuke32-OldMP launcher. The desync on .max_player_health triggers sometimes if the player picks up hp, exceeding 100 hp. Same problem seems be the case with .htextra. When a player runs my .htextra code and goes from >100 to <=100 the game desyncs...
0

User is offline   Danukem 

  • Duke Plus Developer

#2489

View Postthisbecasper, on 12 January 2019 - 05:47 PM, said:

Does anyone know why I get out of sync when I'm trying to alter .max_player_health or .htextra??????? I've isolated the problem, and it occurs consistently. I'm of course using the EDuke32-OldMP launcher. The desync on .max_player_health triggers sometimes if the player picks up hp, exceeding 100 hp. Same problem seems be the case with .htextra. When a player runs my .htextra code and goes from >100 to <=100 the game desyncs...


I don't know and probably won't be able to help. However, if you post the code you are using to change those values, maybe I will have a helpful suggestion. I'm assuming you are talking about changes to those values caused by your own code and not changes in the vanilla game.
0

#2490

View PostTrooper Dan, on 12 January 2019 - 05:55 PM, said:

I don't know and probably won't be able to help. However, if you post the code you are using to change those values, maybe I will have a helpful suggestion. I'm assuming you are talking about changes to those values caused by your own code and not changes in the vanilla game.


Thank you very much for your interest. I'm at a point where I'm conviced my code is bug-less :) and it has something to do with underlying code - I hope I'm wrong. I'll try to outline the central aspects of my code:

So, the idea of this MP gamemode is simple: First to 30 wins. For every kill you are behind the leader, you get 5 bonus max hp:

state regulatemaxhealth
	getplayer[THISACTOR].frag tempone
	getplayer[THISACTOR].fraggedself temptwo
	subvarvar tempone temptwo //actual amount of kills
	setvarvar tempthree maxscore //maxscore is leading player's score and is working correctly
	subvarvar tempthree tempone //Difference between your score and the leader's
	mulvar tempthree 5
	addvar tempthree 100
	setplayer[THISACTOR].max_player_health tempthree // It's actually not this line that causes the desync
ends


If I kill my opponent, he lies dead on the ground and has now 0/105 hp. When he respawns he gets 105/105 and we have a desync. If I suicide and has yet to spawn I'm on 0/105. However, when I respawn there's no desync. So I have to be killed by an opponent, before the desync happens on a respawn (and it happens every time).

I have no code in EVENT_RESETPLAYER or anything alike. Neither do I have code on killing blows, respawns or anything like that. If I remove the last line in the above state, I get no desync, but then I lose the main part of the mod.

This post has been edited by thisbecasper: 12 January 2019 - 06:32 PM

0

#2491

Turns out, it was actually because I was calculating the maxscore variable in EVENT_DISPLAYREST. I think I've read somewhere displayrest is only for HUD :))
0

User is offline   Danukem 

  • Duke Plus Developer

#2492

View Postthisbecasper, on 13 January 2019 - 02:18 AM, said:

Turns out, it was actually because I was calculating the maxscore variable in EVENT_DISPLAYREST. I think I've read somewhere displayrest is only for HUD :))


Yeah, display events are frame rate dependent and nothing that needs to be synced should ever be handled in them.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2493

totalclock is a variable that is incremented based on 120 fps. Animations (tiles, shading, etc) are usually based on totalclock.

However Duke 3D carelessly handle a few animations based on frame rate updates, such as a shrunk players fists.

This post has been edited by Fox: 13 January 2019 - 05:37 PM

0

#2494

Can it be that it is difficult to know what kind of projectile hit you with its radius explosion? I'm just trying to make a flash bang, but I can't figure out how to check what picnum made the explosion...
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2495

If PROJ_WORKSLIKE equals PROJECTILE_RADIUS_PICNUM, then ifwasweapon will return the picnum.
1

#2496

I'm still looking for a way to can change the default song on user-maps. Anybody? :)
0

User is offline   Mark 

#2497

 thisbecasper, on 12 January 2019 - 03:23 PM, said:

Yup, thanks, that made it possible to play another song at Holly. Although this doesn't work
music 1 stalker.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid

even though this worked
music 1 GRABBAG.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

and that has always been my problem. I can't play other music than dethtoll on usermaps...


I took a look at what I did for my Graveyard mod.

// Music for title and end
music 0 GAMEOVER.mid BRIEFING.MID

// Music for the individual levels
music 1 graveyardnew.ogg map2.ogg map2.ogg bonus.mid

I was able to choose whatever I wanted. I have no idea why you can't. As a test, try an older eduke32 version from a few months or a year ago.
0

#2498

 Mark, on 17 January 2019 - 06:21 AM, said:

I took a look at what I did for my Graveyard mod.

// Music for title and end
music 0 GAMEOVER.mid BRIEFING.MID

// Music for the individual levels
music 1 graveyardnew.ogg map2.ogg map2.ogg bonus.mid


Maybe I have to say that I'm not playing a custom episode, but rather on usermaps (so I guess thats E1L8?)

 Mark, on 17 January 2019 - 06:21 AM, said:

As a test, try an older eduke32 version from a few months or a year ago.


Good point. I'm using the eduke-oldmp build, but I tried the "normal" eduke and it's the same. The songs change when I replace the filenames with others, like you showed. It still plays dethtoll on usermaps though...

This post has been edited by thisbecasper: 17 January 2019 - 07:14 AM

0

#2499

Is it possible to reduce the speed of the fall of the actor?
actor 3747
	ifvarvarg sprite[THISACTOR].z 0 {
		setactor[THISACTOR].htbposx sprite[THISACTOR].z
		setactor[THISACTOR].z -100000
	} else
		fall
	cstator 8192 
enda


This post has been edited by Mr. Alias Nameless: 30 January 2019 - 01:26 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2500

The easiest way is to add ifrnd % before.

This post has been edited by Fox: 30 January 2019 - 02:06 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#2501

If you want it to be exactly half speed and not random, you can use ifvarand player[].player_par 1 fall
0

User is offline   Mark 

#2502

Darn. I wish I knew that fall speed was adjustable. I have an enemy that falls off a ladder but the fall was too fast. I ended up using a combo of move and iffloordistl commands. This new way would have been much quicker.
0

User is offline   Danukem 

  • Duke Plus Developer

#2503

 Mark, on 30 January 2019 - 06:07 AM, said:

Darn. I wish I knew that fall speed was adjustable. I have an enemy that falls off a ladder but the fall was too fast. I ended up using a combo of move and iffloordistl commands. This new way would have been much quicker.


It's not really "adjustable". What both Fox and I are saying is you can simply not have the command be executed every single game tic.
0

User is offline   F!re-Fly 

#2504

A question. Is it useful to post one of my problems here? In addition to my thread?
0

User is offline   F!re-Fly 

#2505

 Firefly_Trooper, on 30 January 2019 - 11:41 AM, said:

A question. Is it useful to post one of my problems here? In addition to my thread?


Finally it will not be worth it, because I have a new unexpected problem that pisses me off :) My King Cobra REFUSES to die being once shrunk.

The code is posted on my thread.

This post has been edited by Firefly_Trooper: 31 January 2019 - 06:22 AM

0

User is offline   Mark 

#2506

In another thread Trooper Dan posted:
" onevent EVENT_FIRE set RETURN -1 break

That will prevent weapon firing but quick kick is a separate function."

How would I use that so its active only while the player is in a "lockplayer" mode during a conversation with an enemy?
If it helps any, there are quotes on the top of the screen and sound clips playing during this time.

This post has been edited by Mark: 31 January 2019 - 08:30 PM

0

Share this topic:


  • 124 Pages +
  • « First
  • 82
  • 83
  • 84
  • 85
  • 86
  • 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