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

Jump to content

  • 124 Pages +
  • « First
  • 12
  • 13
  • 14
  • 15
  • 16
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Plagman 

  • Former VP of Media Operations

#384

Not really, the automatic script buffer increasing code should take care of that for you.
0

User is offline   Danukem 

  • Duke Plus Developer

#385

Plagman just fixed a bug in the showview command which would cause it to mess up moving sectors (e.g. rising doors) when used in EVENT_DISPLAYROOMS. It wasn't working properly with the movement interpolation code when called from that event. The problem was framerate dependent, which means that any use of showview in EVENT_DISPLAYROOMS would break sync in multiplayer.

Here's a link to the fixed build.

Once again, Plagman, thanks!
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#386

I am having an error with new snapshot (EDuke32 2.0.0devel 20091017)

Quote

42154928
33317: 31337 {
33318: 1899 getactor 253 19 332 230 332 14
33325: 1901 divvarvar 332
33327: 4 guniqhudid 253 17
33330: 1902 cos 385
33332: 4 guniqhudid 253 15
33335: 1903 sin 386
33337: 4 guniqhudid 253 15
33340: 1904 hitscan
33341: 4 guniqhudid 253 0
33344: 4 guniqhudid 253 1
33347: 4 guniqhudid 253 2
33350: 4 guniqhudid 253 13 385 386 332current actor: 288 (2605)
g_errorLineNum: 0, g_tw: 386


This is the CON part that causes the error:

Quote

getactor[THISACTOR].zvel ATEMP
mulvar ATEMP 16384
divvarvar ATEMP sprite[THISACTOR].xvel
cos ANGX sprite[THISACTOR].ang
sin ANGY sprite[THISACTOR].ang
hitscan sprite[THISACTOR].x sprite[THISACTOR].y sprite[THISACTOR].z sprite[THISACTOR].sectnum ANGX ANGY ATEMP
RETURN RETURN ATARGET RETURN RETURN RETURN 4294901808

0

User is offline   Jblade 

#387

I've got a question about build script - what can it be used for? there's lots of instructions on the wiki but no tutorials or anything that tells me what it can do.
0

#388

Time for a new question [I think :o]:

I'm developing a shield buff [like a status buff] for NR, which is supposed to in theory "block" and sometimes "reflect/deflect" mystic-based attacks [one example can be the Octabrain's/Cycloid's mindblasts. I got it to "block" okay, but I was curious if anyone had ever tried the "deflect" part in their own code runs before.

Basically what I'm hoping to pull off is that when a projectile that can be blocked/deflected hits the shield, the original Projectile copies certain properties to a new projectile of identical strength and stuff but with the player's owner id, and bounce it away from them. For the best effect in my opinion, I need to know if it's possible to make a projectile disappear mid-impact[as in it won't show it's impact/explosion animation and just vanishes instantly]. I'm not sure if it can be done with custom or hard-coded projectiles or not.

I'm going to eventually work at this, but I got other tweaks for earlier stuff to worry about before I do, and I figured on dropping this set of questions on you guys in the meantime. ;)

This post has been edited by Lord Misfit: 22 October 2009 - 06:55 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#389

htg_t may help. I am not sure, but it may be acessible before the projectile impact.
0

User is offline   Danukem 

  • Duke Plus Developer

#390

View PostLord Misfit, on Oct 22 2009, 07:54 PM, said:

Basically what I'm hoping to pull off is that when a projectile that can be blocked/deflected hits the shield, the original Projectile copies certain properties to a new projectile of identical strength and stuff but with the player's owner id, and bounce it away from them. For the best effect in my opinion, I need to know if it's possible to make a projectile disappear mid-impact[as in it won't show it's impact/explosion animation and just vanishes instantly]. I'm not sure if it can be done with custom or hard-coded projectiles or not.


I've made a few player force fields that deflect projectiles. Just change the angle of the projectile, it's zvel and owner. You don't need to fire a new one. You can spawn an animation sprite at the point where it deflects and play a sound. Maybe the real problem is you don't know how to make the projectile deflect without it dying. You can have the projectile detect distance to the force field and hitscan for it, then turn it around before it actually hits anything. Another method is to allow it to hit, but use EVENT_KILLIT to cancel its death and then turn it around from there.
0

User is offline   lycanox 

#391

Is there a way to kill actors when they are asleep.
I am trying to create a remote controlled missile. But it is unable to kill most monsters unless the player wakes them first.

It also seems that monsters behave differently when asleep. So is it possible to blow up Liz troopers when asleep.
But not possible to blow up Liz mans.
0

#392

View PostDeeperThought, on Oct 23 2009, 12:46 AM, said:

I've made a few player force fields that deflect projectiles. Just change the angle of the projectile, it's zvel and owner. You don't need to fire a new one. You can spawn an animation sprite at the point where it deflects and play a sound. Maybe the real problem is you don't know how to make the projectile deflect without it dying. You can have the projectile detect distance to the force field and hitscan for it, then turn it around before it actually hits anything. Another method is to allow it to hit, but use EVENT_KILLIT to cancel its death and then turn it around from there.


I should let you guys know I have gotten most of this all working now with deflecting stuff. It's not the exact method above, but I do have EVENT_KILLIT involved with a lot of it, and I still let the original projectile die and spawn a new one[but I can destroy the originals instantly too]. The only minor snafu with it is that when it deflect's a COOLEXPLOSION1, I try to get it's count and actorcount just before it's deleted through htg_t 0 & 2, but they always come back as 0 so when the new projectile is spawned, it spawns at it's default animation frames instead of part-way into the animation already.

Because of this I've been considering remaking a "COOLEXPLOSION2" or something as a replacement so deflected mindblasts actually hurt non-players and such, but I'm trying to get an idea of the animation speed and fuse/lifetime of the original COOLEXPLOSION1 is in exact values. Does anyone know that information on this topic? It would be a big help for me. :o
0

User is offline   XThX2 

#393

If nothing else works, you can always set an actorvar for it to point the actioncount by "ifactioncount 1 setactorvar[THISACTOR].frame 1" but I'm sure htg_t would work fine. Where are you using htg_t 0 and 2 ? You can try EVENT_GAME just to see if it works.
0

User is offline   Danukem 

  • Duke Plus Developer

#394

View PostLord Misfit, on Oct 24 2009, 10:30 AM, said:

I should let you guys know I have gotten most of this all working now with deflecting stuff. It's not the exact method above, but I do have EVENT_KILLIT involved with a lot of it, and I still let the original projectile die and spawn a new one[but I can destroy the originals instantly too]. The only minor snafu with it is that when it deflect's a COOLEXPLOSION1, I try to get it's count and actorcount just before it's deleted through htg_t 0 & 2, but they always come back as 0 so when the new projectile is spawned, it spawns at it's default animation frames instead of part-way into the animation already.

Because of this I've been considering remaking a "COOLEXPLOSION2" or something as a replacement so deflected mindblasts actually hurt non-players and such, but I'm trying to get an idea of the animation speed and fuse/lifetime of the original COOLEXPLOSION1 is in exact values. Does anyone know that information on this topic? It would be a big help for me. :o


Why shouldn't the animation reset, and why would anyone care ? I appreciate attention to detail, but this crosses the line into being a weird fetish. You are spending time and adding code to deal with "problems" that no one cares about (and I'm not saying that based only on this feature).
0

User is online   Hendricks266 

  • Weaponized Autism

  #395

		case COOLEXPLOSION1__STATIC:
			t->shade = -127;
			t->cstat |= 8192;
			t->picnum += (s->shade>>1);
			break;


				if (s->picnum == COOLEXPLOSION1)
				{
					s->shade++;
					if (s->shade >= 40) KILLIT(i);
				}


Does that help?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#396

How can I draw something at event DISPLAYROOMS and so that it will be draw BEHIND the transparent water ror sectors? Because whenever I draw something there using roratesprite, it appers in front of the ror sectors.
0

User is offline   CruX 

#397

Getting arrows to stick in a wall (if they actually 'hit' a wall) is something I've been trying to hammer out since I started working on the bow for my mod, and I still haven't managed to get it working. I thought at first I could do it with the htg_t struct, but that only appears to work for bullet-type projectiles (come to think of it, I've only managed to get it to do anything for shotgun, SHOTSPARK1 and chaingun projectiles). Now I'm starting to think it has something to do with the hitscan command, but if returning what's under the crosshair is it's only function, then I'm having some trouble imagining how that could pull the desired effect either. Can anyone help me figure this out?
0

User is offline   XThX2 

#398

You could possibly check for the velocity of the arrow, and make it hitscan the time it is spawned (once) to get the wall it hitscanned's x/y/z values. When the velocity is set to 0, you can make the arrow spawn another arrow (this time, no projectile code; possibly with different art) at the coordinates it left off. (That's the first thing that comes to my mind now)
0

User is offline   CruX 

#399

View PostXThX2, on Nov 4 2009, 10:56 AM, said:

You could possibly check for the velocity of the arrow, and make it hitscan the time it is spawned (once) to get the wall it hitscanned's x/y/z values. When the velocity is set to 0, you can make the arrow spawn another arrow (this time, no projectile code; possibly with different art) at the coordinates it left off. (That's the first thing that comes to my mind now)


Hmmm.. I did try something earlier where I coded the arrow to spawn a SHOTSPARK1 on impact, then coded the SHOTSPARK1 to use htg_t if it was spawned by an arrow. This way it'd know whether or not it was hitting a wall, and if it did I had it change it's picnum to the arrow (a different set, like you suggested). It's gotten me a bit closer to what I wanted, but now for some reason the arrow ends up spinning around in place when it spawns (even though I know I gave it the correct frames). Strange stuff...
0

User is offline   XThX2 

#400

As far as my tests resulted, ifspawnedby when used by shotspark1 does not have any effect. Instead, I do this;

	  findnearsprite IONPARTICLEBOOM 500 returnvar1
	  ifvarn returnvar1 -1
	  {
		  getactor[returnvar1].htg_t 2 temp
		  ifvare temp 0
			  killit
		}


Where IONPARTICLEBOOM is a bullet based projectile that spawns an explosion when it hits a wall. Try it this way and see if it works. Of course, you would get the necessary information from it before killing it.

This post has been edited by XThX2: 04 November 2009 - 11:55 AM

0

User is offline   CruX 

#401

View PostXThX2, on Nov 4 2009, 11:53 AM, said:

As far as my tests resulted, ifspawnedby when used by shotspark1 does not have any effect. Instead, I do this;

	  findnearsprite IONPARTICLEBOOM 500 returnvar1
	  ifvarn returnvar1 -1
	  {
		  getactor[returnvar1].htg_t 2 temp
		  ifvare temp 0
			  killit
		}


Where IONPARTICLEBOOM is a bullet based projectile that spawns an explosion when it hits a wall. Try it this way and see if it works. Of course, you would get the necessary information from it before killing it.


Well, I changed the code from changing picnums to just having it spawn the stuck arrow actor and that got rid of the crazy rotating problem. Last hurdle is trying to figure out how to get it closer to the wall to actually create the illusion that it's really stuck in the wall (right now it spawns a few inches away so, it's just sort of hanging in mid-air). Just to see what would happen, I coded the arrow to move further inwards towards the wall once it spawns then stop after a few tics, but it vanishes if it goes too far, and just hangs in the middle of the wall if it's actually 'within' it. Is this something that only a model can fix?
0

User is offline   XThX2 

#402

Is that arrow rendered as vertically flat ? I would probably suggest you change the y-repeat of the arrow and cstat of it to make it vertically flat. That way, it would look like it's actually in the wall. (It can possibly make the arrow look longer than it actually is though :))
0

User is offline   CruX 

#403

View PostXThX2, on Nov 5 2009, 11:37 AM, said:

Is that arrow rendered as vertically flat ? I would probably suggest you change the y-repeat of the arrow and cstat of it to make it vertically flat. That way, it would look like it's actually in the wall. (It can possibly make the arrow look longer than it actually is though :))


At this point I should really know what vertically flat means, but if it's aligned with the floor, then no it's not. Also I found another way to do it that's pretty simple (so simple, i can't believe I didn't think of it beforehand ). I just made a bullet-type projectile that had no graphic or extra value, and spawned a custom decal. I then coded the arrow to spawn another invisible custom actor on impact that would shoot said projectile that would leave behind this decal and that decal, once being spawned, would spawn the arrow in the wall. Sort of has a jerry-rigged feel to it, but it works pretty nicely.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#404

Whenever I use startlevel command in multiplayer, it seems like to be resulting in a votation beetween players... but I wanted it to go right through levels. How can I do it?

This post has been edited by Ilovefoxes: 06 November 2009 - 06:11 AM

0

User is offline   XThX2 

#405

View PostEmericaSkater, on Nov 5 2009, 12:22 PM, said:

At this point I should really know what vertically flat means, but if it's aligned with the floor, then no it's not. Also I found another way to do it that's pretty simple (so simple, i can't believe I didn't think of it beforehand ). I just made a bullet-type projectile that had no graphic or extra value, and spawned a custom decal. I then coded the arrow to spawn another invisible custom actor on impact that would shoot said projectile that would leave behind this decal and that decal, once being spawned, would spawn the arrow in the wall. Sort of has a jerry-rigged feel to it, but it works pretty nicely.


Vertically flat means well, open mapster32, put a sprite and press R, the first time you do it; what you see is vertically flat. (Aligned with wall)

Can they be picked up, by the way ?
0

User is offline   CruX 

#406

View PostXThX2, on Nov 6 2009, 07:38 AM, said:

Vertically flat means well, open mapster32, put a sprite and press R, the first time you do it; what you see is vertically flat. (Aligned with wall)

Can they be picked up, by the way ?


Picked up AND climbed on. You'll get to see when I nail down a few more changes and post some more videos. (I got the full version of FRAPS just for you :) )
0

User is offline   Danukem 

  • Duke Plus Developer

#407

View PostIlovefoxes, on Nov 6 2009, 06:10 AM, said:

Whenever I use startlevel command in multiplayer, it seems like to be resulting in a votation beetween players... but I wanted it to go right through levels. How can I do it?


It's not supposed to stop for voting, that sounds like a bug.
0

User is offline   XThX2 

#408

I have an interesting question. How can I remove the "spinningnukeicons" without removing their art ? (I need it so the one on the right can disappear) It seems like a tricky task, as event game doesn't function on menu.
0

User is offline   Danukem 

  • Duke Plus Developer

#409

View PostXThX2, on Nov 9 2009, 10:38 AM, said:

I have an interesting question. How can I remove the "spinningnukeicons" without removing their art ? (I need it so the one on the right can disappear) It seems like a tricky task, as event game doesn't function on menu.


I don't know of any way to do that. Maybe you could remove their art (or replace it with something invisible), and then draw your own on the left side in the the appropriate event. That would require having access to where the player is in the menu, though, and I'm not sure if that's available.
0

User is offline   XThX2 

#410

I've asked about it to Hunter_Rus way back, when he helped with the special actions of menu. I asked if I could access to the commands of the player in there to display my own icon. He said he could think of doing it... that's probably the last time I've ever heard of him ! D: I for myself would be more than happy to replace that icon with something more appropriate, or even play around with it's properties. (I've been using displaymenurest for menu actions)

This post has been edited by XThX2: 09 November 2009 - 10:56 AM

0

User is offline   XThX2 

#411

[EDIT] : Sorry, nevermind.

This post has been edited by XThX2: 14 November 2009 - 03:00 AM

0

User is offline   CruX 

#412

...Is there any conventional way to keep the player's sprite from going semi-transparent when you go into third-person mode? It seems like there should be, but I didn't see anything about it in the player struct on the wiki and just using cstat commands beneath the APLAYER line didn't do anything...
0

User is offline   Danukem 

  • Duke Plus Developer

#413

View PostEmericaSkater, on Nov 20 2009, 08:20 AM, said:

using cstat commands beneath the APLAYER line didn't do anything...


That's because the sprite you see in F7 mode is not the player sprite. It's a member of the tsprite array which is used only for display purposes. To access that array, use EVENT_ANIMATESPRITES. Only sprites with the 16 bit set in their mdflags member will be processed in that event, so do that first:

actor APLAYER MAXPLAYERHEALTH PSTAND 0 0

getactor[THISACTOR].mdflags temp
orvar temp 16
setactor[THISACTOR].mdflags temp


Then, since only player tsprites will be processed and you want them to have cstat 0, do this:

onevent EVENT_ANIMATESPRITES
settspr[THISACTOR].tsprcstat 0
endevent

0

Share this topic:


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