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

Jump to content

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

EDuke32 Scripting  "CON coding help"

User is online   Danukem 

  • Duke Plus Developer

#421

View PostM210, on Dec 5 2009, 10:17 AM, said:

Other part of my code works true, because I tried to use ifcansee command and it worked, but this command gave variable = 1 even if actor was behind a wall.

Well, I try to delete getincangle part but it will not helped :)


Read my edit above.
0

User is offline   m210® 

#422

Quote

EDIT: I just ready throgh your code for the first time, and it's really weird. Who is THISACTOR? Is that the player? You have some sprite looping through all the sprites in the game, and when it gets to a LIZTROOP it checks whether it is facing it. But if the sprite running the code isn't the player, then there's no reason to believe there should be visibility in the screenshot. But if it is the player, then there is no reason to check ifvarvarn spriteid THISACTOR (since we already know the player isn't a LIZTROOP).

I just deleted all the cases in the switch, and this switch had all the enemies including APLAYER as cases!
Yes, THISACTOR is PLAYER and "ifvarvarn spriteid THISACTOR" check is performed because other players exist in multiplayer and Voodoo weapon will do damage to THISACTOR APLAYER if not to check it.
		case LIZTROOP
		case OCTABRAIN
		case COMMANDER
		case PIGCOP
		case LIZMAN
		case GREENSLIME
		case NEWBEAST
		case BOSS1
		case BOSS2
		case BOSS3
		case BOSS4
		//case APLAYER

I think I have found an error.
With case APLAYER deleted this code works correctly, but why the code doesn't work with "case APLAYER"?

This post has been edited by M210: 05 December 2009 - 12:07 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#423

I want to add a change at already defined [[Definegametype]] modes. Although I don't know the default values of the original modes. I can guess them, but I can't trust that method.

Anyone has a list?
0

#424

Hey guys, I got a little request about the muzzle flash of the chaingun. Well you know that the tile only got 1 animated flame. But it's copied 3 times (for the 3 barrels).
Here is a screenshot to make my question more clear.

Is it possble to delete/change it with con coding and replace/hange it with one muzzleflash?

Thanks in advance guys.

Attached thumbnail(s)

  • Attached Image: duke0000.jpg


This post has been edited by insane_metalhead: 06 December 2009 - 10:08 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#425

You should experiment drawing weapons onscreen. That one should not be hard, you would replace the normal muzzle tile with a blank one, and them draw in event_drawweapon a new muzzle.
0

User is online   Danukem 

  • Duke Plus Developer

#426

View PostIlovefoxes, on Dec 6 2009, 03:58 PM, said:

You should experiment drawing weapons onscreen. That one should not be hard, you would replace the normal muzzle tile with a blank one, and them draw in event_drawweapon a new muzzle.


Yes it would be hard, because he would have to cancel the hardcoded drawing of the weapon and draw it and the muzzleflashes using rotatesprite. With positioning, weapon bob, shading etc. to worry about, that's a lot of work if you don't already have code for it or know how to do it.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#427

Yes. But he don't need to cancel the Chaingun code, since rotatesprite will draw below the default weapons.
0

User is offline   Chip 

#428

How would I make actors including the player detect when they are hit by RADIUSEXPLOSION?
That attack doesn't seem to write into the .htextra and instead bypasses it completely and goes straight to subbing it from the actor's extra thus foiling my plan of simply having it check htextra for positive values.

This post has been edited by Chip: 07 December 2009 - 08:43 AM

0

User is online   Danukem 

  • Duke Plus Developer

#429

View PostChip, on Dec 7 2009, 08:37 AM, said:

How would I make actors including the player detect when they are hit by RADIUSEXPLOSION?
That attack doesn't seem to write into the .htextra and instead bypasses it completely and goes straight to subbing it from the actor's extra thus foiling my plan of simply having it check htextra for positive values.


I didn't know it worked that way. It still sets .htpicnum, but if what you say is true then I don't know you could tell how much damage was caused. You don't have to use hitradius, though. You could use an invisible custom projectile that blows up immediately.
0

User is offline   Chip 

#430

The same thing also happens with floor damage which the player takes from such flooring as HURTRAIL, FLOORPLASMA etc.
I'm not too sure what method I may use to counter these. Also I'm unsure what exactly you mean by spawning invisible projectiles since they'll have to make contact with an actor to inflict damage else it'll be a hitradius and having the exposion shoot invisible projectiles to fulfill a radius will causes problems (some actors get hit more than once some may not be hit, and there will need to be alot around in a 360 bubble to hit actors higher then the blast)

Another failed ploy was to have actors constantly seek invisible actors dedicated for explosion radiuses but using findnearactor can only get ahold of one meaning actors in a barrage of explosons only get hit once. Using the oh so popular "cycle through all sprites" thing will cause lag since my actors will be doing this all the time. Unless I reverse it so only the damaging inflicting object seeks through all sprites of what it may hit but it'll still cause lag when multiple explosions are going off.

This post has been edited by Chip: 08 December 2009 - 11:02 AM

0

User is offline   XThX2 

#431

I think you can use, which is what I use for my random damaging projectiles, detect the htpicnum of the invisible projectile and make it deal damage to player in APLAYER code. You can generalize it with a switch too, it's pretty customizable that way.

About the floor, you can do the same thing, except this time you would check the sector's picnum, deal some damage every tic the player is on the sector. (But when not jumping)

This post has been edited by XThX2: 08 December 2009 - 12:06 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#432

I have heard around there that findnearsprite consumes too much processing. Does "cycle through all sprites" using headspritestat and whilevarn consumes less than it?
0

User is online   Danukem 

  • Duke Plus Developer

#433

View PostIlovefoxes, on Dec 8 2009, 05:15 PM, said:

I have heard around there that findnearsprite consumes too much processing. Does "cycle through all sprites" using headspritestat and whilevarn consumes less than it?


If you know that the statnum of the sprite you are looking for is 1, then findnearactor would be more efficient than looping with headspritestat/whilevarn, unless you have some other reason to use a loop. If the statnum is 0, then using headspritestat/whilevarn is probably faster than findnearsprite, because the loop would only be checking the statnum 0 sprites.

This post has been edited by DeeperThought: 08 December 2009 - 06:04 PM

0

User is offline   Milo 

#434

Quick newbie guestion: Where are the weapons defined in the CON files? I don't mean the tile definitions, but the actual code for the weapons. I was planning on copy-pasting to get started on some custom weapons but can't find it anywhere...
0

User is offline   Jimmy 

  • Let's go Brandon!

#435

Weapons are hardcoded, its not present in the confiles.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#436

You can, otherwise, start checking this page: http://wiki.eduke32....pdated_gamevars
0

User is offline   Milo 

#437

I've read all through what I think is the right stuff about creating weapons, but still have no clue as to how to actually do it... If someone could post a simple example script for a weapon, even recreating the pistol in CON coding that would be an enormous help and I'd be fine from then on.
0

User is offline   The Commander 

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

#438

It may be easier if you could tell us if you want to replace an existing weapon or add new ones to the ones already available.

The first option is easier, has the existing weapons can be modified to work the way you want your new weapon to.
0

User is offline   Milo 

#439

Replacing the existing weapons. I can replace them graphically easily enough but only by changing around the tiles, not adding new frames or anything.
0

User is offline   NerdZilla 

#440

View PostMilo, on Dec 29 2009, 03:01 PM, said:

Replacing the existing weapons. I can replace them graphically easily enough but only by changing around the tiles, not adding new frames or anything.


weapons are just about the only thing i've learned at this point. i mite help aboul to you. im attemping to make a goldeneye style reload. a simple, gun drops off screen (sounds FXs) gun come back on screen...

for the most part im begining to realise the math behind the game is alot like N64 games. the Skycar is only a few more codes away from something like Starfox 64 in all range mode.
nintendo did some really well thought out programing for there day on N64... look into it, you'll see. what thay where working with and what thay did... its down right amazing insperation to a newbie like me. even, though i dont think i'll get that good at it.
0

User is offline   Jimmy 

  • Let's go Brandon!

#441

View Postinsane_metalhead, on Dec 6 2009, 01:06 PM, said:

Hey guys, I got a little request about the muzzle flash of the chaingun. Well you know that the tile only got 1 animated flame. But it's copied 3 times (for the 3 barrels).
Here is a screenshot to make my question more clear.

Is it possble to delete/change it with con coding and replace/hange it with one muzzleflash?

Thanks in advance guys.


Simple, all you have to do is make the muzzle flash a null tile. Then you can add your muzzle flash onto the shooting frames of whatever weapon you want, like the pistol art. It's what was done before all this new fancy confangled coding we got now. :lol:
0

User is offline   Milo 

#442

View PostNerdZilla, on Dec 30 2009, 03:26 AM, said:

weapons are just about the only thing i've learned at this point. i mite help aboul to you. im attemping to make a goldeneye style reload. a simple, gun drops off screen (sounds FXs) gun come back on screen...

for the most part im begining to realise the math behind the game is alot like N64 games. the Skycar is only a few more codes away from something like Starfox 64 in all range mode.
nintendo did some really well thought out programing for there day on N64... look into it, you'll see. what thay where working with and what thay did... its down right amazing insperation to a newbie like me. even, though i dont think i'll get that good at it.


Any help at all would be appreciated!
0

#443

I try to create a spawner,so i do his


gamevar lo_tag 0 2
gamevar MONSTER_TILE 0 2
gamevar COUNTDOWN 0 2


useractor notenemy INVASION

  getactor[THISACTOR].lotag lo_tag
   ifvare lo_tag 0
   break
  else
  getactor[THISACTOR].shade COUNTDOWN
  getactor[THISACTOR].hitag MONSTER_TILE
   espawnvar MONSTER_TILE
   subvar COUNTDOWN 1
    ifvare COUNTDOWN 0
     break
	 killit
	else
	return
  enda


As you see,i really suck,whatever i try,this code spawn one guy,or spawn without stop...
0

User is offline   XThX2 

#444

This should work. You seem to have problems with brackets, simply having any if/else and any other statement without a bracket below them will only have them applied to the line right below them, and nothing else. With brackets, you allow them to be a condition of where the brackets are. Simply put, use brackets :lol:

Also different from your code, I've added a bit of delay between the enemy spawn time. You can modify it by changing ifcount's value. I changed the places of getactor stuff too, as you don't need them updated every tic. I also suggest you have a cstat 32768 in your actor code after finishing it, as you wouldn't want that actor to be seen in the game.

gamevar lo_tag 0 2
gamevar MONSTER_TILE 0 2
gamevar COUNTDOWN 0 2

eventloadactor INVASION
getactor[THISACTOR].shade COUNTDOWN
getactor[THISACTOR].hitag MONSTER_TILE
getactor[THISACTOR].lotag lo_tag
// cstat 32768
enda

useractor notenemy INVASION
   ifvare lo_tag 0
	 killit
  else
  {
	  ifcount 8 ifvarn COUNTDOWN 0 // You can add a delay for the spawn interval. For now I used ifcount.
	  {
		   espawnvar MONSTER_TILE
		   subvar COUNTDOWN 1
		   resetcount
	  }
	  else
		   killit
  }
enda


This post has been edited by XThX2: 03 January 2010 - 04:55 AM

0

#445

Thanks a lot! :lol:

Why you have moved the getactor lines into a eventloadactor?

I don't understand the interest of eventloadactor here :s...assuming that this code is for monster and maybe weapon,(but i think for weapon i would prefer using respawn) it is really usefull?

edit : hum,your code don't spawn anything,after trying,i've got this,that work =) thanks

gamevar lo_tag 0 2
gamevar MONSTER_TILE 0 2
gamevar COUNTDOWN 0 2

eventloadactor INVASION
getactor[THISACTOR].shade COUNTDOWN
getactor[THISACTOR].hitag MONSTER_TILE
getactor[THISACTOR].lotag lo_tag
enda

useractor notenemy INVASION

   ifvare lo_tag 0
	break
  else
  {
	ifvarn COUNTDOWN 0
	 {
	  espawnvar MONSTER_TILE
	  subvar COUNTDOWN 1
	  } 
	 else
	  break
	  }
  enda


This post has been edited by Kenny mckormick: 03 January 2010 - 08:23 AM

0

User is offline   XThX2 

#446

Sorry I found the bug with that. This should work,

gamevar lo_tag 0 2
gamevar MONSTER_TILE 0 2
gamevar COUNTDOWN 0 2

eventloadactor INVASION
getactor[THISACTOR].shade COUNTDOWN
getactor[THISACTOR].hitag MONSTER_TILE
getactor[THISACTOR].lotag lo_tag
// cstat 32768
enda

useractor notenemy INVASION
   ifvare lo_tag 0
	 killit
  else
  {
	   ifcount 8
	   {
		   ifvarn COUNTDOWN 0
		   {
		   espawnvar MONSTER_TILE
		   subvar COUNTDOWN 1
		   resetcount
		   }
		   else
			 killit
	   }
  }
enda


This post has been edited by XThX2: 03 January 2010 - 09:17 AM

0

#447

Don't tested your own,but as you says, it should work =) my mine work...

But i think i don't understand how work Event ><

i do this

gamevar TEMP 0 2

onevent EVENT_KILLIT

setactor[THISACTOR].picnum TEMP
ifvare TEMP 1680
 {
 spawn 52
 }
else
break
 endevent


So,when something die,like a liztroop,this event should check if it is a LIZTROOP (1680) and if yes,spawn a medic...
But...no that do nothing...
0

User is offline   NerdZilla 

#448

You know how when you fire your gun you have a flash in game?.. well at least in software. how do i get rid of that buggy flash? it kind of ruins the look im going for.
0

User is offline   XThX2 

#449

Kennymcmormick, try setting the "setactor" to "getactor" and see if it works :lol:
0

#450

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.
0

Share this topic:


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