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

Jump to content

  • 115 Pages +
  • « First
  • 45
  • 46
  • 47
  • 48
  • 49
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1381

This should work rudimentarily:

onevent EVENT_DISPLAYROOMS
  ifp pdead
    setvar cameradist 65536
endevent

1

User is online   Mark 

#1382

It didn't seem to do anything. Thanks. I'm going to forget that request for now and try to solve my other more important problem about having 2 different dying animations depending on which weapon did the killing. As mentioned before I have 2 versions of the model . One for all the regular animations and death number one. The second version contains a flying apart animation for when the RPG does the killing.

I can't get something to spawn if the enemy is killed with the RPG. I assume I'm overlooking something easy again.

1. GreenPuke, 4389, is one of the spawnable items in the game so I defined my new MONSTERDIE to that tile number in DEFS.CON

2. The MONSTERDIE model was def'ed into tile 4389 and will show up in Mapster if I place that tile number in a test map so I know its working.

3. Towards the beginning of GAME.CON I created a useractor called MONSTERDIE since the wiki states that the spawnable item needs to be an actor.

4. In the TROOPER code, which my new enemy is using, I added the line "spawn MONSTERDIE" right after the entries for sound and killit. This is nested in the " ifdead " code.

ifwasweapon RPG
{
sound ROCK_BUST
killit
spawn MONSTERDIE
}
The sound and killit parts run fine so I know I didn't mess up the lines of code. But the MONSTERDIE actor will not appear after the enemy dies. Any ideas what I am forgetting?

This post has been edited by Mark.: 27 July 2013 - 02:12 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1383

I don't see the point is duplicating the tile definition, instead you could just use PUKE. Also PUKE already has a hard-coded behavior similar to BLOODPOOL, which you should keep in mind.

A code won't work if you place it after the killit command, since the sprite ceases to exist and the actor code is aborted when killit is used.

This post has been edited by Fox: 27 July 2013 - 02:15 PM

0

User is online   Mark 

#1384

View PostFox, on 27 July 2013 - 02:14 PM, said:

I don't see the point is duplicating the tile definition, instead you could just use PUKE. Also PUKE already has a hard-coded behavior similar to BLOODPOOL, which you should keep in mind.

A code won't work if you place it after the killit command, since the sprite ceases to exist and the actor code is aborted when killit is used.


I didn't duplicate the tile definition. I just replaced the word PUKE with MONSTERDIE so I could keep track of things. If I don't use the killit command how do I get rid of the first model when the second model takes it's place? My uneducated guess is that after the new actor model spawns I have to detect if its in the game and if so, THEN use killit on the first model? Or is my logic laughable? :P

BTW, I tried some other tiles besides Puke and still no luck. It would be great if I could just use a newly defined tile but the game only allows to choose from a list of spawnable tiles. Which known to work tile numbers do others replace in their mods. Anyone?

This post has been edited by Mark.: 27 July 2013 - 02:37 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1385

Just use your code before killit:
spawn MONSTERDIE
killit


By default sprites in Duke 3D spawn with a scale of 1 by 1. So if you are not spawning a hard-coded sprite, it is necessary to set the scale when a new sprite is spawned...
onevent EVENT_EGS
  ifactor MONSTERDIE
    sizeat 64 64
endevent

1

User is online   Mark 

#1386

EDIT: I figured it out and then found your post. :P

Two odd things though. One, I managed to get a completely new tile 8421 to spawn instead of only replacing something from the "pre-approved" list of original sprites. The second odd thing is I had to massively increase the scale of the second model by 150 to bring it up to proper size. :P

This post has been edited by Mark.: 27 July 2013 - 03:00 PM

0

User is online   Mark 

#1387

Is there an easy way to bypass the VOLUME1 end of level sequence? I know I could disable or replace all the relevant sounds and pics that make up the cutscene but an easy line or 2 of con would be preferable.

Searching only turned up something about disabling the VOLUME4 intro.
0

User is offline   Biturbo 

#1388

Hello,

im trying to do my own projectile in game, everything is ok, but function PROJ_FLASH_COLOR doesn't seem to work.

syntax is:

Quote

defineprojectile <tile number> PROJ_FLASH_COLOR <number>

Where <number> is the color of the light. The number can be determined from RGB color values by adding the red value plus the green value shifted left 8 bits plus the blue value shifted left 16 bits. So, RGB of 100, 100, 100 would be 6579300 = 100 + 100<<8 + 100<<16 = 100 + 25600 + 6553600. 150, 100, 255 would be 16737380.


but it doesn't do anything, i've tried many combinations...
Is there any way to attach the light on the projectil?
thanks for any help,

This post has been edited by Mblackwell: 09 August 2013 - 07:41 PM

0

User is offline   OpenMaw 

  • Judge Mental

#1389

Is there a way to make the security camera's not take player control/freeze the player?
0

User is offline   zazo 

#1390

Hum, is a way to force the third person view when then game starts, in the goal to make a better view in melee fights instead of first person view ?
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1391

View PostMark., on 03 August 2013 - 04:57 PM, said:

Is there an easy way to bypass the VOLUME1 end of level sequence? I know I could disable or replace all the relevant sounds and pics that make up the cutscene but an easy line or 2 of con would be preferable.

Oh well... since that was requested once already, I went ahead and added four new LOGO_FLAGS bits.

r4109 said:

CON: Add LOGO_FLAGS bits 4096-32768 to disable E1-E4 bonus scenes, respectively.

Each scene is disabled in its entirety, there's no way to disable only a
particular part.


However, I made that revision not produce a synthesis build because 20 megs on the server for such a small change feels wasteful to me. You'll have to wait until more changes have accumulated...
1

User is offline   pmw 

#1392

Any advice how to to do a continuous earthquake?
Like, sprite which activates world's shaking and wouldn't ever stop it - until the map changes.

Is it hard-coded function, or what? I have no ideas where to look at.
0

User is online   Mark 

#1393

View PostHelixhorned, on 17 October 2013 - 08:47 AM, said:

Oh well... since that was requested once already, I went ahead and added four new LOGO_FLAGS bits.



However, I made that revision not produce a synthesis build because 20 megs on the server for such a small change feels wasteful to me. You'll have to wait until more changes have accumulated...

I'm not sure if I used your info properly or not. I saw that LOGO_FLAGS was considered a gamevar so at the beginning of my defs.con file I added in

gamevar LOGO_FLAGS 0 4096

right after a bunch of other gamevars. What happens is that instead of bypassing the E1 ending screen, the game's loading screens at the beginning are bypassed and the menu appears directly. A handy feature but not what I was expecting. Did I do something wrong on my end?

This post has been edited by Mark.: 20 January 2014 - 04:56 PM

0

User is offline   Daedolon 

  • Ancient Blood God

#1394

It's a bitfield, LOGO_FLAGS. Combine all the numbers together for the effects you want it to do.

Ie. if you want to remove the 3D Realms logo and the Duke Nukem 3D title screen, you change the value to 24.

EDIT: Derp, what. I forgot if you had to enable it or something.

This post has been edited by Daedolon: 20 January 2014 - 05:00 PM

0

User is online   Mark 

#1395

I'll have to check again. I thought that the list of bitfields showed that 4096 was to bypass E1 ending screen.
0

User is offline   Daedolon 

  • Ancient Blood God

#1396

It's the "BONUS" screen, which I assume means the score screen, in the same way as the bonusmusic is the score screen music.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1397

The value you want is 4351, because whoever designed this variable decided to make it work as an enabler with a default value that must be maintained, instead of zero.
0

User is online   Mark 

#1398

Yes. With the logo flags set, the bonus screen at the end remains and the intro screens do not. Just the opposite of what I expected.
0

User is offline   Daedolon 

  • Ancient Blood God

#1399

So 4351 = 4096 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. That's odd.
0

User is online   Mark 

#1400

I tried 4351 and the intro screens returned, the end of level scoring screen remains, the duke reloading his shotgun screen is gone, and the TEN and some other screens appear at the end now.

This post has been edited by Mark.: 20 January 2014 - 05:11 PM

0

User is offline   Helixhorned 

  • EDuke32 Developer

#1401

View Postpmw, on 20 January 2014 - 12:23 PM, said:

Any advice how to to do a continuous earthquake?
Like, sprite which activates world's shaking and wouldn't ever stop it - until the map changes.

Is it hard-coded function, or what? I have no ideas where to look at.

CON's quake, besides starting the EARTHQUAKE sound, merely sets an unexposed timer to the provided value, which is then decremented every game tic. So, you could code an actor that simply issues quake at certain intervals. Another option would be initializing the quake timer to a huge value, but since it's currently an unsigned 16-bit integer, you'd have at most 65535/30/60 = approx. 36 minutes of quake then.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1402

View PostMark., on 20 January 2014 - 04:55 PM, said:

I'm not sure if I used your info properly or not. I saw that LOGO_FLAGS was considered a gamevar so at the beginning of my defs.con file I added in

gamevar LOGO_FLAGS 0 4096

right after a bunch of other gamevars. What happens is that instead of bypassing the E1 ending screen, the game's loading screens at the beginning are bypassed and the menu appears directly. A handy feature but not what I was expecting. Did I do something wrong on my end?

Yeah, maybe I should have a bit more explicit in the commit log -- the bits are 4096, 8192, 16384 and 32768, for disabling the the four episode ending scenes, respecitvely. LOGO_FLAGS as a CON gamevar is a strange thing: if you don't define it using gamevar, it maintains its default value of 255. That's documented on the wiki, by the way.
0

User is offline   pmw 

#1403

View PostHelixhorned, on 21 January 2014 - 08:28 AM, said:

CON's quake, besides starting the EARTHQUAKE sound, merely sets an unexposed timer to the provided value, which is then decremented every game tic. So, you could code an actor that simply issues quake at certain intervals. Another option would be initializing the quake timer to a huge value, but since it's currently an unsigned 16-bit integer, you'd have at most 65535/30/60 = approx. 36 minutes of quake then.


Sounds OK. But if I change quake timer's value to huge one, isn't it gonna affect to all *quakes* on my game?
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1404

The effect of "quake <somevalue>" is like this:

play EARTHQUAKE
g_earthquakeTime = <somevalue>

So, issuing quake simply unconditionally sets the timer to a new value.

Taking another look at the source code, what you should be worried about is g_earthquakeTime being set from C code. This happens on the following occasions:

- detonating a SEENINE or OOZFILTER
- when a DUKECAR or HELECOPT (sic) explodes
- on activation of an SE2, obviously
0

User is offline   Jblade 

#1405

Would there be a way to disable an enemy's speed being affected by a projectile? at the moment melee monsters are rendered trivial by fast-firing weapons, I was thinking of how to change that so only high-damage projectiles actually stop it. I haven't taken a crack at it yet but I'm just asking here if anybody else has experimented with it.

This post has been edited by James: 10 March 2014 - 06:03 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#1406

View PostJames, on 10 March 2014 - 06:03 AM, said:

Would there be a way to disable an enemy's speed being affected by a projectile? at the moment melee monsters are rendered trivial by fast-firing weapons, I was thinking of how to change that so only high-damage projectiles actually stop it. I haven't taken a crack at it yet but I'm just asking here if anybody else has experimented with it.


I wasn't aware that projectiles stopped monsters, unless the monsters are CON coded to flinch from getting hit. So yeah, I would just code them to only flinch if the damage is over a certain percentage of their hit points.

EDIT: IIRC, the default game code actually makes monsters get pulled towards the player when they get hit. This is one of those things that can be changed in CON, and which you may have changed already, by messing with the monster's xvel or using movesprite on them after an impact.

This post has been edited by Trooper Dan: 10 March 2014 - 12:03 PM

0

User is offline   Jblade 

#1407

No, they definitely do - if you use a chaingun and shoot at a newbeast it can't move forward at all. I've just looked at their code and there's no code telling them to stop moving when hit.

This post has been edited by James: 10 March 2014 - 12:05 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#1408

View PostJames, on 10 March 2014 - 12:05 PM, said:

No, they definitely do - if you use a chaingun and shoot at a newbeast it can't move forward at all. I've just looked at their code and there's no code telling them to stop moving when hit.


OK, I'm assuming that you have already verified that the newbeast isn't stopping because of its flinching. It could be that those little movements forward involve it's xvel constantly getting reset every time it is hit -- that would explain it. So what I would do is, save its xvel in a variable each tic when it is not getting hit. When it is hit, set the xvel to the stored variable. I hope that made sense.
0

User is offline   Jblade 

#1409

I'll give that a try and see how it goes, hopefully it's not something too hardcoded into the game engine.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1410

It's hard-coded game functionality. Writing a test enemy which only seeks the player,
Spoiler

and setting a watchpoint on sprite[number_known_from_the_map].xvel shows that the culprit is in sector.c:A_DamageObject().
Spoiler

This function is one of the things that could use some form of scripting interfacing, so that its effects could be selectively disabled.
1

Share this topic:


  • 115 Pages +
  • « First
  • 45
  • 46
  • 47
  • 48
  • 49
  • 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