![]() |
#2 | |||
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Quote:
Quote:
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
||||
![]() |
![]() |
#3 | ||
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
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:
The "runspeed" of the player structure might be what you're looking for. See also Members_of_the_player_structure. |
|||
![]() |
![]() |
#4 |
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?
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#5 |
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. |
|
![]() |
![]() |
#6 |
Re: EDuke32 Scripting (CON coding) Part 2
The other thread was closed, so I'll just say thanks to DeeperThought and Dr. Kylstien here
![]() |
|
![]() |
![]() |
#7 |
Re: EDuke32 Scripting (CON coding) Part 2
The thread is dead! Long live the thread!
|
|
![]() |
![]() |
#8 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#9 | |
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
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. |
||
![]() |
![]() |
#10 |
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?
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#11 |
Re: EDuke32 Scripting (CON coding) Part 2
It includes every sound being played in the game.
|
|
![]() |
![]() |
#12 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#13 |
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. |
|
![]() |
![]() |
#14 |
Re: EDuke32 Scripting (CON coding) Part 2
No, it's every sound in the game.
|
|
![]() |
![]() |
#15 |
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
![]()
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#16 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-05-2008 at 09:30 AM.
|
|
![]() |
![]() |
#17 |
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
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#18 |
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. |
|
![]() |
![]() |
#19 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#20 |
![]()
There is no command quotevar. Instead, check out the player structure ftq which you may set the quote with a gamevar.
__________________
BRAINS... |
|
![]() |
![]() |
#21 |
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
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-11-2008 at 10:06 AM.
|
|
![]() |
![]() |
#22 |
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... |
|
![]() |
![]() |
#23 |
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
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-11-2008 at 11:00 AM.
|
|
![]() |
![]() |
#24 |
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... |
|
![]() |
![]() |
#25 |
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 ![]()
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#26 |
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. |
|
![]() |
![]() |
#27 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#28 |
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... |
|
![]() |
![]() |
#29 |
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
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#30 |
Re: EDuke32 Scripting (CON coding) Part 2
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. |
|
![]() |
![]() |
#31 |
Re: EDuke32 Scripting (CON coding) Part 2
No, it's not that simple I didn't leave it blank :P
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#32 |
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. |
|
![]() |
![]() |
#33 |
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 Also, would you mind if I borrow your NOVA projectile from DNWMD with credit in my mod?
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-11-2008 at 01:14 PM.
|
|
![]() |
![]() |
#34 |
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
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#35 |
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.
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-11-2008 at 03:10 PM.
|
|
![]() |
![]() |
#36 |
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; 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.
|
|
![]() |
![]() |
#37 |
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.
|
|
![]() |
![]() |
#38 |
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?
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod. |
|
![]() |
![]() |
#39 |
Re: EDuke32 Scripting (CON coding) Part 2
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. |
|
![]() |
![]() |
#40 |
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
__________________
---HELLDUKE TC--- NEW STABLE MIRROR SECONDARY MIRROR ---GAMEPLAY VIDEO--- Gameplay Footage of my Mod.
Last edited by XTHX2; 07-12-2008 at 02:35 PM.
|
|
![]() |
Bookmarks |
|
|