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

Jump to content

  • 120 Pages +
  • « First
  • 22
  • 23
  • 24
  • 25
  • 26
  • 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

#691

View PostHendricks266, on 11 October 2011 - 04:30 PM, said:

Maybe some of the newer PROJ_WORKSLIKE flags (near the bottom) do what you want.


LOL, I haven't looked at that list in a while, and I didn't know there was a FLAG_ACCURATE :(
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#692

Is it possible to add a "BOUNCESOFFWALLSONLY" flag, which won't bounce if hit the floor?
0

#693

Hi fellow dukers! The name is Tom, and I have been an avid Duke Nukem 3D player since the game came out. I'm 27 years old, and I still love this game to death!

Anyhow, I'm collaborating with a cyber cafe in my hometown on a project; the project is to bring a Duke Nukem 3D network game to the customers and create a tournament. We're using eDuke32 to make this possible.

The thing we are most challenged with right now is scripting certain parameters (triggers for rotating maps when a quota is met e.g. kill count or timer).

Could anybody give us any direction on how to go about this, if possible?

Thanks!

- Tom
0

#694

You can find the all the stuff you need here http://wiki.eduke32.com/wiki/Main_Page
You need to get into gamevars.
0

User is offline   Jimmy 

  • Let's go Brandon!

#695

I think he's asking for command line parameters, not how to code.
This should help you.
0

#696

Are you sure? Kill counter control with command lines?
0

User is online   Danukem 

  • Duke Plus Developer

#697

View Postrasmus thorup, on 14 October 2011 - 03:42 PM, said:

Are you sure? Kill counter control with command lines?


I think C.A. is right. The post talked about "parameters" and it's normal for multiplayer games to have an option for switching maps after a certain number of kills or after a certain amount of time without extra scripting.
1

User is offline   Jay 

#698

How do i spawn monsters in eduke32 dukeplus pack atomic edition in a user map
0

User is online   Danukem 

  • Duke Plus Developer

#699

http://wiki.eduke32....onsole_commands

example:

spawn PIGCOP

types in the console of course
0

User is offline   Zaxtor 

#700

Is it possible to make example a weap shoot 2 diff projectiles BUT only when a var is set. it spawns an extra projectile.
Without the var set is the ordinary knee (claw)

For my mod the knee is a claw because the player is a wolverine he uses his claw instead of using his knee like duke does use the knee/boot.

When I did a test with the knee (num 2521) the thing only spawns on IMPACT of the knee (claw) as it must touch something to spawn w/e. It doesn't move because when you spawn a projectile by (spawn) it wont move if is a projectile i.e missile, shrink spark etc.
What I wanna make is it shoots it without being obligated to hit something to spawn it.


defineprojectile 2521 PROJ_WORKSLIKE 16
is the actual code for the (knee)

Also the projectile I've made I want to shoot when he uses claw if the var is set

defineprojectile 4808 PROJ_WORKSLIKE 2
defineprojectile 4808 PROJ_VEL 320
defineprojectile 4808 PROJ_EXTRA 17
defineprojectile 4808 PROJ_HITRADIUS 856
defineprojectile 4808 PROJ_SPAWNS EXPLOSION2

is a powerball that explodes on impact

So I wanna try to make so when as soon you hit the button 1 which throws the kick (claw for my mod) it shoots something but only when a var is set.
I'm making a "Weapon addon" that you get when you risk your life by searching it by going deep down.

Like ifvare POWERBALL 1 { that code to make the thing shoot that projectile while using the melee weap }


In my mod OBLIVION I had a similar thing. Example when you grab a booster the weap makes a deadlier explosion.
But the weap spawns an invisible sprite (on impact or by making trails) that dies instantly if no var is set.
but when is set it makes the deadly explosion or a trail of energy for its trail. But as above is diff.
0

#701

Hi Zaxtor.
You have made a working projectile. What you need to change is the weapon itself.
http://wiki.eduke32....efined_gamevars
Look at the mighty foot. Change WEAPONx_FIREDELAY to a lower number.
Now i wonder. Have you made the wolverine claws animation? You might want to change WEAPONx_TOTALTIME to make the animation "fit".
I hope i didn't misunderstand the question >.>
0

User is offline   Zaxtor 

#702

His claw is animated, been done since the beginning of time.

I'm trying to make so example if I take something it sets a var and when I use the weap 0.
Without the var set is just the normal claw. and it ignores the "defineprojectile 2521 PROJ_WORKSLIKE 2" in knee/claw defineprojectile

It will still display the claw but shoot a projectile (power ball that explodes on impact just like the rpg)
But I want it to fire as soon u press 0.

Forgot to say before,..

If I mix 2 define projectiles in the knee (claw for my mod).

Example v

defineprojectile 2521 PROJ_WORKSLIKE 16
defineprojectile 2521 PROJ_WORKSLIKE 2
defineprojectile 2521 PROJ_SPAWNS POWERBALL_1


The thing will still punch but shoot a punch while pressing 0 that explodes on impact.
But is VERY close of what I want. As means only 1 error to be fixed. making so when it shoots it shoot 4808 instead of 2521

But it shoots the image of the claw or kick w/e. For me is the claw cus is the first frame of the knee replaced by a claw.
So I wanna make so it shoots the projectile I want (its sprite number is 4808)

This post has been edited by Zaxtor: 29 October 2011 - 05:58 PM

0

#703

It's very hard for me to understand what you need.
But if you want to change what projectile the weapon of your choice shoots, this is the place http://wiki.eduke32....efined_gamevars
WEAPONx_SHOOTS controls what projectile the weapon shoots.
0

User is offline   Zaxtor 

#704

I think i'll drop it and try to do it for a projectile shooting weap instead.
Since is easier than a non projectile weap

This post has been edited by Zaxtor: 30 October 2011 - 10:48 AM

0

User is offline   Jblade 

#705

How do I make a real random number at the start of the level, or as close to it as possible? I'm looking to make a 1/4 chance of rain starting every time you start a level but of course Duke's random number generator gives the same results at start up. I've also tried using the system clock but I can't seem to get a good result. Any ideas?
0

User is offline   CruX 

#706

View PostJames, on 04 November 2011 - 02:13 AM, said:

How do I make a real random number at the start of the level, or as close to it as possible? I'm looking to make a 1/4 chance of rain starting every time you start a level but of course Duke's random number generator gives the same results at start up. I've also tried using the system clock but I can't seem to get a good result. Any ideas?


Well, one rather jerry-rigged way I just threw together is to make your own 'counter' type of variable that you add onto in EVENT_GAME, then randomize the variable that would determine the chance of rain when that counter gets to a particular value.


gamevar timer 0 0
gamevar RANDOMSKYVAR -1 0 // initialize this to -1 so it won't be constantly randomized in EVENT_GAME. Also I was experimenting by changing sky textures, though I was checking the number with a digitalnumberz command...

onevent EVENT_GAME

ifvarl timer 7500 {
addvar timer 1 } else { setvar timer 7500 } // add onto the 'timer' var till it's at 7500 (roughly the first five seconds of gameplay)

ifvare timer 7500 { 
ifvarn RANDOMSKYVAR -1 break else { randvar RANDOMSKYVAR 3 } } // randomize the variable when the 'timer' var's at 7500 ONLY if it's -1....

endevent

onevent EVENT_RESETPLAYER
setvar timer 0
setvar RANDOMSKYVAR -1
endevent



Like I said, it's kinda shotty, not thoroughly tested, and I'm imagining the variables used would have to be totally unique from everything else, but it produces a different number on a pretty static basis relatively close to the loadup time.
0

#707

randvar gamevar 3. This creates a random number from 0 to 3 which is 4 numbers. Now you can use what emericaskator told you at the start of the level, or you can use this. http://wiki.eduke32....wiki/Player_par

And 7500 is not 5 seconds. That's 250 seconds if theres 30 addvar timer 1 pr sec. Or are you doing something i don't understand?

This post has been edited by rasmus thorup: 04 November 2011 - 07:20 AM

0

User is online   Danukem 

  • Duke Plus Developer

#708

I'm not going to explain what is wrong with the last two replies, but I have a solution. I had this problem with Attrition, where the monsters were supposed to be randomized at level start, but they always turned out the same on the first level due to the random number seed starting the same every time.


gamevar randomstart 7 0
gamevar DONE 0 0

onevent EVENT_LOADACTOR

ifvare DONE NO
{
     readgamevar randomstart
     addvar randomstart 1
     andvar randomstart 65535
     setvarvar temp randomstart
     xorvar temp 43690
     whilevarn temp 0
     {
     ifrnd 1 { }
     subvar temp 1
     }
     savegamevar randomstart
     setvar DONE YES
}
endevent


The idea is you save your own number that changes each time someone starts a game, and that number effects the randomizer. I also put other stuff in the if DONE==0 block of code, basically anything that needs to happen exactly once before the map loads.

While randomstart will change each time, I think there will still be a pattern it follows, unless you set DONE back to 0 at some point after map load and then have that code run with each level load (which is what I do). Another thing you can do is, when you read randomize, if it is 0 (meaning you are running with fresh cfg files) then set it to the clock time. Reading a gamevar that is not in the cfg sets it to 0, so actually there was no point in initializing randomstart to 7...but the code still works.
2

User is offline   CruX 

#709

View Postrasmus thorup, on 04 November 2011 - 07:12 AM, said:

Now you can use what emericaskator told you at the start of the level, or you can use this. http://wiki.eduke32....wiki/Player_par
And 7500 is not 5 seconds. That's 250 seconds if theres 30 addvar timer 1 pr sec. Or are you doing something i don't understand?


It would be 250 seconds if it was being counted in tics, but it's not. EVENT_GAME is run per tic, but the 'timer' variable is being added at a faster rate, such that 7500 = 4-5 seconds. The entire reason the timer is needed is because a variable can't be randomized at the EXACT start of the level; you'll get the same number every time (use randvar in something like EVENT_RESETPLAYER, then check that variable with digitalnumberz and you'll see what I mean...)
0

#710

aw. i just tried it. That's pretty sad. I need to go through all my codes -.- It's probably just something with the ingame watch, and i don't think i have made a randvar command yet at a decided time.
0

#711

Why did I stary playing with CON code again? What I am trying to do is move the game camera to a fixed location, I would like to make something that behaved like the demo cameras, but I'm clueless on that for now, so all I'm trying to do is make a single fixed camera work. I used digitalnumberz to see if the location was being set, but I can't seem to make the camera move to that position, this is what I wrote, obviously it's wrong. I'm wondering if anyone knows the variables I am supposed to set?

actor FIXIECAM // Tile 555 for now, I'll move it later
ifcanseetarget
 {
	getactor[THISACTOR].ang CAMA
	getactor[THISACTOR].x CAMX
	getactor[THISACTOR].y CAMY
	getactor[THISACTOR].z CAMZ
 }
 enda

onevent EVENT_DISPLAYREST
setvarvar camerax CAMX
setvarvar cameray CAMY
setvarvar cameraz CAMZ
setvarvar cameraang CAMA
// digitalnumber 2930 64 6 CAMA 0 0 16 windowx1 windowy1 windowx2 windowy2
// digitalnumber 2930 64 16 CAMX 0 0 16 windowx1 windowy1 windowx2 windowy2
// digitalnumber 2930 64 26 CAMY 0 0 16 windowx1 windowy1 windowx2 windowy2
// digitalnumber 2930 64 36 CAMZ 0 0 16 windowx1 windowy1 windowx2 windowy2
//  32768
endevent

0

User is offline   Jblade 

#712

Thanks Dan, I'll try that out ASAP :D
0

User is online   Danukem 

  • Duke Plus Developer

#713

@Hightreason: For starters, you are using the wrong event. Try this one: http://wiki.eduke32....NT_DISPLAYROOMS
1

#714

D'oh, yes, using EVENT_DISPLAYROOMS does make sense, don't know why I decided on displayrest :D

With that problem solved I should be able to finish it on my own now as it seems to be working now that I've changed to displayrooms, I've added a couple more features now, using AI (faceplayerslow) to make the camera face the player, though I will have to devise a way to make the camera look up and down, I know how to make it do this, it's just getting my math right to get the correct angle, shouldn't be too hard. I'm also going to add some kind of delay before switching camera.

In case anyone is interested, this is how it currently looks.


This post has been edited by High Treason: 07 November 2011 - 04:53 PM

0

#715

That's look pretty cool. Remember not to spam too many 3d models.
0

#716

I hate having to use this thread, but can anybody explain why when I activate my player-following camera with a hitag it does not work (A static one does) yet it does work if I activate it with distance?

// Following camera
useractor notenemy FOLLCAM 1
getactor[THISACTOR].hitag camtag2
cstat 32768

// ifvarvare camtag camtag2 // This does not work unless I remove the "move" command, but I use a different actor for that. camtag is the hitag of the camera activator sprite.
ifpdistl 15361 // This is the only way I can get cameras that use "move" to operate, not ideal.
 {
// These vars are later used in event_displayrooms, they set the camerax, cameray etc...
	getactor[THISACTOR].ang CAMA
	getactor[THISACTOR].x CAMX
	getactor[THISACTOR].y CAMY
	getactor[THISACTOR].z CAMZ
	getactor[THISACTOR].xvel CAMH
 }

ifmove 0 {
		move FOLLMOVE faceplayerslow
	 }
enda


I hate being a noob at this, I think I'm learning, I've managed to get several other things right (well, working...) at the first attempt now. I guess it's possible that the engine simply doesn't want me to do something like this.

Thanks for any help, as usual, I don't expect this to be re-written for me, just point me in the right direction and I'll experiment until I get it right, I'm just at a dead-end with it right now.
0

#717

Oh, maybe i found the answer. For many user defined actors and sprites the only way to access properly to lotags and hitags is storing them into other variables during map loading with the command " eventloadactor " or within the event " EVENT_LOADACTOR "

So you should make something like this:
( declare HITAGSAVED or whatever you want as a per-actor variable)

eventloadactor FOLLCAM
getactor[THISACTOR].hitag HITAGSAVED
setactor[THISACTOR].hitag 0
enda

Then use directly when needed " ifvarvare camtag HITAGSAVED" in the FOLLCAM actor.
I hope this can solve the problem.

This post has been edited by RichardStorm: 14 November 2011 - 04:24 PM

2

#718

Yes, yes, yes, that's been bugging me for days. That has indeed solved it and the AI cameras now function as intended (until I break something again)...

Now I know it's possible to operate actors with AI using variables (I was beginning to think it wasn't) my head is filling with ideas, robots, remote controlled cars and all manner of things I will probably never do. :D
0

User is offline   Micky C 

  • Honored Donor

#719

I'm having trouble getting music to work for my episode in WGRealms 2. I followed the wiki's instructions as best I could, but the music just isn't playing.

This is how my episode is defined in the con file, and it works as expected:


definevolumename 4 Micky's Revenge (WIP)


definelevelname 4 0 wgmicky1.map 03:00 00:52 The Shire
definelevelname 4 1 wgmicky2.map 02:30 01:19 Turn of the Tide







And this is how I defined the music:
music 4 wgmicky1.ogg wgmicky2.ogg


Is there anything painfully obvious as to why it's not working?
0

User is online   Danukem 

  • Duke Plus Developer

#720

View PostMicky C, on 15 November 2011 - 04:25 PM, said:

Is there anything painfully obvious as to why it's not working?



Yup. You should be using music 5, not music 4. Music 0 == title screen, music 1 == episode 1, etc.
1

Share this topic:


  • 120 Pages +
  • « First
  • 22
  • 23
  • 24
  • 25
  • 26
  • 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