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

Jump to content

  • 117 Pages +
  • « First
  • 14
  • 15
  • 16
  • 17
  • 18
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#451

View PostHigh Treason, on Jan 5 2010, 02:06 PM, said:

I hate to ask, but does anyone have the code for making 3D skyboxes using event displayrooms, I have no idea how it is supposed to work (other than using invalid textures where I want it to show through) - I could sure use it to make paralax scrolling and similar effects easier and more efficient than i have been doing them.

http://forums.duke4....?showtopic=1560
0

User is offline   CruX 

#452

I've been batting around some ideas for auto aiming in my camera mod (yeah, I'm still working on it), and got a relatively simple idea. Since I'm using DT's scantrail code and that itself uses a hitscan command, I could just use the hitsprite return variable, get the picnum, x, y, z, and ang of the sprite, then force the player to face it at the press of a button.

It's a good thing I'm trying to start this idea out simple since it's already kicking my butt.

Here's the code. It's beneath the APLAYER line, and the code itself isn't all there. I've only included what I'm trying to alter.

ifvare AIM 1 // if the player's aiming, calculate the cos, sin and z angles, then do a hitscan
{   
setvarvar mysector temp
getplayer[THISACTOR].ang angvar
getplayer[THISACTOR].horiz zdist
subvar zdist 100
mulvar zdist -2048
cos mycos angvar
sin mysin angvar

// horiz at 0 z angle is 100; pos for up, neg for down

hitscan x y z mysector mycos mysin zdist hitsector hitwall hitsprite hitx hity hitz clipmask

ifvarn hitsprite -1 { quote 1 }


I'm assuming that the hitsprite variable serves a purpose similar to findnearactor's return variable. In that case, it should print the quote if the hitscan's over a sprite. It doesn't. If i change the line to where it prints the quote if hitsprite EQUALS -1, it plays all the time, but the scantrail is hitting tons of sprites. Is this a clipping issue, or am I just royally screwing something up?
0

User is offline   XThX2 

#453

I think your problem lies within the "clipmask" variable that you don't seem to have set something to. Check this to find whatever suits your case :

Clipmask

But, I guess you need CLIPMASK0, it clips to blockable sprites and walls. (I think you want it to auto aim to enemies, so they automatically should have blockable sprite cstat)
0

User is offline   CruX 

#454

View PostXThX2, on Jan 28 2010, 07:29 AM, said:

I think your problem lies within the "clipmask" variable that you don't seem to have set something to. Check this to find whatever suits your case :

Clipmask

But, I guess you need CLIPMASK0, it clips to blockable sprites and walls. (I think you want it to auto aim to enemies, so they automatically should have blockable sprite cstat)


The clipmask variable is set to 4294901808, per the wiki's suggestion (and what DT originally had it set to).
0

User is offline   XThX2 

#455

Then I don't know why it doesn't work :/ Out of curiosity, what have you set the "temp" variable to, in the line "setvarvar mysector temp". I don't think it's the problem, but just to be sure ;)

EDIT : I have the same code for a similar purpose, and here's what I do which did show the quote :

	getplayer[THISACTOR].posx posx
	getplayer[THISACTOR].posy posy
	getplayer[THISACTOR].posz posz
	getplayer[THISACTOR].cursectnum mysectplayer
	getplayer[THISACTOR].ang angvar2
	getplayer[THISACTOR].horiz horiz
	subvar horiz 100
	mulvar horiz -2048
	cos cosine angvar2
	sin sine angvar2
	
	hitscan posx posy posz mysectplayer cosine sine horiz hitsector2 hitwall2 hitsprite2 hitx2 hity2 hitz2 4294901808



Could it be because you have been using the variables you have already used above in some other hitscan call that APLAYER does?

This post has been edited by XThX2: 28 January 2010 - 06:56 AM

0

User is offline   CruX 

#456

Not sure, but I removed it and there was no appreciable change.
0

User is offline   williamjcm 

#457

Is there a way to implement a flashlight in duke using polymer dynamic lights ?

If it is possible, I would like a code that creates a flashlight activated by EVENT_TURNAROUND.

PM me the code since I don't have enough time to read the forums because of high scool.
0

User is offline   supergoofy 

#458

Look for Fusion Redux. James have added a flashlight.

Also I 've sent you a p.m.

This post has been edited by supergoofy: 30 January 2010 - 05:28 AM

0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#459

View Postsupergoofy, on Jan 31 2010, 02:25 AM, said:

Look for Fusion Redux. James have added a flashlight.

Also I 've sent you a p.m.

But don't use it with the latest versions of EDuke32 as the flashlight will be broken due to the changes made to polymer lights and the way that Fusion Redux uses the light.
0

User is offline   williamjcm 

#460

View PostThe Commander, on Jan 30 2010, 02:54 PM, said:

But don't use it with the latest versions of EDuke32 as the flashlight will be broken due to the changes made to polymer lights and the way that Fusion Redux uses the light.

And if I deactivate Polymer ?
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#461

View Postwilliamjcm, on Jan 31 2010, 02:57 AM, said:

And if I deactivate Polymer ?

Posted Image

Then you wouldn't have a flashlight... *sigh*

This post has been edited by The Commander: 30 January 2010 - 06:00 AM

1

User is offline   supergoofy 

#462

The flashlight of Fusion Redux works ok with latest eduke32 builds (it was a problem of earlier builds). Tested with r1594
0

User is offline   Jblade 

#463

I can't run polymer on this PC unfortunately (Well I sorta can, but only in older versions of Eduke32....and at about 2 FPS) but if I could I would fix up Redux so it'd work - alot of white lights still have their values set to 0 so they won't work either. Plus I just learned about why the flashlight was projecting the Sector Effector sprite...I can not only fix that but also use it to apply a flashlight style texture as well.
0

User is offline   williamjcm 

#464

View Postsupergoofy, on Jan 30 2010, 03:50 PM, said:

The flashlight of Fusion Redux works ok with latest eduke32 builds (it was a problem of earlier builds). Tested with r1594


The flashlight don't work with the bundled Eduke32.

Is this possible to make the flashlight like the Recon Car headlights : a directional Polymer light "welded" to the player.
0

User is offline   supergoofy 

#465

At the time that Fusion Redux was released, we could not publish a compiled binary of eduke32 with polymer. It was forbidden. That's the reason why the pack includes a standard eduke32 build.

The flashlight makes use of polymer renderer. At least I have tested it with eduke32 r1594 and it still works.

Look here for new eduke32 builds:
http://dukeworld.duk...ke32/synthesis/

This post has been edited by supergoofy: 01 February 2010 - 07:02 AM

0

User is offline   XThX2 

#466

Are action definitions need the player be seen first to be activated ? Because I'm having a strange trouble here. I want my enemy to have a small standing action while inactive but he has to "see" the player to begin the standing action. (I've removed any actor ATTACK/SEEK etc. code for testing; also with the "see" I mean player seeing it, not the monster CORRECTLY seeing you) Here's the code that I use.

 case CHAINGUNNER
   getactorvar[THISACTOR].mo_active temp
   ifvarn temp 1
   {
	   ifaction AENEMYSTAND nullop else action AENEMYSTAND
	   state enemystand
   }
 break



That case is in EVENT_GAME, under a picnum switch. Also, that "state enemystand" only has these lines in it at the moment, to disable another issue about the "seeing" thing I described above :

state enemystand

getactor[THISACTOR].ang temp_ang
ifvarvarn temp_ang standang { setvarvar temp_ang standang setactor[THISACTOR].ang temp_ang }
ends


This post has been edited by XThX2: 04 February 2010 - 03:53 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#467

View PostXThX2, on Feb 4 2010, 03:50 PM, said:

Are action definitions need the player be seen first to be activated ?


You could find out easily enough by using changespritestat THISACTOR 1 on the monster in its EVENT_GAME code. EDIT: When you do that, also try setting its httimetosleep to 780 (or some other good number) so it doesn't immediately fall asleep again.

This post has been edited by DeeperThought: 04 February 2010 - 04:24 PM

0

User is offline   XThX2 

#468

Well I did that and saw that the action is played on map start. What does it mean now? Does that mean the monster has to see the player?

This post has been edited by XThX2: 04 February 2010 - 04:39 PM

0

User is offline   XThX2 

#469

How do the "stopactorsound" and "ifactorsound" commands work ? I keep typing in "THISACTOR" and the name of sound I want to stop but it keeps giving me the "expected a keyword but found THISACTOR (or the name of the sound I want to stop)" It doesn't have any wiki article either.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#470

onevent EVENT_WEAPKEY2
ifvare BARRACKSMENU 1
ifcount 26
{
  resetcount
  setplayer[THISACTOR].shield_amount 100
  setactor[THISACTOR].extra 100
	{
	setvar BARRACKSMENU 0
	addammo PISTOL_WEAPON 999
	}
}
endevent

onevent EVENT_WEAPKEY5
ifvare BARRACKSMENU 1
ifcount 26
{
  resetcount
  setplayer[THISACTOR].shield_amount 200
  setactor[THISACTOR].extra 200
	{
	setvar BARRACKSMENU 0
	addweapon RPG_WEAPON 999 
	}
}
endevent

Both case work fine on there own, but if I am to go from EVENT_WEAPKEY5 back to EVENT_WEAPKEY2 it doesn't set my health and shield back to 100 but sets at random amounts till I have used the EVENT_WEAPKEY2 several times.

Ideally the plan is for classes, but I am unsure why it's not setting the correct health and shield amounts once switching between.

Posted Image
I have just gone from EVENT_WEAPKEY5 Class, to EVENT_WEAPKEY2 Class
The health and shield *should* be 100 each.

This post has been edited by The Commander: 07 February 2010 - 05:52 AM

0

User is offline   XThX2 

#471

Have you tried waiting a few seconds before you press again ? I think the "ifcount" could be the problem.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#472

View PostXThX2, on Feb 8 2010, 03:00 AM, said:

Have you tried waiting a few seconds before you press again ? I think the "ifcount" could be the problem.

Just tried it then, ran around for 30+ seconds.
Went back to the barracks, changed to Riflemen class and same thing, oddly though it gave me a different value than the picture above.

Health: 146
Shield: 54

They seem to be very similar, but not precise. Maybe some sort of percentage value thing going on here?
But why it's not being set to exactly 100 is beyond me. ;)

EDIT: I think I have a fair idea whats going on now.
http://wiki.eduke32....ENT_INCURDAMAGE

This post has been edited by The Commander: 08 February 2010 - 12:54 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#473

How can I play a sound while menu is being displayed (.gm MODE_MENU)? This is, like the menu on/off sounds. If I use sound command, it doesn't play during menu.

Edit: solved sound issue ;)


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


How can I disable the display of non-weapon hud display? More specific, hand holding access card. I want to display it using my own code.

This post has been edited by Ilovefoxes: 07 February 2010 - 01:43 PM

0

User is offline   Mblackwell 

  • Evil Overlord

#474

http://wiki.eduke32....iki/Access_incs
0

User is offline   Stabs 

#475

Umm can someone write up a script that changes any unseen walls to blank tiles, tile 5000 for example but only if the wall is completley unseen

I think this mite help boost the fps a bit in polymer
0

User is offline   Danukem 

  • Duke Plus Developer

#476

View PostDanM, on Feb 8 2010, 06:49 PM, said:

Umm can someone write up a script that changes any unseen walls to blank tiles, tile 5000 for example but only if the wall is completley unseen

I think this mite help boost the fps a bit in polymer


If a wall is not being rendered then there is no point in making it blank. So what you want is to blank out walls that are being rendered but are not in the player's view. Even if the necessary information was available at script level (AFAIK it isn't) the processing needed to figure out which walls, then blank and unblank walls, would completely defeat the purpose and actually lower the frame rate.
0

User is offline   Jblade 

#477

That wouldn't even help, would it? I know doing something like that in Half-life helped the FPS but that was using BSP.
0

User is offline   Mblackwell 

  • Evil Overlord

#478

Walls that aren't visible aren't being rendered anyway as long as the sector they are in isn't visible (because each sector acts as a portal). Unless you have absolutely every sector exposed in the open with tons of objects in them you shouldn't be getting poor performance. There are ways you could do what you asked, but they would in fact degrade performance massively as others have mentioned.
0

User is offline   XThX2 

#479

How can you make something get gradually more transparent without using cstat ? I see this happens with the mapname printing on picking custom maps from user map menu, but I can't seem to find any code in CON for that. Does anyone know how?
0

User is offline   TerminX 

  • el fundador

  #480

Heh, that actually does use the transparency bits in cstat, but it also changes the shade of the text at the same time. It's just a cheap trick to fool the eyes.
0

Share this topic:


  • 117 Pages +
  • « First
  • 14
  • 15
  • 16
  • 17
  • 18
  • 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