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

Jump to content

  • 124 Pages +
  • « First
  • 19
  • 20
  • 21
  • 22
  • 23
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   TerminX 

  • el fundador

  #601

View PostThe Commander, on Mar 1 2011, 01:32 PM, said:

Hendricks loves to mess with peoples wiki pages, ugh.

Hendricks contributes more to the wiki lately than anyone else. It's a public resource and the pages don't "belong" to anyone.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #602

View PostThe Commander, on Mar 1 2011, 01:32 PM, said:

Hendricks loves to mess with peoples wiki pages, ugh.

I cleared out your talk page once because it was full of shit and I inadvertently made a mistake while optimizing EmericaSkater's code and making it so that newbies could actually read and understand what was previously a mess. Meddling?

http://wiki.eduke32....tructure_access
http://wiki.eduke32....fvar_conditions
http://wiki.eduke32....i/Findnearactor
http://wiki.eduke32.com/wiki/Spawn
http://wiki.eduke32.com/wiki/Shoot
http://wiki.eduke32....mevar_operators

I'd ban the spambots too but I'm not a sysop.
0

User is offline   CruX 

#603

View PostThe Commander, on Mar 1 2011, 11:32 AM, said:

Hendricks loves to mess with peoples wiki pages, ugh.


He was just trying to help and it was the first contribution I've ever made to the wiki so it didn't really surprise me. I didn't know what I was doing in terms of formatting. Though I'll be honest, this - -

View PostHendricks266, on Mar 1 2011, 04:01 PM, said:

so that newbies could actually read and understand what was previously a mess.


is a bit exaggerated. I wouldn't really call a few brackets on the same line a "mess" that people wouldn't be able to understand.
0

User is offline   The Commander 

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

#604

View PostEmericaSkater, on Mar 2 2011, 02:55 PM, said:

is a bit exaggerated. I wouldn't really call a few brackets on the same line a "mess" that people wouldn't be able to understand.

I think Hendricks took what I said a bit to seriously, maybe if I had removed the ugh and replaced it with a :P
My talk page was never full of shit?

This post has been edited by The Commander: 03 March 2011 - 07:26 AM

0

#605

I have to disagree with that, ugh
0

User is offline   m210® 

#606

Quick question of Mapster32 script:
Is there a command to change the name of the sprite in 2D mode depending on the lotag. For example, sector effector actor with lotag = 2 drawn as SE:2 EARTHQUAKE name.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#607

It's already shown in the small sprite label in 2D view. The names themselves are hardcoded.
0

User is offline   m210® 

#608

Yes, I know it :P I want make other sprite like SE and I thought it's possible via script

EDIT:
I mean changing name of my sprite via script in 2D mode

This post has been edited by M210: 03 March 2011 - 02:20 PM

0

User is offline   Scott_AW 

#609

Just edit names.h

Although it would be a nice feature.
0

User is offline   m210® 

#610

View PostScott_AW, on Mar 4 2011, 07:38 AM, said:

Just edit names.h

Although it would be a nice feature.

It's not correctly right, because it's doesn't change name depending on lotag number
well, I'm understand now that it isn't possible :P

This post has been edited by M210: 03 March 2011 - 10:45 PM

0

User is offline   Wolf 

#611

I have a question. What would be the best theoretical way to add more weapons in the game? I'm thinking something along the lines of fifty weapons of various types. In fact, the best example would be that I want it like Counter-Strike, what with different types of SMG, rifles and whatnot. Just looking over the wiki, the path I've thought about was storing what kind of weapon the player has in a variable, then having one of the default duke weapon slots change stats/appearance accordingly. But I thought I'd ask in case there was perhaps a better way that the community could offer.

And then, a second question. I want my weapons to behave like the weapons in counter-strike. Meaning three things the weapons must be able to do.

-During the firing event, the weapon should play its entire shooting animation (from animated recoil to return-to-idle), but be able to be interrupted mid-animation for another shot if the firing rate settings allow it.
-Long reload animations.
-Misc. animation calls which prevent the player from firing until it's done. (Think attaching a silencer on the pistol from CS.)

But.. aren't all ingame animations bound to that.. preset kickback_pic thing?

Which.. the whole system there really confuses me, and I'm not really sure how to go about it all. Also, I say theoretical because I don't expect anyone to have to strain themselves by posting lengthy lines of code, thus doing the work for me.
0

User is offline   Danukem 

  • Duke Plus Developer

#612

View PostWolf, on Mar 5 2011, 10:58 PM, said:

I have a question. What would be the best theoretical way to add more weapons in the game? I'm thinking something along the lines of fifty weapons of various types. In fact, the best example would be that I want it like Counter-Strike, what with different types of SMG, rifles and whatnot. Just looking over the wiki, the path I've thought about was storing what kind of weapon the player has in a variable, then having one of the default duke weapon slots change stats/appearance accordingly. But I thought I'd ask in case there was perhaps a better way that the community could offer.

And then, a second question. I want my weapons to behave like the weapons in counter-strike. Meaning three things the weapons must be able to do.

-During the firing event, the weapon should play its entire shooting animation (from animated recoil to return-to-idle), but be able to be interrupted mid-animation for another shot if the firing rate settings allow it.
-Long reload animations.
-Misc. animation calls which prevent the player from firing until it's done. (Think attaching a silencer on the pistol from CS.)

But.. aren't all ingame animations bound to that.. preset kickback_pic thing?

Which.. the whole system there really confuses me, and I'm not really sure how to go about it all. Also, I say theoretical because I don't expect anyone to have to strain themselves by posting lengthy lines of code, thus doing the work for me.


Make an entire system based on manipulating your own game variables, custom projectiles and screen drawing commands. For what you want, bypassing the hardcoded system entirely would be best. You were on the right track when you talked about using a single weapon slot and changing its characteristics depending on which actual weapon the player is using. But I would not even bother with things like kickback_pic. You only need to know enough about the hardcoded shit like that to be able to disable it. One thing to keep in mind is that you can make the player shoot any projectile at any time simply by using the shoot command in the APLAYER actor code. So you don't need to make one of the hardcoded weapons fire. You could have the player locked on the Mighty Boot weapon slot but be shown holding a gun, and make it shoot when you presses fire, etc.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#613

View PostM210, on Mar 3 2011, 11:15 PM, said:

Yes, I know it :P I want make other sprite like SE and I thought it's possible via script

EDIT:
I mean changing name of my sprite via script in 2D mode


It's possible now, take a look at a.m32.
Basically you can code the little label to display anything you want, but I wouldn't mess with the predefined effector sprites.
0

User is offline   m210® 

#614

ok, I'll try it :P Thanks for you post :D

EDIT:
Thanks a lot, it works :D

Attached thumbnail(s)

  • Attached Image: capt0000.jpg


This post has been edited by M210: 07 March 2011 - 10:54 AM

0

User is offline   Jblade 

#615

View PostWolf, on Mar 6 2011, 06:58 AM, said:

*snip*

What DeeperThought suggested is the best idea - one of my projects has over 80 weapons in itself and wrestling with the hardcoded nature of Duke's weapons is still a bit of a pain. It will simply be much better to code a seperate system and just disable Duke's stuff. You can recreate gun bobbing and stuff easily enough with some built in vars. It's also easier to manage ammo rather than the hard-coded stuff, if you want to have several categories of calibre rather than just saying 'MP5 ammo' or 'AK ammo' You can detect what key the player is pressing in the aplayer actor or one of the events, so using that you can tell the game to set the gun's animation to the first firing frame for high rate of fire weapons.

I also imagine you'll want to try and code the guns (eventually at some point) to become more inaccurate like in Counter-strike or Crossfire when you hold down fire. As far as I know event_shotrange is the only real way to modify accuracy for bullets - depending on the gun you'd have a variable controlling recoil that decreases accuracy the higher it gets (and naturally decreases when you don't fire)
0

#616

Hey, I just about got NBCBP V2 finished and ready for release, but one thing is holding me back. I have a switch, but when I press it, it does not stop flickering on and off, here is the code with several experimental things left in;

// Stupid-ass dipswitch
define NCBPBUTTON1 3590
 useractor notenemy NCBPBUTTON1 0
  ifactioncount 1 break else
	ifpdistl 800 ifhitspace
	  {
		setvarvar currlev LEVEL
		action CBPRESS
		ifactioncount 1 action ANULLACTION
		
		  ifvare currlev 1
			setvar NCBP1 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 2
			setvar NCBP2 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 3
			setvar NCBP3 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 4
			setvar NCBP4 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 5
			setvar NCBP5 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 6
			setvar NCBP6 1
			  soundonce SWITCH_ON
			   quote 150
//		  else
		  ifvare currlev 7
			setvar NCBP7 1
			  soundonce SWITCH_ON
//		  else
		  ifvare currlev 8
			setvar NCBP8 1
			  soundonce SWITCH_ON
//		  else
			break
	  }
enda

0

User is offline   Danukem 

  • Duke Plus Developer

#617

There are several problems with that code. But first: Do you want this switch to only work once and then never be usable again?
0

#618

Well, that's it's intention, but I never bothered with that too much before as I didn't put an action in in the previous revision... Talking of the Action, that is defined;
action CBPRESS 0 2 1 1 1


There probably are numerous problems with the code, infact the ammount of comments probably show just how poor my coding is.
0

User is offline   Danukem 

  • Duke Plus Developer

#619

The switch can only be in 2 positions, right? One for the off position and one for the on position. Assuming that it starts in the off position (which would be equivalent to ANULLACTION) then your CBPRESS action should only have 1 frame (the on position frame). But yours has 2 frames.

I'm not trying to help fix your code yet, I'm just trying to understand what is going on with the animation because I can't see the art file or whatever you are using for the graphics.
0

#620

Correct, and it did have 1 frame before, but it did the exact same thing, can't remember why I changed it. It starts in the off position and is then switched on by the player hitting space near it (I know there are a bunch of things like ifpfacing that should be there - but I can't be bothered implementing it).

There are actually 8 duplicates defined from how it was originally intended to be coded before I integrated it in one actor (the switch).

So yeah, switch can only be on or off. When I only had "action CBPRESS" in the code, it did the same thing and just flickered on and off.
0

User is offline   Danukem 

  • Duke Plus Developer

#621

OK, I'm going to assume that this action will show the switch in the OFF position:

action CBPRESS 1 1 1 1 1

If not, then it's your fault and you need to change the art or whatever. With that in mind, here is some code that should work:

define NCBPBUTTON1 3590

 useractor notenemy NCBPBUTTON1 0

ifaction CBPRESS break

ifp pfacing // this is not perfect but it's good enough for now
  ifpdistl 800
	ifhitspace
	  ifcanseetarget
	{
		action CBPRESS
		sound SWITCH_ON
		quote 150
		
		  ifvare LEVEL 1
			setvar NCBP1 1
		  else
		  ifvare LEVEL 2
			setvar NCBP2 1
		  else
		  ifvare LEVEL 3
			setvar NCBP3 1
		  else
		  ifvare LEVEL 4
			setvar NCBP4 1
		  else
		  ifvare LEVEL 5
			setvar NCBP5 1
		  else
		  ifvare LEVEL 6
			setvar NCBP6 1
		  else
		  ifvare LEVEL 7
			setvar NCBP7 1
		  else
		  ifvare currlev 8
			setvar NCBP8 1
	}
enda


Note that this code still looks kind of odd. Why do you have a different variable for each level? I'm sure you can get by with only one variable. Also, note that LEVEL equals 0 in the first level of an episode, and you have the switch doing nothing in the case. I'm not sure if that's what you intended.

This post has been edited by DeeperThought: 10 March 2011 - 03:25 PM

1

#622

Thanks. Now to explain a little;

The switch updates the HUD depending on what level you are on (there are 8 dots at the top, one to symbolise each level) and also causes a panel to dissapear in the hub map (LEVEL 0 - there is no switch in the hub map).

The code functions, but the switch does not change tile (the tile with the ON position) when I press it. It's probably my fault and I'm half inclined to leave it.
0

User is offline   Danukem 

  • Duke Plus Developer

#623

View PostHigh Treason, on Mar 10 2011, 02:22 PM, said:

The code functions, but the switch does not change tile (the tile with the ON position) when I press it. It's probably my fault and I'm half inclined to leave it.


Make tile 3590 the switch in one position and tile 3591 the switch in the other position (whatever order you want). That's all there is to it. Why would you leave it when it is so easy to fix?

You can easily get rid of those variables and just have one variable that is used as a bit field, but that's a story for another time.
0

#624

That's how things are in the art (It used .def files for the art) - but it still doesn't cause the switch to change. Here's how the art files look;
Posted Image

There are eight of those panels, one more dissapears in the hub map for every level you hit the switch in - this part works. Do I need to set up the "On" tile in the .con in some way? I'm willing to bet I've gone and overlooked something stupid. As for bitfields, yeah, that is for another time, I've never used them yet, to be honest, with the one-time-use of the switch, I could get it working using addvar, but then I would have to change code in other places for something that would likely be un-noticed in the game.
0

User is offline   Danukem 

  • Duke Plus Developer

#625

Sorry, the action should be:

action CBPRESS 1 1 1 1 1


I don't know how I managed to miss that.
0

#626

Ah, that's done it! Thanks for all of your help, the switch now works perfectly.

You have been added to the credits list for the project, if you want removing from it for some reason, let me know and I'll remove it.
0

User is offline   Danukem 

  • Duke Plus Developer

#627

I'm inclined to ask you to remove it simply because I am already credited for so many different projects that it seems silly. Besides, I didn't do much. The only reason to credit me would be if you were using something much more substantial, like big chunks of code from one of my mods.

This post has been edited by DeeperThought: 10 March 2011 - 04:39 PM

0

#628

Ok, if that's what you want, consider it done - your name has now been removed from the list. The reason I added it is because I do like to credit anybody that helps, regardless of what it was they did, back when animation was my thing I used to have all kinds of stupid things in the credits, even the guy at Kwik Save that found more pot noodles for me whilst I was working on something :P - actually, maybe I do take crediting a bit too far.
0

#629

Im simply trying to hide the default weapon tiles to input my own.

onevent EVENT_DISPLAYWEAPON
{
getplayer[THISACTOR].curr_weapon temp
ifvare temp PISTOL_WEAPON
{
setvar RETURN -1
}
}
endevent

But... I get no change. I've tried using both PISTOL_WEAPON and 1 as the value for RETURN. And I've tried both displayweapon and drawweapon as the event.
0

User is offline   Danukem 

  • Duke Plus Developer

#630

onevent EVENT_DISPLAYWEAPON

ifvare currentweapon 1 setvar RETURN -1

endevent

0

Share this topic:


  • 124 Pages +
  • « First
  • 19
  • 20
  • 21
  • 22
  • 23
  • 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