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

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

  • 82 Pages +
  • « First
  • 80
  • 81
  • 82
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   Mark 

  • Honored Donor
  • 2,698

#2431

He moves around so fast its hard to say for sure but it looks like he tries to back off after tossing the grenade. I'll check the code to see if he does actually move and tweak some numbers. But seeing as how he will throw grenades based only on player distance, he'll be throwing grenades indoors without a lot of movement to get away. I may have to totally rethink that enemy. Thanks.

EDIT: I found and adjusted down the blast radius of the grenade and doubled the amount for enemy backpedaling after throwing the grenade. It worked better outdoors, not perfect, but indoors its still less than a 40 percent chance they can flee the blast. Much better than almost no escape indoors or out but not acceptable.

I'll see if using the ifoutside command will be a decent compromise to make them throw grenades only under a skybox.

This post has been edited by Mark: 01 November 2018 - 11:38 AM

0

User is offline   conoklast 

  • 24

#2432

I've been playing around with projectiles and would like to know how to create a similar effect to the 'swaying' envelopes (tiles 4410-4412) that are spawned when the mailbag (tile 4413) is shot. Basically I want to create a falling leaf/leaves projectile for when the player shoots at trees/foliage. I realise that the envelope sprite is animated but I noticed that the projectile properties must also contain some other info because they move a lot more compared to when I just place the envelope sprite in the game. Thanks
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 3,197

#2433

I almost answered this the other day, stopped, and then forgot to come back to it. Anyways, I think a projectile is the wrong approach -- making it a projectile doesn't accomplish anything useful and adds more baggage.

I believe the easiest solution is to simply spawn the envelopes using the mail command (or spawn paper money with cash -- it will make no difference), and then hack the displayed sprites to look like your leaf sprites. This assumes your leaf art is already in game somewhere. There are several steps needed to make this work, which I can help with if need be. But the basic idea is you use EVENT_ANIMATESPRITES to change what is displayed by the envelope sprite so it shows your leaf tile instead, even though it is still really an envelope.
0

User is offline   conoklast 

  • 24

#2434

OK Thanks for your advice; I'll sort out the leaf sprite first and then take it from there. Does it have to be 3 frames like the envelope/money animation I'll be overwriting? Or can I use more?
0

User is online   Mark 

  • Honored Donor
  • 2,698

#2435

There are a few mods out there that used the falling leaf feature from Blood or Hexen or whatever game it was originally from. If I could remember which mods I would steer you towards their code.
1

User is offline   thisbecasper 

  • 1

#2436

In my 1v1 mod, I reset both dukes and move their coordinates to their origin when a new round starts, I also use savemapstate once in the beginning and load it every time I reset the round. At random (seems random so far) moments, the opponent duke bot (dummy duke for when my mate aint online) turns invisible on round reset. Again, at some random occasion, the opponent duke turns visible again on round reset. Its coordinates are as they should be, but it's like its cstat is 32767 - even though I've out commented all cstat commands in duke's code at this point. I'm using action PSTAND as well as cstat 257 after resetplayer. I reset the player and then some ticks later I move, PSTAND and cstat him. It could seem that my opponent duke is not in the game at all in some rounds, hence he doesn't take affect of my code, but at this point I'm just wildly guessing. Anything you guys have experienced? Or maybe I should ask how to reset all things (except a "score" variable) to what they were on map start...

This post has been edited by thisbecasper: 07 November 2018 - 12:29 PM

0

User is offline   conoklast 

  • 24

#2437

I've got a real noob question; basically I'm trying to create a breakable voxel (CHAIR_FDCRT) that has 2 stages of breakage.. I can get the voxel to 'break' the first time and load the half-damaged voxel (CHAIR_FDCRTBR) as a replacement, but when I shoot this half-damaged voxel there is no response. However if I place the half-damaged voxel directly into my map it does in fact break down into the completely damaged stage (CHAIR_FDCRTBR2).

useractor notenemy CHAIR_FDCRT
cstat 2305
sizeat 19 17
ifhitweapon
{
 ifwasweapon KNEE 
 strength 1
 else 
 { sound VENT_BUST
   debris SCRAP1 3
   cactor CHAIR_FDCRTBR }
}
enda

useractor notenemy CHAIR_FDCRTBR
cstat 2305
sizeat 19 17
ifhitweapon
{
 sound VENT_BUST
 debris SCRAP1 3
 cactor CHAIR_FDCRTBR2
}
enda

0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 3,197

#2438

I think it's no longer processing damage because it has negative health. Remember, when you cactor it doesn't do anything but change the picnum of the actor -- if the actor has negative health it will continue to have negative health unless you set it again.

Try using "strength 1" in all cases, not just when the weapon is KNEE.

EDIT To follow up on that, here is part of the source code for the IncurDamage function:

if (pActor->extra < 0 || pSprite->extra < 0 || pActor->picnum < 0)
    {
        pActor->extra = -1;
        return -1;
    }


pActor->extra is the damage to be processed, and pSprite->extra is the health of the actor. So what that code says is, if the actor has negative damage, or negative health, or a negative picnum, then negate the damage and abort the function.


This post has been edited by Trooper Dan: 10 November 2018 - 12:14 AM

0

User is offline   conoklast 

  • 24

#2439

View PostTrooper Dan, on 09 November 2018 - 11:57 PM, said:

Try using "strength 1" in all cases, not just when the weapon is KNEE.


Thanks man, this worked! I will also try your snippet of code to control the damage levels, thanks for that too.
0

User is offline   Zaxtor 

  • 1,366

#2440

Is there any codes to emit the nuke button.
not for the animation but the ending level behavior

that you get the (end level clearing such as amount of kills, time, secrets) you know the stuff you get if you do the Sec lotag 65535 or nuke button (sale lo lag) or other for secret maps etc

I know we have the "startlevel xx xx" but downside of startlevel is you don't get the level ending mentioned above.

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website

This post has been edited by Zaxtor: 18 November 2018 - 10:39 PM

0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 3,197

#2441

https://wiki.eduke32.../Timebeforeexit
2

User is offline   Zaxtor 

  • 1,366

#2442

Worked. thx.

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website
0

User is offline   Perro Seco 

  • 193

#2443

What if I want to send the player to a secret level? Like Zaxtor, I've been using startlevel until now, but can I do something to show the end of level screen first?

Posted Image
0

User is offline   Zaxtor 

  • 1,366

#2444

secret level thing, dunno
the code is for let say you finish E1L1 and brings you to E1L2.

There is a delay you can put.

let say "setplayer[THISACTOR].timebeforeexit 30" for 1 sec before level ends.

You could even use that for a "bonus level" haven't tried that yet... Maybe in future mod may try that.
That you put "setplayer[THISACTOR].timebeforeexit 3000" so you have 100 seconds before bonus level auto ends.
Like you get as many items, coins etc as possible

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website

This post has been edited by Zaxtor: Yesterday, 04:32 PM

0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 3,197

#2445

View PostPerro Seco, on 19 November 2018 - 02:01 PM, said:

What if I want to send the player to a secret level? Like Zaxtor, I've been using startlevel until now, but can I do something to show the end of level screen first?


You could always use startlevel after the bonus screen, right as the game is about to load the next regular level.

As an alternative to timebeforeexit, I think you can also just change the lotag of the sector that the player is standing in, making it a sector exit. Speaking of that, has anyone encountered a bug where sector exits skip the bonus screen? I've had that happening but didn't say anything until now.
0

User is online   Mark 

  • Honored Donor
  • 2,698

#2446

Trooper Dan: Not quite sure if its the same thing but originally in the HHR ending, if the player had a button pressed when entering the ending sector it bypassed our custom ending animation ( bonus screen ? ) and went straight to the stats screen if you didn't let up the button press fast enough. 266 tried a couple of things including code that required any button presses to let up before progressing but it never worked right. So I changed the ending a bit to compensate.

This post has been edited by Mark: Yesterday, 06:53 PM

0

User is offline   Zaxtor 

  • 1,366

#2447

I know Nuke buttons uses a diff pal color like let say pal 14 and lotag using xx instead of xxxxx to go in a more selective level.


There could be exploits and tricks to make you goto secret levels by using a non-nuke button method without sacrificing end level clearing.
Kinda a var trick that in the next level (level 2) instead of starting to the normal beginning it places the player in another sector of level 2 (by a var you set at the level 1} with thing that brings you to secret level.
like in a different sector of level2 you put that startlevel thing

Without sacrificing the end level time, kills, secrets etc when you beat level 1 from secret way instead of normal way.

My mod Trequonia has a similar thing.

if you take the alternate route of Level 1, you start at different position of level 2 instead of normal starting point.

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website

This post has been edited by Zaxtor: Yesterday, 06:48 PM

0

Share this topic:


  • 82 Pages +
  • « First
  • 80
  • 81
  • 82
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password


Sign in options