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-17-2008, 08:12 AM   #41
M210

M210's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
How it is possible to make the player above and to avoid here such bags?
__________________
M210 Projects - My personal site
M210 is offline  
Old 07-17-2008, 08:16 AM   #42
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by M210 View Post
How it is possible to make the player above and to avoid here such BUGS?
I don't know what do you mean, can you be more specific?
XTHX2 is offline  
Old 07-17-2008, 08:37 AM   #43
M210

M210's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
here such BUGS?
yeah, sorry

The bug consists that the chamber of the player is outside a map (outside of a ceiling) since size APLAYER actually is less. When Duke goes on narrow ventilating mine, in a standard case, the chamber does not come for limits of walls. But I wish to make Duke a little above, for this purpose it is necessary to lift the chamber which subsequently comes for limits of walls
__________________
M210 Projects - My personal site
M210 is offline  
Old 07-17-2008, 08:39 AM   #44
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
You mean the elevator bug which happens when you jump while elevator is moving?
XTHX2 is offline  
Old 07-17-2008, 08:51 AM   #45
M210

M210's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
No, not absolutely... Give is better shall make as follows type at itself this code:
Code:
onevent EVENT_DISPLAYROOMS
addvar cameraz -6000
endevent
after you will start eDuke, find a room with a low ceiling and jump up... You will see a bug, i.e. the chamber of the player will appear outside of a room
__________________
M210 Projects - My personal site
M210 is offline  
Old 07-17-2008, 08:56 AM   #46
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Ahh I see now. Well I got no ideas on how to fix it though. You should wait for people who are better than me to reply you for a suggestion and such.
XTHX2 is offline  
Old 07-17-2008, 09:03 AM   #47
M210

M210's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Ok, we'll wait
__________________
M210 Projects - My personal site
M210 is offline  
Old 07-17-2008, 11:15 AM   #48
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I made a solution to that about three months ago for the other Blood project. It was posted in the part 1 scripting thread. Basically you have to make sure you aren't moving the camera up past the ceiling.
__________________
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-17-2008, 11:20 AM   #49
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
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
Sorry for posting again, but since this post went past, I felt like posting it again here.
Last edited by XTHX2; 07-17-2008 at 03:10 PM. Reason: Fix...
XTHX2 is offline  
Old 07-17-2008, 11:44 AM   #50
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
1. The hittable area of a monster is determined by the tile it is defined on. So, for example, if the monster is in a crouching position on its defined tile, it will have that short hittable area even if it is using a standing animation. This is why, in Duke Plus, when the pigcops go into their diving action, I actually have them cactor into PIGCOPDIVE, a different actor that runs the same code. That way the shots correctly miss them if you aim above them, unlike in regular cons where the pigcops have the same hittable area regardless of their animation. So look carefully at the starting tile and its dimensions.

2. Quick and dirty: Reverse their xvel at the moment they are hit. Better: check their htang and use movesprite.

3. Variables are case sensitive. hitag is not the same var as HITAG.
__________________
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-17-2008, 11:52 AM   #51
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Oh I see that capped hitag. Thank you very much for reply. Now I know what xvel is for but I'll use the other method. So you want me to get the angle and make it go back with the same angle I had from htang. Got it.

About #1, the unit is actually at it's very normal state. It's an useractor and I can only shoot at the middle of it with rockets or any other projectile other than hitscan. If I try to rocket at it's leg or something, it just goes through it. It doesn't happen to any other Duke Nukem's OWN ACTORS though. I didn't get what I should do with dimensions either. (Can the problem be caused by sizeat? Because I'm using it for it.)
XTHX2 is offline  
Old 07-17-2008, 12:01 PM   #52
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
If I try to rocket at it's leg or something, it just goes through it. It doesn't happen to any other Duke Nukem's OWN ACTORS though. I didn't get what I should do with dimensions either. (Can the problem be caused by sizeat? Because I'm using it for it.)
Is it a model? You have to look at the 8-bit tile in game first, then make the scale of the model match it. And by the way, that does happen with some of the original actors, just not as bad.
__________________
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-17-2008, 12:04 PM   #53
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
No, it's just straight bmp.

If it happens with some actors, then sad me lol

"movesprite ACTORID XVEL YVEL ZVEL CLIPMASK RETURNVAR"

What is clipmask and returnvar? Something like Cstat and something spawned during the command?
Last edited by XTHX2; 07-17-2008 at 12:44 PM.
XTHX2 is offline  
Old 07-17-2008, 03:26 PM   #54
M210

M210's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by DeeperThought View Post
I made a solution to that about three months ago for the other Blood project. It was posted in the part 1 scripting thread. Basically you have to make sure you aren't moving the camera up past the ceiling.
Can you find it for me? Please
__________________
M210 Projects - My personal site
M210 is offline  
Old 07-18-2008, 01:18 PM   #55
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
"movesprite ACTORID XVEL YVEL ZVEL CLIPMASK RETURNVAR"

What is clipmask and returnvar? Something like Cstat and something spawned during the command?
Code:
I did this for LIZTROOP

ifhitweapon
{
ifwasweapon RPG
{
getactor[THISACTOR].htang angle
getplayer[THISACTOR].i ID
// movesprite ID xvel yvel zvel CLIPMASK RETURNVAR
Though I don't know what are those clipmask and returnvar are. I also wonder what is zvel for.

Apart from all those, is there any command to refer to "picking player?". For example, a player has picked up an item and I want to refer to that player like "getplayer[PICKINGPLAYER].i ID" etc.
to make things compatible with multiplayer.
Last edited by XTHX2; 07-19-2008 at 05:01 AM.
XTHX2 is offline  
Old 07-19-2008, 09:58 AM   #56
dcxboxfreak

dcxboxfreak's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I had a little question for you con coders. The background of the menu is darker than normal, if you know what I mean. Even if you bright up your (highres) picture, it's still too dark. Is there a way in con code to put the normal brightness back for the background of the menu. Thank you really much for helping me out.
dcxboxfreak is offline  
Old 07-19-2008, 10:01 AM   #57
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I think it's more like your monitor though. It depends on how good your monitor is. I might be wrong but I certainly think that it doesn't need any con coding.
XTHX2 is offline  
Old 07-19-2008, 10:37 AM   #58
dcxboxfreak

dcxboxfreak's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
I think it's more like your monitor though. It depends on how good your monitor is. I might be wrong but I certainly think that it doesn't need any con coding.
The eduke32 port is doing that, if I remember correctly I wasnt in the past (like in jonof's port,) but I could be wrong to. My monitor is fine. All other things in the menu like the title and the font are correct, but if there is a way to bright up the backgroud, i would be glad if someone can help me
dcxboxfreak is offline  
Old 07-19-2008, 10:38 AM   #59
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Well, sadly, I couldn't find any command to increase the brightness of any texture nor sprite so, you'll probably have to do it the harder way. Image editing!
XTHX2 is offline  
Old 07-19-2008, 11:47 AM   #60
dcxboxfreak

dcxboxfreak's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Well, sadly, I couldn't find any command to increase the brightness of any texture nor sprite so, you'll probably have to do it the harder way. Image editing!
Erm, I already said that I did that but that doesnt work. Oh, well if there isnt any way, than I can live with it
dcxboxfreak is offline  
Old 07-21-2008, 04:51 AM   #61
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Code:
I did this for LIZTROOP
 
ifhitweapon
{
ifwasweapon RPG
{
getactor[THISACTOR].htang angle
getplayer[THISACTOR].i ID
// movesprite ID xvel yvel zvel CLIPMASK RETURNVAR
Though I don't know what are those clipmask and returnvar are. I also wonder what is zvel for.

Apart from all those, is there any command to refer to "picking player?". For example, a player has picked up an item and I want to refer to that player to make things compatible with multiplayer.
Uh sorry again but you know, nobody noticed and 3 days have passed so, here, I'm posting again. Any answers are pretty much appreciated.

I also got one more question. It seems that I can't resize the original actors of the game by using these;

Code:
 
eventloadactor PIGCOP
setactor[THISACTOR].xrepeat 45
setactor[THISACTOR].yrepeat 45
enda
XTHX2 is offline  
Old 07-21-2008, 10:14 AM   #62
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Uh sorry again but you know, nobody noticed and 3 days have passed so, here, I'm posting again. Any answers are pretty much appreciated.

I also got one more question. It seems that I can't resize the original actors of the game by using these;

Code:
 
eventloadactor PIGCOP
setactor[THISACTOR].xrepeat 45
setactor[THISACTOR].yrepeat 45
enda
I didn't answer because it would take a whole tutorial. All I can say is look at how movesprite is used in released mods and keep in mind that htang is the angle that the actor was hit from.

The original monsters are hardcoded to be properly sized when the game starts. You have to resize them after that.
__________________
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-21-2008, 10:20 AM   #63
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Like your Duke Plus eh? ^_^ Well, I'll check it out to find out then. Thanks for replying. About the monsters, can I use Event_EGS to do the same? Or again, no?
XTHX2 is offline  
Old 07-21-2008, 10:24 AM   #64
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
Like your Duke Plus eh? ^_^ Well, I'll check it out to find out then. Thanks for replying. About the monsters, can I use Event_EGS to do the same? Or again, no?
EGS is the event for when a sprite is spawned. Changing size there might work on respawns, but it won't affect the monsters that are already in the map when it starts. You could use EVENT_GAME, but make sure you only set the size once.
__________________
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-21-2008, 12:31 PM   #65
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Nevermind, I've managed to solve it at last. Thank you very much DT. Now, I've been coding myself a new enemy from scratch, had inspiration from your codes DT;
Code:
eventloadactor CHAINGUNNER
 cstat 257
 setactor[THISACTOR].xrepeat 65
 setactor[THISACTOR].yrepeat 65
 getactor[THISACTOR].extra extra
 getactor[THISACTOR].hitag hitag
 setactor[THISACTOR].extra 0
 setactor[THISACTOR].hitag 0
enda

action ACMDSTAND     0
action ACMDWALKING     0   4  5  1  18
action ACMDSHOOTING    20  2  5  1  6
action ACMDFLINTCH  30  1  1  1  6
action ACMDDYING     30  9  1  1  15
action ACMDLYINGDEAD   39  1

move CMDWALKVEL 96
move CMDSTOP

ai AICMDGETENEMY ACMDWALKING CMDWALKVEL seekplayer
ai AICMDSHOOTENEMY ACMDSHOOTING CMDSTOP faceplayer
ai AICMDDYING ACMDDYING CMDSTOP faceplayer
ai AICMDFLINTCH ACMDFLINTCH CMDSTOP faceplayer

state cmddead

strength 0
ifhitweapon
{
	ifwasweapon RADIUSEXPLOSION
	{
		state standard_jibs
  		killit
	}
}

ends

state cmdhit
 ifdead
 {
 addkills 1
 ai AICMDDYING
 ifrnd 96
 sound PIGDY3
 else
 ifrnd 64
 sound PIGDY4
 else
 sound PIGDY2
 }
 else
 {
 ifrnd 96 { ai AICMDFLINTCH }
 sound PRED_PAIN
 ifwasweapon RPG setactor[THISACTOR].xvel -512
 ifwasweapon RADIUSEXPLOSION setactor[THISACTOR].xvel -512
 }
ends

useractor enemy CHAINGUNNER CMDSTRENGTH
  fall
  sizeat 65 65

  ifai 0
  {
  cstat 257
  ifcansee
  {
   sound  PIG_RECOG
  }
  }

  ifaction 0
  {
   ai AICMDGETENEMY
  }
  
  ifaction ACMDLYINGDEAD { state cmddead break }
  else
  ifai AICMDDYING
  {
  ifactioncount 9
  {
  action ACMDLYINGDEAD
  cstat 0
  }
  }

  ifai AICMDGETENEMY { ifcansee { ifcanshoottarget { ifrnd 36 { ai AICMDSHOOTENEMY resetactioncount } } else ifpdistl 8192 ai AICMDSHOOTENEMY } }

  ifai AICMDSHOOTENEMY
  {
  ifcanshoottarget
  {
  ifactioncount 2
  {
  sound CAPT_ATTACK
  shoot RIFLESHELL
  shoot RIFLESHELL
  flash
  resetactioncount
  }
  else
  ifrnd 36
  ai AICMDGETENEMY
  }
  }

  ifai AICMDFLINTCH { ifactioncount 2 { ai AICMDSHOOTENEMY } }

 ifhitweapon state cmdhit

enda
Basically, he should shoot you right? But, he doesn't want to shoot you sometimes, for example, when player takes cover or just normal situations!(like, he attacks but nothing is being shot) He plays shooting animation but actually he doesn't shoot anything. Any suggestions?
Last edited by XTHX2; 07-22-2008 at 03:39 AM. Reason: New Problem...
XTHX2 is offline  
Old 07-24-2008, 09:03 AM   #66
LipSheZ

LipSheZ's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by DeeperThought View Post
EGS is the event for when a sprite is spawned.
A small question - what EVENT_SPAWN does, then?
__________________
All Unreal single player addons - visit us!
And join the new Unreal addon-developing group!
Download "nostalgic sound patch" with Unreal I sounds for Unreal Tournament 99 (OldSkool-mod required)!
Totalduke.narod.ru - restored famous Russian Duke3d Website!
LipSheZ is offline  
Old 07-24-2008, 09:44 AM   #67
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by LipSheZ View Post
A small question - what EVENT_SPAWN does, then?
I've never used it, but I've always guessed that it was like EGS lite. Maybe it happens only when a spawn command is used? EDIT: Disregard, Hunter_Rus answered.
__________________
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-24-2008, 09:44 AM   #68
Hunter_rus

Hunter_rus's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
EVENT_EGS: the actor is just got its ID.
EVENT_SPAWN: the actor is initialized according to its picnum.
Hunter_rus is offline  
Old 07-24-2008, 10:45 AM   #69
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Well, I've been thinking about my problem, did many things but still nothing. I've been trying to fix it for days but I keep failing for some reason. Can anybody help me on that?

EDIT : I solved it... Case closed. Now, I got a new problem but it's more like a question.
Code:
ifhitweapon
{ ifwasweapon RPG ifspritepal 3 { addstrength RPG_WEAPON_STRENGTH } }
Basically, it should give the actor who had taken damage from a RPG to make it take no damage from it. But, appearently, it adds it after the damage is taken thus, causing the unit to die. How can I make it so that it will take no damage when get hit by RPG?

Hmm, I should also ask you guys as I just got this in mind before I forget. Useractors seem to stay where they have been put. I mean, most of the time, they don't want to leave the sector they have been put. They just act like stayput actors and sit... Not like they even try to get into the walls...
Last edited by XTHX2; 07-25-2008 at 08:58 AM.
XTHX2 is offline  
Old 07-26-2008, 04:01 PM   #70
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Nevermind the above issue, I've managed to overcome it as well. But this one is confusing me now;
Code:
define DEVILSTR 650
define DEVILSCRATCH -12

eventloadactor DEVIL
 cstat 257
 setactor[THISACTOR].xrepeat 65
 setactor[THISACTOR].yrepeat 65
 getactor[THISACTOR].hitag hitag
 getactor[THISACTOR].extra extra
 setactor[THISACTOR].hitag 0
 setactor[THISACTOR].extra 0
enda

action ADEVWALK 0  4  5  1  16
action ADEVSHOOT 20  3  5  1  19
action ADEVSHOOT2 35  3  5  1  19
action ADEVPAIN 50  1  1  1  8
action ADEVDIE  50  5  1  1  16
action ADEVDEAD 55 1 

move DEVWALKVEL 96
move DEVSTOP

ai AIDEVWALK ADEVWALK DEVWALKVEL seekplayer
ai AIDEVSHOOT ADEVSHOOT DEVSTOP faceplayerslow
ai AIDEVSHOOT2 ADEVSHOOT2 DEVSTOP faceplayerslow
ai AIDEVDYING ADEVDIE DEVSTOP faceplayer
ai AIDEVPAIN ADEVPAIN DEVSTOP faceplayer

state devdead

strength 0
ifhitweapon
{
	ifwasweapon RADIUSEXPLOSION
	{
		state standard_jibs
  		killit
	}
}

ends

state devhit
 ifdead
 {
 addkills 1
 ai AIDEVDYING
 ifrnd 128 sound DEVIL_DIE else sound DEVIL_DIE2
 }
 else
 {
 ifrnd 64 { ai AIDEVPAIN  sound DEVIL_PAIN }
 ifwasweapon RPG setactor[THISACTOR].xvel -512
 ifwasweapon RADIUSEXPLOSION setactor[THISACTOR].xvel -512
 }
ends

useractor enemy DEVIL DEVILSTR
  fall
  sizeat 65 65

  ifai 0
  {
  cstat 257
  ifcansee
  {
  soundonce DEVIL_SEE cstat 257
  }
  }

  ifaction 0
  {
   ai AIDEVWALK
  }
  
  ifaction ADEVDEAD { state devdead break }
  else
  ifai AIDEVDYING
  {
  ifactioncount 5
  {
  action ADEVDEAD
  cstat 0
  }
  }

  ifai AIDEVWALK { ifcansee { ifcanshoottarget { ifrnd 36 { ai AIDEVSHOOT resetactioncount } } } }

  ifpdistl 1592 ifp palive ifcansee { ai AIDEVSHOOT2 }

  ifai AIDEVSHOOT
  {
  ifactioncount 3
  {
  sound PRED_ATTACK
  shoot SERPENTBALL
  resetactioncount
  }
  else
  ifcount 30
  {
  ai AIDEVWALK
  }
  }

  ifai AIDEVSHOOT2
  {
  ifactioncount 3
  {
  ifpdistl 1592
  addphealth DEVILSCRATCH
  sound CLAW
  palfrom 16 16
  resetactioncount
  }
  else
  ifcount 30
  {
  ai AIDEVWALK
  }
  }

  ifai AIDEVPAIN { ifactioncount 3 { ai AIDEVSHOOT } }

 ifhitweapon state devhit

enda

useractor enemystayput DEVILSTAYPUT DEVILSTR
 fall 
 cactor DEVIL
enda
The monster here should be ripping the player into pieces when the player's distance is less than 1592. But it seems that this monster can't do anything if the player is in a distance less that 1592... Anyone know why? It's just stuck when the player is in that distance. However, if the player goes further away, it starts to scratch the player when he is further away lol -.-
XTHX2 is offline  
Old 07-26-2008, 04:59 PM   #71
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
When the player is in that range, your code constantly resets the AI to the scratching AI. That causes the counters to reset, freezing the monster in place. When you step away, the AI is allowed to play out.
__________________
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-26-2008, 05:10 PM   #72
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
constantly
What can I do to prevent it from "constantly" resetting the counters? I'm thinking on making it a state and will try it right now; I'll post whether if it works or not...
XTHX2 is offline  
Old 07-26-2008, 05:25 PM   #73
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Quote:
Originally Posted by XTHX2 View Post
What can I do to prevent it from "constantly" resetting the counters? I'm thinking on making it a state and will try it right now; I'll post whether if it works or not...
Make it go to that AI only when it is in a different AI. A simple method would be:

ifai AIBITEPLAYER nullop else ifpdistl 1560 ai AIBITEPLAYER

Get the idea?
__________________
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-26-2008, 05:27 PM   #74
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
So, that will prevent it from going over and over to the same AI while it is already at that AI. Thanks for the idea, it's a pretty smart one. Also, for the states, that caused too many bugs and I would probably have to do state for every single AI to prevent bugs which is something I don't want to. Thanks a lot again

Quote:
ifai AIDEVWALK { ifcansee { ifcanshoottarget { ifrnd 24 { ai AIDEVSHOOT resetactioncount } } } }

ifai AIDEVSHOOT
{
ifactioncount 3
{
sound PRED_ATTACK
shoot SERPENTBALL
resetactioncount
}
else
ifcount 30
{
ai AIDEVWALK
}
}

ifai AIDEVSHOOT2 nullop else ifpdistl 1592 ai AIDEVSHOOT2

ifai AIDEVSHOOT2
{
ifactioncount 3
{
ai AIDEVSHOOT2
addphealth DEVILSCRATCH
sound CLAW
palfrom 16 16
resetactioncount
ifpdistg 1592 ai AIDEVWALK
}
}

ifai AIDEVPAIN { ifactioncount 2 { ai AIDEVSHOOT } }

ifhitweapon state devhit

enda

useractor enemystayput DEVILSTAYPUT DEVILSTR
fall
cactor DEVIL
enda
That's what I've done with it. But know, it has problems about exiting the scratching AI... It keeps scratching even if the player is away. I'm sure it's about where I've put the code but...

EDIT : I've done some small changes and it seems to work.
Last edited by XTHX2; 07-27-2008 at 02:13 AM.
XTHX2 is offline  
Old 07-26-2008, 05:45 PM   #75
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
There is nothing in your block of code for AIDEVSHOOT2 which could change the monster to a different AI. You should add something like "ifpdistg 1560 ai AIDEVWALK" right under the line that says "resetactioncount".

EDIT: I see you changed it but my suggestion is better. Also it's still pretty messed up because the player will take damage regardless of how far away he is when the actual scratching occurs.
__________________
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-26-2008, 05:45 PM   #76
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Yeah, my last second edit shows that I've done changes. Well, I think I'll stick with your advice, however

EDIT: Yeah, your's is better I just noticed that bug at my current test... Thanks a lot it works perfectly now!
Last edited by XTHX2; 07-26-2008 at 05:49 PM.
XTHX2 is offline  
Old 07-27-2008, 02:18 AM   #77
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Hmm I just noticed a bug. If I get in scratch range while it is dying, it cancels dying animation. I was thinking about setting it's ai to dying ai while it was dying but it didn't help, it was repeating it's death animation. Any suggestions?

I've also been trying to make an enemy get no damage at a certain state but it seems that if the actor dies (That's what I think) during the state, it becomes invulnerable and never dies again. Here's the code;
Code:
state checklizhit
  spawn BLOOD
  ifai AILIZSHRUNK
  {
    sound SQUISHED
    state standard_jibs
    killit
  }
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      sound SQUISHED
      state standard_jibs
      killit
    }

    state spawn_extra
    state operation

    state drop_chaingun

    ifwasweapon GROWSPARK
    {
      sound SQUISHED
      state standard_jibs
      spawn BURNING2
      killit
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    else
    {
      state rf
      ai AILIZDYING
      ifrnd 64
        spawn BLOODPOOL
    }
    sound CAPT_DYING
  }
  else
  {
    ifaction ALIZSHOOTING ifwasweapon SHOTGUN sound PISTOL_RICOCHET else ifwasweapon SHOTSPARK1 sound PISTOL_RICOCHET
    else
    sound CAPT_PAIN
/*
    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AILIZSHRUNK
      break
    }
*/
    ifwasweapon GROWSPARK
      sound EXPANDERHIT

    state random_wall_jibs
    ifp palive
      ifcansee
        ifcanshoottarget
    {
      ai AILIZSHOOTENEMY
      break
    }
  }
ends


state lizshootstate
  ifcount 20
    ifrnd 8
  {
    ifcansee
      ifpdistl 2048
    {
      ifrnd 128
        ai AILIZFLEENEMY
      break
    }
    ifrnd 80
      ai AILIZTHINK
    else
      ai AILIZGETENEMY
  }
  ifactioncount 2
  {
    ifcansee
    {
      ifcanshoottarget
      {
   ifspritepal 0 { sound CAPT_ATTACK shoot RIFLESHELL resetactioncount }
    else
      ifspritepal 21 { sound PRED_ATTACK shoot FIREBALL resetactioncount }
      else
       ifspritepal 20 { sound PIG_ATTACK shoot SHOTGUN resetactioncount }
      else
       ifspritepal 4 { sound PISTOL_FIRE shoot SHOTSPARK1 shoot SHOTSPARK1 resetactioncount }
      else
       ifspritepal 5 { sound REDPROJSHT shoot REDPROJ resetactioncount }
      }
      else
        ai AILIZCHARGEENEMY
    }
    else
      ai AILIZGETENEMY
  }

  ifhitweapon { ifaction ALIZSHOOTING { getactor[THISACTOR].htextra DMG getactor [THISACTOR].htextra TEMP setvar DMG -1 } else setvarvar DMG TEMP }

ends
Last edited by XTHX2; 07-27-2008 at 05:32 AM.
XTHX2 is offline  
Old 07-27-2008, 10:45 AM   #78
DeeperThought

DeeperThought's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
I don't feel like looking at the code, but I'm guessing it's because you have it change to the scratching AI when the player is close, and this of course cancels the dying animation. If it's in the dying animation, it should break from the code before it checks for scratching, etc.
__________________
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-27-2008, 10:50 AM   #79
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
The above code wasn't the code of that actor, that was for the 2nd problem. Well, that's what I was thinking but I couldn't think of a way to do that. I was going to make it check if it's dying at the idea you've posted before but the one you said seems more logical. But I'll put a break at where it's dying as you said. Thanks.

EDIT : I've managed to solve it! I can never pay you back DeeperThought. What I've done was;

Code:
ifaction ADEVDEAD { state devdead break }
else
ifaction ADEVDYING // Starting from here is the edit!
{
state devdying
break
}
And it works now. Thanks for your neverending supports DeeperThought.
Last edited by XTHX2; 07-27-2008 at 11:06 AM.
XTHX2 is offline  
Old 07-29-2008, 04:59 AM   #80
XTHX2

XTHX2's Avatar
Re: EDuke32 Scripting (CON coding) Part 2
Hmm, I don't really know why but my useractors don't want to leave where they are put. A good example of it would be this code;
Code:
eventloadactor CHAINGUNNER
 cstat 257
 setactor[THISACTOR].xrepeat 61
 setactor[THISACTOR].yrepeat 61
 getactor[THISACTOR].extra extra
 getactor[THISACTOR].hitag hitag
 setactor[THISACTOR].extra 0
 setactor[THISACTOR].hitag 0
enda

action ACMDWALKING     0   4  5  1  18
action ACMDSHOOTING    20  2  5  1  6
action ACMDFLINTCH  30  1  1  1  6
action ACMDDYING     30  9  1  1  15
action ACMDLYINGDEAD   39  1

move CMDWALKVEL 96
move CMDSTOP

ai AICMDGETENEMY ACMDWALKING CMDWALKVEL seekplayer
ai AICMDSHOOTENEMY ACMDSHOOTING CMDSTOP faceplayer
ai AICMDDYING ACMDDYING CMDSTOP faceplayer
ai AICMDFLINTCH ACMDFLINTCH CMDSTOP faceplayer

state cmddead

strength 0
ifhitweapon
{
	ifwasweapon RADIUSEXPLOSION
	{
		state standard_jibs
  		killit
	}
}

ends

state cmdhit
 ifdead
 {
 addkills 1
 ai AICMDDYING
 sound CMDDEATH
 spawn CHAINGUNSPRITE
 }
 else
 {
 spawn BLOOD
 ifrnd 160 { ai AICMDFLINTCH  sound CMDPAIN }
 ifwasweapon RPG setactor[THISACTOR].xvel -768
 ifwasweapon RADIUSEXPLOSION setactor[THISACTOR].xvel -768
 }
ends

useractor enemy CHAINGUNNER CMDSTRENGTH
  fall
  sizeat 61 61
  state checksquished

  ifai 0
  {
  cstat 257
  ifcansee
  {
   sound CMDSEE
  }
  }

  ifaction 0
  {
   ai AICMDGETENEMY
  }
  
  ifaction ACMDLYINGDEAD { state cmddead break }
  else
  ifai AICMDDYING
  {
  ifactioncount 9
  {
  action ACMDLYINGDEAD
  cstat 0
  }
  }

  ifai AICMDGETENEMY { ifcansee { ifcanshoottarget { ifrnd 48 { ai AICMDSHOOTENEMY resetactioncount } } } }

  ifai AICMDSHOOTENEMY
  {
  ifactioncount 2
  {
  sound DEM_ATTACK
  shoot RIFLESHELL
  shoot RIFLESHELL
  flash
  resetactioncount
  ifpdistg 9216 ai AICMDGETENEMY
  }
  else
  ifcount 40
  ai AICMDGETENEMY
  }

  ifai AICMDFLINTCH { ifactioncount 2 { ai AICMDSHOOTENEMY } }

 ifhitweapon state cmdhit

enda

useractor enemystayput CHAINGUNNERSTAYPUT CMDSTRENGTH
 fall
 sizeat 61 61
 state checksquished
 cactor CHAINGUNNER
enda
I don't really know why but he just sits and shoots at player and only chases player if the player is at the sector that the enemy was put at. Any ideas about why this is happening? (It's not just that piece of code, but most of my useractors, and no, I didn't use the stayput variation of that enemy...)
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:18 PM.

Page generated in 0.14388990 seconds (100.00% PHP - 0% MySQL) with 17 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.