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

Jump to content

  • 123 Pages +
  • « First
  • 10
  • 11
  • 12
  • 13
  • 14
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   NF64 

  • Touched by the Banhammer

#331

Quote

To reposition the camera, you will need to change the values of the camera variables (e.g. cameraang) in a display event. You will have to learn a lot of stuff before you can do that competently.

simple enough.

This post has been edited by Nfelli64: 19 September 2009 - 07:55 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#332

I am trying to create beetween levels animations, intermission screens, etc. Although whenever I play a sound it is affected by game environment, this is, being underwater or after defeating a boss (command endofgame 52) which stop the sound from playing.

Any idea?
0

User is offline   Danukem 

  • Duke Plus Developer

#333

You could make a little sector somewhere and teleport the player to it.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#334

Setting sector lotag to 0 and timebeforeexit to 0 does the work perfectly.
0

User is offline   XThX2 

#335

I'm sure I've asked this in the past but I ask it again hoping I'll have a clue this time. I have been trying to code the "bullets going thru if dead" for shotgun/supershotgun for my mod and I have a rather crappy way of doing it; which is by small delays. (Shooting 6 pellets per frame of the weapon up to 4 frames which makes 24 pellets) and... well it works the way it is supposed to be, however it is not really satisfying. First, you can spread the pellets wider by looking left/right/up/down. Also, there will only be 6 pellets going through if it happens.

I was playing the game and found out that some actors have this property such as CHAIR1, CHAIR2, vases, and even the slimer. When you shoot them, the pellets go through them when one hits them. I checked the source code for such things but couldn't find; so what I'm asking is if anyone can provide me information about how this can be done, or is done in the game ? (I'm hoping that it's not hard-coded for the first pellet hitting the object, then the rest going through)
0

User is offline   Danukem 

  • Duke Plus Developer

#336

View PostXThX2, on Sep 26 2009, 02:06 PM, said:

(I'm hoping that it's not hard-coded for the first pellet hitting the object, then the rest going through)


Well of course it is hardcoded. Otherwise it would be possible to add to any actor using 1.5 CON commands.
0

User is offline   XThX2 

#337

I meant, coded to act that way. If so, it would be really useless to add on enemies.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#338

Yeah, it would be good if there was an spriteflag or something for that.
0

User is offline   Mblackwell 

  • Evil Overlord

#339

Why not just have the actor that was hit calculate the angle the bullet that hit it was shooting from and shoot a second bullet?
0

User is offline   Danukem 

  • Duke Plus Developer

#340

View PostMblackwell, on Sep 26 2009, 08:08 PM, said:

Why not just have the actor that was hit calculate the angle the bullet that hit it was shooting from and shoot a second bullet?


That's better than nothing, but it's not great.

The second bullet will have a random component to its angle, because there is still no way to modify ANGRANGE when fired from a non-player. Also, it would be hard to recover the vertical angle accurately. And what if the actor got hit by more than one bullet at the same time? There's no way to know that just from checking the actor. Plus, you don't even know where the bullet hit, and when the actor fires the new bullet it will shoot from its mid-section regardless.

A better source of information is the SHOTSPARK1 actor itself, when it spawns. You get the exact location that it hit, the angle it is facing, and by comparing its location relative to the player you can recover the vertical angle as well. Plus there is one such actor for each bullet, so there's no problem in knowing how many hit. But deciding whether the SHOTSPARK1 should fire a new bullet, and then doing so with the right results presents its own problems.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#341

Is it possible to get in a gamevar what is the width and height in pixels of an specific tile number? For example, for making a background.

I suppose it is possible, as it seems to affect gameplay (for example a blocking wall sprite, etc).
0

User is offline   XThX2 

#342

View PostDeeperThought, on Sep 26 2009, 11:47 PM, said:

That's better than nothing, but it's not great.

The second bullet will have a random component to its angle, because there is still no way to modify ANGRANGE when fired from a non-player. Also, it would be hard to recover the vertical angle accurately. And what if the actor got hit by more than one bullet at the same time? There's no way to know that just from checking the actor. Plus, you don't even know where the bullet hit, and when the actor fires the new bullet it will shoot from its mid-section regardless.

A better source of information is the SHOTSPARK1 actor itself, when it spawns. You get the exact location that it hit, the angle it is facing, and by comparing its location relative to the player you can recover the vertical angle as well. Plus there is one such actor for each bullet, so there's no problem in knowing how many hit. But deciding whether the SHOTSPARK1 should fire a new bullet, and then doing so with the right results presents its own problems.


I thought it would be a lot of work to do as well, which would have bugs. Right now, there's nothing I can do but to find the way to provide the smallest delay of all. For one thing, I've tried ifvarn and it's not really fast. I also tried the htg_t of the actor, still not enough. I tried whilevarn at some point but it was too fast that they were being fired at the same time.

So, what can I do to provide an almost unnoticable delay between all 24 shots ? (Or per 4 shots for 6 tries, 3 for 8 and such)
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#343

You can't. A tick is 1/26 of a second. That nothing fast.


I am not sure how you could do it, but I have discovered something close to that.

Posted Image

There you can see the shots are at different angles. During EVENT_EGS I use SHOTSPARK1 to change the player angle. And the delay equal to zero.

===//===//===

What is the best way to simulate a multiplayer game? I heard you can do it through the console command, but I don't know how. =/

This post has been edited by Ilovefoxes: 27 September 2009 - 05:35 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#344

Code executed in actor loops occurs each tic, code executed in EVENT_EGS I believe occurs each tic for each actor (EG: 1K actors = 1K times per tic), code executed in a Display event (EVENT_DISPLAYREST, etc) occurs once per frame rather than per tic.
0

User is offline   Danukem 

  • Duke Plus Developer

#345

View PostMblackwell, on Sep 27 2009, 08:23 AM, said:

Code executed in actor loops occurs each tic, code executed in EVENT_EGS I believe occurs each tic for each actor (EG: 1K actors = 1K times per tic), code executed in a Display event (EVENT_DISPLAYREST, etc) occurs once per frame rather than per tic.


EVENT_EGS code is executed immediately when something is spawned and then never again for that sprite. For example, in "espawn PIGCOP setactor[RETURN].pal 17" the EGS code runs right after the spawn and before the pal is set. Maybe you were thinking of EVENT_GAME?
0

User is offline   Mblackwell 

  • Evil Overlord

#346

View PostDeeperThought, on Sep 27 2009, 11:06 AM, said:

EVENT_EGS code is executed immediately when something is spawned and then never again for that sprite. For example, in "espawn PIGCOP setactor[RETURN].pal 17" the EGS code runs right after the spawn and before the pal is set. Maybe you were thinking of EVENT_GAME?


Yes.
0

User is offline   Chip 

#347

Right then, how would I go about making an actor of mine become (or make) a light source?
In the old Polymer thread started by DT, he said that he had actors spawn SECTOREFFECTORS and the actors controlled them.
I've just tried that but the very instant a SECTOREFFECTOR is spawned (or espawned) the game crashes with -found lonely sectoreffector at x y ..... So I had it spawn a dummy actor first, set its values then change its picnum to a SECTOREFFECTOR but then the game would er.. no crash but not work either. The game would "pause" all map present actors of all types except the player allowing me to wounder around a map in a photo like mode - taking screen shots of current scenes and events from different angles!
However any newly spawned actors would work as normal

It was interesting but not what I wanted.
Basically how would I have my own non hard coded light sources in game? I intend to have things like flame throwers, weapons and such which need to spawn a light source so I can't just hide them off map and move them into place.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#348

I have no idea.

But first, about you changing an actor to SE, do you tryed to change te tags in EVENT_EGS?

For what I know, SEs have an special cstat assigned to them. Debug an map and check it.

This post has been edited by Ilovefoxes: 29 September 2009 - 06:53 AM

0

User is offline   Chip 

#349

Quote

But first, about you changing an actor to SE, do you tryed to change te tags in EVENT_EGS?


No I did not! I'll try that.
0

User is offline   Danukem 

  • Duke Plus Developer

#350

View PostChip, on Sep 29 2009, 07:30 AM, said:

So I had it spawn a dummy actor first, set its values then change its picnum to a SECTOREFFECTOR but then the game would er.. no crash but not work either.


That's the method I use. But you have to change the statnum to 3.

EDIT: And no, you do not have to use EVENT_EGS.

This post has been edited by DeeperThought: 29 September 2009 - 07:01 AM

0

User is offline   Chip 

#351

I didn't know about the statnum 3 on SE's.
Anyway I did it through event_EGS (Which still to this day I keep thinking is only for weapons! - I've got to get out of that habbit) and so I can bypass dummyactors and just have event_GAME move the SE to where the spawner was.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#352

I am not sure why this error occur. It seems like to be whenever I use the hitscan command while the screen is not at 100% of it's size (status bar scale lower).

Quote

323422016
32156: 31337 {
32157: 1778 getactor 253 19 331 230 331 14
32164: 1780 divvarvar 331
32166: 4 guniqhudid 253 17
32169: 1781 cos 380
32171: 4 guniqhudid 253 15
32174: 1782 sin 381
32176: 4 guniqhudid 253 15
32179: 1783 hitscan
32180: 4 guniqhudid 253 0
32183: 4 guniqhudid 253 1
32186: 4 guniqhudid 253 2
32189: 4 guniqhudid 253 13 380 381 331current actor: 524 (2605)
g_errorLineNum: 0, g_tw: 381

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#353

What is the most effective method to freeze the player?

Statnum only affects the APLAYER actor, not the player itself.

Constantly setting actor[].extra to zero works for single player, but not multiplayer as I cannot "ressurect" the player later.

Commands such as lockplayer only stop looking or moving around, isn't effective for making an intermission screen or something else.

This post has been edited by Ilovefoxes: 03 October 2009 - 12:52 PM

0

User is offline   XThX2 

#354

On_Crane is what you are looking for I believe.
0

User is offline   Danukem 

  • Duke Plus Developer

#355

View PostXThX2, on Oct 3 2009, 01:57 PM, said:

On_Crane is what you are looking for I believe.


That's a good one. You can also manually set the player's ang and horiz, and cancel various events (like EVENT_JUMP, EVENT_FIRE, etc)
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#356

on_crane is quite good, but I am not completely sure. I am not sure, but maybe I can stop the player firing and look up/down manually.

Edit: It stops several movements, but setting actor[].extra to 0 completely freezes all functions from the player 1 (even is God Mode is on). With crane_on, I would need to set up so many things (weapon animation, firing, changing, etc etc just with weapon), oh well...

This post has been edited by Ilovefoxes: 03 October 2009 - 03:35 PM

0

User is offline   XThX2 

#357

You can set the kickbackpic of player to 0 when goes higher than 0; you can play with the input member "bits" to do what you want.

Why would you want to set player's health to 0 ? :s
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#358

Setting .extra to zero stop it, really really stop all player functions, but doesn't work in multiplayer.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#359

Numplayers gamevars seems to not working with me, it is always zero. Is it because I am using bots?
0

User is offline   Danukem 

  • Duke Plus Developer

#360

View PostIlovefoxes, on Oct 7 2009, 07:57 PM, said:

Is it because I am using bots?


Yes.
0

Share this topic:


  • 123 Pages +
  • « First
  • 10
  • 11
  • 12
  • 13
  • 14
  • 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