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

Jump to content

  • 124 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   XThX2 

#91

What are the uses of WEAPONX_WORKSLIKE ? I've changed tipbomb's to other weapons' workslikes but the weapon itself acts the same. Could someone add a text about it to the wiki?
0

User is offline   Spiker 

#92

If I remember corectly you gave some code like this! I also was confused that it didn't work but later I discovered that weapon 2 is in fact weapon three so it changed yhe shotgun! It goes from 0 to 9 and and in traditional "keyboard way" ;P
0

User is offline   Danukem 

  • Duke Plus Developer

#93

I just added this to the wiki for WEAPONX_WORKSLIKE. It is from memory so I hope it is accurate:


This determines which tiles are displayed in the HUD when the weapon is used. It would be more aptly named "LOOKSLIKE" than "WORKSLIKE". Set this to 1 and the weapon will display the pistol art, 2 for shotgun, etc. It is completely useless if you are using your own HUD code.
0

User is offline   Spiker 

#94

In the code Xthx2 gave me shotgun not only looks like kick but also "shoots kick"
0

User is offline   Danukem 

  • Duke Plus Developer

#95

View PostSpiker, on Jul 14 2009, 09:12 AM, said:

In the code Xthx2 gave me shotgun not only looks like kick but also "shoots kick"



Maybe he also set WEAPON2_SHOOTS KNEE? Anyway, if the information is wrong someone can fix or delete it.
0

User is offline   Spiker 

#96

If I may comment on con tutorials. Probaly the con code is not that difficult to learn (quite simmilar to pascal in some aspects) but the way in which it is presented in the wiki is not very convinient for someone who just starts to learn it. I would even say it's a reference for experienced coders and there are few tutorials that really address some problems.

When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.

Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P

Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole. ;)
0

User is offline   Danukem 

  • Duke Plus Developer

#97

View PostSpiker, on Jul 14 2009, 09:42 AM, said:

If I may comment on con tutorials. Probaly the con code is not that difficult to learn (quite simmilar to pascal in some aspects) but the way in which it is presented in the wiki is not very convinient for someone who just starts to learn it. I would even say it's a reference for experienced coders and there are few tutorials that really address some problems.

When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.

Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P

Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole. ;)


There were tutorials written a long time ago. For example, Reaper_Man has some here:

http://concode.planetduke.gamespy.com/

Look at "Actions Explained", "Writing a Basic Actor", etc There's also an old tut that covers a lot of stuff on the wiki.

But if you want tutorials that cover the newer EDuke commands, then you're out of luck. There is some stuff on the wiki, but you aren't going to find EDuke CON coding For Dummies.
0

User is offline   Jimmy 

  • Let's go Brandon!

#98

Reaper_Man's tutorial is awesome. I used it for years. However, be forewarned that his tutorials have no mention of Eduke32 commands and effects. I would however really like to see a "Coding your own Weapon" tutorial, as I've been trying to come up with a way to do it without just doing a copy and paste job.

This post has been edited by Captain Awesome: 14 July 2009 - 10:40 AM

0

User is offline   Spiker 

#99

Thanks! Something new to study finally. I guess that without new commands I lose much! ;) Also there is problem with time. I find it hard to learn blender, gimp and coding at the same time and trying to make something out of it ;)
0

User is offline   XThX2 

#100

What I gave you was a code that set the pre-defined gamevars of weapon2 (I think I mixed it up as you said there ;), It had to work though) to make it act like KNEE weapon. If you call that complicated... :/
0

User is offline   Spiker 

#101

Codito ergo sum. I haven't studied any examples in Reaper's tutorial yet but after seeing this phrase I'm sure this is one of the most awesome tutorials here ;)

This post has been edited by Spiker: 14 July 2009 - 11:15 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#102

View PostSpiker, on Jul 14 2009, 11:42 AM, said:

If I may comment on con tutorials. Probaly the con code is not that difficult to learn (quite simmilar to pascal in some aspects) but the way in which it is presented in the wiki is not very convinient for someone who just starts to learn it. I would even say it's a reference for experienced coders and there are few tutorials that really address some problems.

When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.

Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P

Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole. ;)



http://wiki.eduke32.com/wiki/Confaq42

I also have an old Eduke 2.0 con FAQ somewhere. Perhaps I should add it to the Wiki?

This post has been edited by Mblackwell: 14 July 2009 - 01:44 PM

0

User is offline   Usurper 

  • Hates Twitter

#103

I'd rather see additions to http://wiki.eduke32.com/wiki/Scripting

or have the old confaq updated to include EDuke32 concepts.
0

User is offline   XThX2 

#104

ifvarand WEAPON8_FLAGS 3328
{
	subvar WEAPON8_FLAGS 3328
	setvar WEAPON8_FLAGS 4
}


I don't know why, but this little change refuses to work. This code is in the EVENT_FIREWEAPON event, under a switch which checks the current weapon of the player. I used a simple setvar command at first, but addlogvar command showed that the flags are still set to 3328 ( 2048, 1024 and 256; STAND_STILL (this must go away), CHECKATRELOAD (some specific tripbomb control) and NOVISIBLE). Is this hardcoded?
0

User is offline   Danukem 

  • Duke Plus Developer

#105

If you suspect that the flag cannot be set, then why don't you just put the setvar in the player code, like with ifhitspace { setvar WEAPON8_FLAGS 4 addlogvar WEAPON8_FLAGS } ?
0

User is offline   XThX2 

#106

I tried that too, except that when I tried it, I forgot to add the addlogvar to see it... (I must've been really blind to see no difference) But strangely enough, it seems that the control thing doesn't lie in the flag, the thing that makes you stop for a second, then let's you go. I have no idea how to fix it at all. (What I'm talking about is, the thing that makes you halt when you use tripbombs on a wall; except that in my mod, you can freely fire by the small fire code I added) And all this leads to one point. Htg_t 's tripbomb control's usage :/

This post has been edited by XThX2: 15 July 2009 - 08:19 AM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #107

How would I code the keycard slot so that there are three states, as shown below? These examples are from SW.

Locked
Posted Image

Unlocked, with Key
Posted Image

Unlocked, without Key
Posted Image
0

User is offline   XThX2 

#108

I would rather code my own, just like a switch except with a bitvar to check the keys of your own. GotNoKey? 0; GotKey? 1; GotKeyButActive? 2. You can keep the bits with the colors too.

This post has been edited by XThX2: 15 July 2009 - 03:43 PM

0

User is offline   XThX2 

#109

	{
		eshoot GRAYROCKET
		getactor[THISACTOR].x x
		getactor[THISACTOR].y y
		getplayer[THISACTOR].ang TEMP
		setvarvar x2 x
		addvar x2 384
		setvarvar y2 y
		subvar y2 128
		rotatepoint x y x2 y2 TEMP x3 y3
		setactor[RETURN].x x3
		setactor[RETURN].y y3
		eshoot GRAYROCKET
		addvar y2 256
		rotatepoint x y x2 y2 TEMP x3 y3
		setactor[RETURN].x x3
		setactor[RETURN].y y3		
	}


I don't know why, but this projectile goes through walls if you fire really close to the wall. (I think it is because of the rotatesprite) How can I prevent it ? Here's the code of the projectile itself in any case.

defineprojectile GRAYROCKET PROJ_WORKSLIKE 65538
defineprojectile GRAYROCKET PROJ_SPAWNS EXPLOSION2
defineprojectile GRAYROCKET PROJ_VEL 814
defineprojectile GRAYROCKET PROJ_EXTRA 300
defineprojectile GRAYROCKET PROJ_ISOUND GRAY_BOOM
defineprojectile GRAYROCKET PROJ_XREPEAT 48
defineprojectile GRAYROCKET PROJ_YREPEAT 48
defineprojectile GRAYROCKET PROJ_HITRADIUS 2600
defineprojectile GRAYROCKET PROJ_OFFSET 128
defineprojectile GRAYROCKET PROJ_CLIPDIST 48


And a different question, what does ifvaror do? Is it like "if variable Y is added X, then do" ?

This post has been edited by XThX2: 17 July 2009 - 06:31 AM

0

#110

View PostXThX2, on Jul 17 2009, 09:44 AM, said:

And a different question, what does ifvaror do? Is it like "if variable Y is added X, then do" ?

I assume it does a bitwise OR and executes the code block if the result is not zero.

This post has been edited by Dr. Kylstein: 17 July 2009 - 08:19 AM

0

User is offline   XThX2 

#111

Is there any chance for someone to take a "backup" of the scripting thread at 3D Realms forums or move the posts to here? (May sound ridiculous, just noticed when I read again...) I was going through the oldest one and there are a lot of valuable information that should not be lost in case the forums go down.

This post has been edited by XThX2: 18 July 2009 - 03:24 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#112

Dynamicremapping is not working and I am getting a "warning: duplicate g_dynamicTileMapping statement" error.

I am only using it as I always used:

Quote

dynamicremap define SMALLSMOKE 3610

May I have missed certain update note and I am using a out-of-date sintax? =/
0

User is offline   Hendricks266 

  • Weaponized Autism

  #113

All you have to do is put "dynamicremap", alone, at the beginning of DEFS.CON. You don't need to put it before every switched label.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#114

1) Hmm... I tried it, but it has no effect.

Quote

dynamicremap
define SECTOREFFECTOR 1
define ACTIVATOR 2
(...)
define SMALLSMOKE 3610


2) Does the Shrinker HUD weapon glowing is stored somewhere? I mean, the crystal HUD tile seems to change it's shading. Is it stored somewhere in a structure member?
0

User is offline   XThX2 

#115

2) I don't think so. Why do you need it?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #116

1) Odd, it worked for me.
2) It's in the WEAPONx_... gamevars, I think WEAPON6 to be exact.
0

User is offline   XThX2 

#117

He didn't mean the flag for it, he meant the shade for it's crystal.
0

User is offline   m210® 

#118

Help me please to make an actor which will be reflected from walls(as a billiard sphere) after a shot at this actor.

This post has been edited by M210: 22 July 2009 - 12:00 PM

0

User is offline   XThX2 

#119

Hmm, I haven't thought too much about it, but this little explanation might work for you.

When hit by a weapon (ifhitweapon OR getactor[THISACTOR].htextra temp ifvarg temp 0) get the angle your actor got hit, add 1024 to it, set your actors angle to the new angle and make it shoot a projectile that looks exactly like this actor, and then kill the shooting actor. Make sure this new projectile has bounces off walls tag along with a few others that you find necessary. (I don't have time to type out the whole code)

This post has been edited by XThX2: 22 July 2009 - 01:02 PM

0

User is offline   m210® 

#120

I think use a movesprite command.
Angle of actor may get through code
getactor[THISACTOR].htang tmp
cos x tmp
sin y tmp
movesprite THISACTOR x y 0 CLIPMASK RETURN

and need get a ID of wall which have contact with actor and reflect it. but how to get it ID of wall?

This post has been edited by M210: 22 July 2009 - 01:49 PM

0

Share this topic:


  • 124 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • 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