Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Duke Nukem > Duke Nukem 3D Modifications
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 07-01-2008, 04:13 AM   #1
ADM

ADM's Avatar
EDuke32 Scripting (CON coding) Part 2
Thread repost since the other one is getting too large.
ADM is offline  
Old 07-01-2008, 05:12 AM   #2
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
onevent EVENT_USENIGHTVISION
switch HEATUSE
case 0
inittimer 60
break
case 1
inittimer 120
break
endswitch
endevent
Quote:
onevent EVENT_ENTERLEVEL
inittimer 120
endevent
Since the other thread was closed, I C&P'ed my post here.

Quote:
XTHX2:
I've came up with this. What I'm trying to do is to make heat sensors slow the time by half of the game's actual time was. But I got a strange bug which is if you leave heat sensor open and if it expires, you are stuck and it's always slow! Also can I slow anything else but not player? I think I may have to edit every single speed variable of player the longer way... Thanks for reading anyway. Actually, I have tons of things to ask but everything has a time isn't it?
XTHX2 is offline  
Old 07-01-2008, 06:03 AM   #3
Hunter_rus

Hunter_rus's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2
But I got a strange bug which is if you leave heat sensor open and if it expires, you are stuck and it's always slow!
You have to check amount of NVG in the player actor(usually APLAYER).
Don't worry that the "inittimer 120" command is being executed every frame: it doesn't have any bad effects. Though every time the speed is actually changed some animation might be reset.
Code:
actor APLAYER
  getplayer[THISACTOR].heat_amount tmp 
  ifvare tmp 0
  {
     inittimer 120
  }
  ...
Quote:
Originally Posted by XTHX2
I think I may have to edit every single speed variable of player the longer way...
Yes, you'll have to.
The "runspeed" of the player structure might be what you're looking for. See also Members_of_the_player_structure.
Hunter_rus is offline  
Old 07-01-2008, 06:56 AM   #4
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
If I change the runspeed of the player, will this also effect the jump speed at all? Or crouch speed?
XTHX2 is offline  
Old 07-01-2008, 07:04 AM   #5
Hunter_rus

Hunter_rus's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
You need to alter other values as well.
Jump: http://wiki.eduke32.com/wiki/Jumping_counter

Some CON-coders have had experience with changing Duke's characteristics so they may know more about it.
Hunter_rus is offline  
Old 07-01-2008, 12:58 PM   #6
Jblade

Jblade's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
The other thread was closed, so I'll just say thanks to DeeperThought and Dr. Kylstien here
Jblade is offline  
Old 07-01-2008, 10:29 PM   #7
Usurper

Usurper's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
The thread is dead! Long live the thread!
__________________
Meadhall of the Comitatus | RTCM
Usurper is offline  
Old 07-02-2008, 10:50 AM   #8
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Is there anyway for me to slow the sound's play rate when slow the game time? Because they don't seem to get affected from the speed decrease.
XTHX2 is offline  
Old 07-02-2008, 11:21 AM   #9
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Is there anyway for me to slow the sound's play rate when slow the game time? Because they don't seem to get affected from the speed decrease.
setplayer[THISACTOR].sound_pitch -1024

Don't forget to set it back to 0 when normal speed is resumed.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-02-2008, 04:54 PM   #10
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Does this include every sound that actor uses? I mean like if I use it with player, will it apply to weapon sounds too?
XTHX2 is offline  
Old 07-04-2008, 01:15 PM   #11
Jblade

Jblade's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
It includes every sound being played in the game.
Jblade is offline  
Old 07-04-2008, 02:11 PM   #12
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
No it's only for player as it picks the player. I was asking is it for every sound that player uses. Like his jump sound, weapon sounds, pain sounds etc.
XTHX2 is offline  
Old 07-04-2008, 04:43 PM   #13
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Protip: When someone gives you one line of code that you can easily test yourself, you should just go ahead and test it instead posting questions and assumptions about it that you could have resolved within minutes in-game.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-04-2008, 04:55 PM   #14
TerminX

TerminX's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
No it's only for player as it picks the player. I was asking is it for every sound that player uses. Like his jump sound, weapon sounds, pain sounds etc.
No, it's every sound in the game.
TerminX is offline  
Old 07-04-2008, 05:05 PM   #15
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Ok. I tried and saw that it worked. Sorry for being lazy and <amateur> as you would call it that way
XTHX2 is offline  
Old 07-05-2008, 09:24 AM   #16
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
How can I change the speed of jump by using jumping_counter? And, What's the real value for runspeed? I need it because I'll set it back at somewhere.
Last edited by XTHX2; 07-05-2008 at 09:30 AM.
XTHX2 is offline  
Old 07-10-2008, 03:42 PM   #17
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Ignore my above posts... Sorry for triple posting but I can't see the edit button so...

Code:
eventloadactor QUOTER
 cstat 32768
enda

useractor notenemy QUOTER
  getactor[THISACTOR].hitag HITAG
  getactor[THISACTOR].lotag LOTAG
  setactor[THISACTOR].hitag 0
  setactor[THISACTOR].lotag 0
  
  ifpdistl 1688
   {
     quotevar LOTAG
     soundoncevar HITAG
     killit
   }
   
  ifvare LOTAG 0
   {
    killit
   }

  ifvare HITAG 0
   {
    soundonce BLANK
   }

enda
I have made this simple thing and I want to ask how can I make it print the quote which is the LOTAG of the actor?
XTHX2 is offline  
Old 07-10-2008, 04:16 PM   #18
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
You need to move the get/set tag code to the eventloadactor. If you put that code in the regular actor part it kind of defeats the purpose. Also, beware of killing the actor before the sound is done playing, because that can cut the sound short.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-11-2008, 02:07 AM   #19
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Ok I'm killing it at the very end of the code but I still have a problem though. It says there's nothing like quotevar and whenever I try to use quote command, it says LOTAG is undefined. I don't know what I'm doing, I checked the whole edukewiki but couldn't find a command which I could use for.
XTHX2 is offline  
Old 07-11-2008, 09:32 AM   #20
dood!

dood!'s Avatar
Keen Gun Re: EDuke32 Scripting (CON coding) Part 2
There is no command quotevar. Instead, check out the player structure ftq which you may set the quote with a gamevar.
__________________
BRAINS...
dood! is offline  
Old 07-11-2008, 09:48 AM   #21
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Code:
eventloadactor QUOTER
 cstat 32768
 getactor[THISACTOR].hitag HITAG
 getactor[THISACTOR].lotag LOTAG
 getactor[THISACTOR].extra EXTRA
 getplayer[THISACTOR].ftq LOTAG
 getplayer[THISACTOR].fta EXTRA
 setactor[THISACTOR].hitag 0
 setactor[THISACTOR].lotag 0
 setactor[THISACTOR].extra 0
enda

useractor notenemy QUOTER
  
  ifpdistl 1688
   {
     quote LOTAG
     soundoncevar HITAG
     killit
   }
   
  ifvare LOTAG 0
   {
    killit
   }

  ifvare HITAG 0
   {
    soundonce BLANK
   }

enda
So that was what I was trying to do but still nothing happens..
Last edited by XTHX2; 07-11-2008 at 10:06 AM.
XTHX2 is offline  
Old 07-11-2008, 10:55 AM   #22
dood!

dood!'s Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Uhh, you're supposed to set (not get) the player's ftq, and that should be placed in the actor's code, not inside eventloadactor.

From what I understand, you are trying to display a quote and play a sound when a player approaches this actor, correct?
__________________
BRAINS...
dood! is offline  
Old 07-11-2008, 10:56 AM   #23
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Yeah and both of them depends on the lotag and hitag values of the actor. I tried set instead of get but didn't work. Now I'll try to put them in the actor as you said.

Code:
eventloadactor QUOTER
 cstat 32768
 getactor[THISACTOR].hitag HITAG
 getactor[THISACTOR].lotag LOTAG
 getactor[THISACTOR].extra EXTRA
 setactor[THISACTOR].hitag 0
 setactor[THISACTOR].lotag 0
 setactor[THISACTOR].extra 0
enda

useractor notenemy QUOTER
 setplayer[THISACTOR].ftq LOTAG
 setplayer[THISACTOR].fta EXTRA
  
  ifpdistl 1688
   {
     quote LOTAG
     soundoncevar HITAG
     killit
   }
   
  ifvare LOTAG 0
   {
    killit
   }

  ifvare HITAG 0
   {
    soundonce BLANK
   }

enda
And I still get the error, " Parameter LOTAG is undefined. " and I defined it in a different con as a gamevar...
Last edited by XTHX2; 07-11-2008 at 11:00 AM.
XTHX2 is offline  
Old 07-11-2008, 11:04 AM   #24
dood!

dood!'s Avatar
Re: EDuke32 Scripting (CON coding) Part 2
That's because the command quote will not accept a gamevar. Remove "quote LOTAG" and move the fta and ftq where that was.
__________________
BRAINS...
dood! is offline  
Old 07-11-2008, 11:16 AM   #25
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Code:
eventloadactor QUOTER
 cstat 32768
 getactor[THISACTOR].hitag HITAG
 getactor[THISACTOR].lotag LOTAG
 getactor[THISACTOR].extra EXTRA
 setactor[THISACTOR].hitag 0
 setactor[THISACTOR].lotag 0
 setactor[THISACTOR].extra 0
enda

useractor notenemy QUOTER
  
  ifpdistl 1688
   {
     setplayer[THISACTOR].ftq LOTAG
     setplayer[THISACTOR].fta EXTRA
     soundoncevar HITAG
   }
   
  ifvare LOTAG 0
   {
    killit
   }

  ifvare HITAG 0
   {
    soundonce BLANK
   }

enda
Nothing happens... What's wrong?
XTHX2 is offline  
Old 07-11-2008, 11:39 AM   #26
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
What did you set extra to on the quoter sprite?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-11-2008, 11:46 AM   #27
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
fta is duration of ftq where ftq is the quote, as wiki said. At least that's what I got from what it said.
XTHX2 is offline  
Old 07-11-2008, 11:53 AM   #28
dood!

dood!'s Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Looking at the wiki, LOTAG and HITAG (all caps) are pre-defined gamevars marked as read-only. I suggest you write the gamevars in small case (hitag, lotag, extra).

I also suggest you comment out "cstat 32768" so that the actor is visible while you continue to debug it, then put it back in when everything is in working order.
__________________
BRAINS...
dood! is offline  
Old 07-11-2008, 12:08 PM   #29
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Code:
eventloadactor QUOTER
// cstat 32768
 getactor[THISACTOR].hitag hitag
 getactor[THISACTOR].lotag lotag
 getactor[THISACTOR].extra extra
// setactor[THISACTOR].hitag 0
// setactor[THISACTOR].lotag 0
// setactor[THISACTOR].extra 0
enda

useractor notenemy QUOTER 0
  
  ifpdistl 1688
   {
     setplayer[THISACTOR].ftq lotag
     setplayer[THISACTOR].fta extra
     soundoncevar HITAG
   }
   
//  ifvare lotag 0
//   {
//    killit
//   }

  ifvare hitag 0
   {
    soundonce BLANK
   }

enda
This is what I've done and still nothing. Oh and I can't see the sprite in-game either..... Tile number is 14 if it matters..
XTHX2 is offline  
Old 07-11-2008, 12:13 PM   #30
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Tile number is 14 if it matters..
If you left tile 14 blank then it would matter a lot.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-11-2008, 12:14 PM   #31
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
No, it's not that simple I didn't leave it blank :P
XTHX2 is offline  
Old 07-11-2008, 12:30 PM   #32
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
You shouldn't have commented out those lines in eventloadactor where it sets the tags to 0 after getting them into vars. Nonzero tags can cause hardcoded behavior, including making sprites disappear.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-11-2008, 01:04 PM   #33
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Thank you for your advices. Now it's working. I just removed those lines and know it works! Now, I'm trying something else. I'm trying to make RESPAWN actor spawn actors with pal depending on the RESPAWN's pal. But now I have a problem. I did this simple thing.

Code:
eventloadactor RESPAWN
 getactor[THISACTOR].pal pal
enda
But I don't know how to refer to the sprite that will be spawned by respawn. What should I do?

Also, would you mind if I borrow your NOVA projectile from DNWMD with credit in my mod?
Last edited by XTHX2; 07-11-2008 at 01:14 PM.
XTHX2 is offline  
Old 07-11-2008, 03:04 PM   #34
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Why do I get this error:

SetGameVarID(): invalid sprite (-1) for per-actor gamevar target from sprite 560 (2630), player 0

when a battlelord uses this code:

Code:
eshoot MORTER
setactorvar[RETURN].target target
It would seem that RETURN is not being set when eshooting a MORTER. Why?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-11-2008, 03:05 PM   #35
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I think it has to do something with mortar itself... Don't know much about it.. I also couldn't find a member called "target" at edukewiki either. That maybe your problem too.
Last edited by XTHX2; 07-11-2008 at 03:10 PM.
XTHX2 is offline  
Old 07-11-2008, 03:24 PM   #36
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I guess the RETURN thing doesn't matter because I can get the same information when the MORTER spawns. I found the part in the source code where the velocities get set based on the player. I should be able to translate that into CON code and then override the hardcoded velocities using the non-player target information.

But there's this bit at the end of the code that I don't undertand:

Code:
case MORTER__STATIC:
            if (s->extra >= 0) s->shade = -96;
            j = g_player[findplayer(s,&x)].ps->i;
            x = ldist(&sprite[j],s);
            zvel = -x>>1;
            if (zvel < -4096)
                zvel = -2048;
            vel = x>>4;
            if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9];
            EGS(sect,
                sx+(sintable[(512+sa+512)&2047]>>8),
                sy+(sintable[(sa+512)&2047]>>8),
                sz+(6<<8),atwith,-64,32,32,sa,vel,zvel,i,1);
            break;
What is going on in that yellow part? It looks like it's spawning something and then setting coordinates on it.

I'm using this now and it seems to work fine without translating that bit at the end:

Code:
case MORTER
  getactor[THISACTOR].owner spriteid
  ifvarn spriteid -1
  getactorvar[spriteid].target target
  ifvarn target -1
  {
	  ldist xydist THISACTOR target
	  setvarvar zvel xydist
	  shiftvarr zvel 1
	  mulvar zvel -1
	  ifvarl zvel -4096 setvar zvel -4096
	  setactor[THISACTOR].zvel zvel
	  shiftvarr xydist 4
	  setactor[THISACTOR].xvel xydist
  }
  break
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
Last edited by DeeperThought; 07-11-2008 at 03:56 PM.
DeeperThought is offline  
Old 07-11-2008, 04:03 PM   #37
TerminX

TerminX's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
The temp_data[9] bit is so zshoot works with it, and the EGS bit is for actually spawning the damn thing.
TerminX is offline  
Old 07-12-2008, 02:10 AM   #38
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
ifvarl zvel -4096 setvar zvel -4096

if (zvel < -4096)
zvel = -2048

Don't you think the setvar zvel -4096 should be -2048?
XTHX2 is offline  
Old 07-12-2008, 02:48 AM   #39
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
ifvarl zvel -4096 setvar zvel -4096

if (zvel < -4096)
zvel = -2048

Don't you think the setvar zvel -4096 should be -2048?
That would be like the original but I couldn't understand why they did it that way. I mean, if the point is to limit zvel to -2048, then it should read if (zvel < -2048) zvel = -2048. But the way they wrote it, the limit doesn't kick in until -4096, then it cuts the zvel down to -2048. So you actually could have -3072, for example.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-12-2008, 02:58 AM   #40
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Oh I see now. Nice thing you've done then.

I got a question. How can I increase a monsters hittable area? I mean for example I shoot a rocket at a custom enemy and it goes through it but hits him when I shoot at some other places of him. How can I increase it? Also how can I make monsters go back instead of front, when got hit by rockets, like you did at dukeplus? (Only thing I need is tips, I want to do the rest..)

And, can someone say why does this code always play KICKHIT sound even if the hitag is something different?
Code:
eventloadactor QUOTER
 cstat 32768
 getactor[THISACTOR].hitag hitag
 getactor[THISACTOR].lotag lotag
 getactor[THISACTOR].extra extra
 setactor[THISACTOR].hitag 0
 setactor[THISACTOR].lotag 0
 setactor[THISACTOR].extra 0
enda

action IDLE 0 1 1 1

useractor notenemy QUOTER 0 IDLE
  
  ifpdistl 1688
   {
     soundvar HITAG
     setplayer[THISACTOR].ftq lotag
     setplayer[THISACTOR].fta extra
     killit
   }
   
  ifvare lotag 0
   {
    killit
   }

enda
Last edited by XTHX2; 07-12-2008 at 02:35 PM.
XTHX2 is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:54 PM.

Page generated in 0.14071107 seconds (100.00% PHP - 0% MySQL) with 19 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.