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

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

  • 72 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   XThX2 

  • 19

#31

It was something about my new weapon replacing the tripbombs... Strange, such two different things doing that.

I'll check my jumping code, I remember coding something to limit the jump of the player...
0

User is offline   XThX2 

  • 19

#32

I'm still having the issue I mentioned earlier, and I checked every bit of my code to see if it had anything related to jumping_counter, and only found this; which can't be the issue. Eitherway, I commented it out and the bug was still there. Any other ideas to solve this out?

/*
getplayer[THISACTOR].jumping_counter TEMP
ifvare TEMP 650
{
setplayer[THISACTOR].jumping_counter ZERO
}
*/


This post has been edited by XThX2: 25 June 2009 - 08:10 AM

0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#33

Look for anywhere in the code you are setting posz or poszv, or where the player is spawning stuff.
0

User is offline   XThX2 

  • 19

#34

I've checked, commented out anywhere I found posz or poszv (commented the whole code block I mean) and still it is there. Pretty annoying, got no clue why that happens yet.
0

User is offline   Jimmy 

  • Duke4 Thot Patrol
  • 3,850

#35

Quakis was telling me he had a similar bug in Eduke32 a while ago when he tried playing with no .art files present at all. He was too lazy to post about it. Probably unrelated but still interesting.
0

User is offline   XThX2 

  • 19

#36

Sorry, it's much worse than that apparently... If nothing else works, I'll try to use the old backup I had and insert the new code to it. (Which is going to be painful...)

Quote

Oh no, the server is melting! IT BURNS, IT BURNS, OH GOD IT BURNS!


I saw this below the reply box, right under the text "Attachments". Is this a joke ? D:
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#37

View PostXThX2, on Jun 26 2009, 01:47 AM, said:

Sorry, it's much worse than that apparently... If nothing else works, I'll try to use the old backup I had and insert the new code to it. (Which is going to be painful...)


The player flying up to the sky is a fairly simple, isolated problem and it shouldn't be very difficult to debug, especially if it's happening every time.

Here's a few basic debugging procedures that you should have done already:

*verify whether it happens in a single room map with no sprites (this will tell you, for example, whether it is some other sprite setting the player sprites z coordinate)

*display the values of posz and poszv on the screen or print them to the log

*comment out or otherwise disable EVENT_GAME, and then other events until you find the one responsible (if none, then you know the problem is in actor code)
0

User is offline   Chip 

  • 21

#38

I'm trying to make an actor reduce the player's health with a melee attack - and no, I can't just use "addphealth -%".
The attack damage is worked out by a formular which makes the attack damage higher depending on the actor's level. The actor also has access to multiple attacks but that's not really relevent.

After my formular is done, an actor at level 1 witch has an attack stat of 12 should do 4 damage to the player. That number is currently being held in a gamevar, how can I get that gamevar taken away from the player's HP? This value is also a positive value so I need to use subvar to take it away but I don't know what I'm meant to take it away since I can't edit the .extra for players.



*edit*

I've thought of a way but I would still prefere a different method.
Mine would be seomthing like this:
ifvarg TEMP 0 { addphealth -1 subvar TEMP 1 }
and then think of a way to have that loop till my attack value is empty.

Like I said, I would still prefere a better method, a more instant and direct reduction.

This post has been edited by Chip: 28 June 2009 - 06:40 AM

0

User is online   Jblade 

  • 1,415

#39

Have you tried getting the player being attacked's ID in the monster code, than setting their .htextra to the damage number you want to do? (so instead of addphealth -10 you'd have setplayer[THISACTOR].htextra DAMAGEVAR or something similar )
0

User is offline   Chip 

  • 21

#40

I could never get htextra to work right but I may just stick with what I posted above.
My main concern with that was it would take too long for large damage amounts to be applies - in one test the player was killed outright but it took like 5 seconds for the HP to run all the way down. I solved that by making it take off 100s till there were no 100s left then it'll move onto 50s, then 10s then finally 1s. It still takes like nearly a second to knock down the HP but I kindof like seeing it rub down through numbers instead of instantly applied.

This post has been edited by Chip: 28 June 2009 - 11:19 AM

0

User is offline   XThX2 

  • 19

#41

extra_extra8

There's this thing which could be useful to you, though I couldn't figure out how to use it properly. Does anyone know how to use it?

Apart from that, how would you get player's ID from the monster? I know it has to do with the player structure member "i" but how, hitscans from monster ?
0

User is offline   Dr. Kylstein 

  • 8

#42

If I recall correctly:
getplayer[THISACTOR].i temp
getactor[temp].extra temp2
subvarvar temp2 damage
setactor[temp].extra temp2

getplayer[THISACTOR] for actors besides APLAYER refers to the nearest player, just like addphealth does. "extra" means health/strength for most actors. James's method has advantages, but is more complicated--I can't remember all the necessary details.

P.S.: Do you know about whilevarn? If you ever do need a loop.

This post has been edited by Dr. Kylstein: 29 June 2009 - 07:17 PM

0

User is offline   MIKE SIMS 

  • 0

#43

I want an "overlay" to appear on the screen when the night vision goggles are in use, I have a sprite to cover the whole screen to add "effect" to the nightvision goggles when they are powered on, any help?
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#44

View PostMIKE SIMS, on Jun 30 2009, 10:06 AM, said:

I want an "overlay" to appear on the screen when the night vision goggles are in use, I have a sprite to cover the whole screen to add "effect" to the nightvision goggles when they are powered on, any help?


onevent EVENT_DISPLAYREST

ifvare player[THISACTOR].heat_on YES
  rotatesprite xcoord ycoord size rotation tilenumber shade color orientation 0 0 xdim ydim

endevent


Look up rotatesprite in the EDuke32 wiki to understand this better. Replace the names I put in there (such as "tilenumber") either with numbers or your own variables. Good luck.
0

User is offline   Chip 

  • 21

#45

Quote

If I recall correctly:
getplayer[THISACTOR].i temp
getactor[temp].extra temp2
subvarvar temp2 damage
setactor[temp].extra temp2

getplayer[THISACTOR] for actors besides APLAYER refers to the nearest player, just like addphealth does. "extra" means health/strength for most actors. James's method has advantages, but is more complicated--I can't remember all the necessary details.


Ahh, obtaining and altering the player's HP through the actor sructure - that's cunning!
But if that works then why can't we just have the .extra command on the player structure as well and alter it directly through that?

This post has been edited by Chip: 30 June 2009 - 12:08 PM

0

User is offline   XThX2 

  • 19

#46

View PostChip, on Jun 30 2009, 12:05 PM, said:

Ahh, obtaining and altering the player's HP through the actor sructure - that's cunning!
But if that works then why can't we just have the .extra command on the player structure as well and alter it directly through that?


Then coding wouldn't be fun ! :D
0

User is offline   Jimmy 

  • Duke4 Thot Patrol
  • 3,850

#47

Is there anyway to stop a projectile with flags of 6274 (RPG, NOENEMYHITS, LOSESVELOCITY, and NOAIM) from bouncing off of actors? I'm trying to finish up my gibs by coding the blood. The gibs bounce off stuff, which is natural, but of course blood shouldn't. Alternative ideas are also welcome.
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#48

View PostCaptain Awesome, on Jun 30 2009, 04:48 PM, said:

Is there anyway to stop a projectile with flags of 6274 (RPG, NOENEMYHITS, LOSESVELOCITY, and NOAIM) from bouncing off of actors? I'm trying to finish up my gibs by coding the blood. The gibs bounce off stuff, which is natural, but of course blood shouldn't. Alternative ideas are also welcome.


Take away the NOENEMYHITS flag. That makes it bounce off of all sprites.
0

User is offline   Jimmy 

  • Duke4 Thot Patrol
  • 3,850

#49

I thought maybe it wouldn't work quite right but that's actually pretty much perfect. D'oh.

Another tidbit I'm having trouble figuring out. The blood flies through the air, and when it hits something it spawns a bloodsplat. This looks good when it hits the ground, rather natural and the like. I can't figure out how to setup so that when it hits a wall, instead of spawning a bloodsplat it shoots BLOODSPLAT# along the walls. I can't really figure it out. There is no ifnearactor equivalent for walls, as far as I know. Any ideas?
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#50

View PostCaptain Awesome, on Jun 30 2009, 05:24 PM, said:

I thought maybe it wouldn't work quite right but that's actually pretty much perfect. D'oh.

Another tidbit I'm having trouble figuring out. The blood flies through the air, and when it hits something it spawns a bloodsplat. This looks good when it hits the ground, rather natural and the like. I can't figure out how to setup so that when it hits a wall, instead of spawning a bloodsplat it shoots BLOODSPLAT# along the walls. I can't really figure it out. There is no ifnearactor equivalent for walls, as far as I know. Any ideas?


First, do not set the projectile to spawn anything (set spawns to -1)

onevent EVENT_KILLIT

ifactor MYBLOODPROJECTILE
{
  getactor[THISACTOR].htmovflag TEMP
  ifvarn TEMP 0 // this means it hit SOMETHING, maybe a wall, maybe a sprite
	  state random_wall_jibs // if there's a wall nearby, it will splatter the wall
  else iffloordistl 8
	  spawn MYBLOODSPLAT // if it didn't hit something and it's near the floor, spawn the floor splat
  setvar RETURN 0
}
endevent


I just typed this and didn't test it.
0

User is offline   Jimmy 

  • Duke4 Thot Patrol
  • 3,850

#51

No dice. =(
0

User is offline   Jimmy 

  • Duke4 Thot Patrol
  • 3,850

#52

Thanks, DT. I've figured it out. For future reference, the angle wouldn't let the hitscan register I don't think. I had to subtract 960 from the angle to get it to work.
0

User is offline   XThX2 

  • 19

#53

What are the ways to increase the clipdist of a projectile other than defining it in the defineprojectile part? In my case, one of the monsters shoots fireballs at the player, but they don't hit him, and just go through. I've increased the clipdist to 160 but nothing happens... (The projectile isn't even that big at all, it's a png, so I used the setuptile command to buff it's size up, maybe that's the problem. But, it's size is meant to be big) Any advice?
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#54

View PostXThX2, on Jul 3 2009, 09:26 AM, said:

What are the ways to increase the clipdist of a projectile other than defining it in the defineprojectile part? In my case, one of the monsters shoots fireballs at the player, but they don't hit him, and just go through. I've increased the clipdist to 160 but nothing happens... (The projectile isn't even that big at all, it's a png, so I used the setuptile command to buff it's size up, maybe that's the problem. But, it's size is meant to be big) Any advice?


The problem isn't clipdist. The problem is that the dimensions of the tile that you have defined as the projectile are too large. I know it sounds strange, but trust me, there is an engine bug which makes large projectiles not hit the player. I've had to deal with it many times and it sucks. If you are using setuptile or dummytile, keep the dimensions down to like 16x16 to be safe. It's fine to use sizeat (or scale in the case of a model) to make it bigger in game, but the tile dimensions must be small.


This post has been edited by DeeperThought: 03 July 2009 - 08:58 AM

0

User is offline   XThX2 

  • 19

#55

View PostDeeperThought, on Jul 3 2009, 08:56 AM, said:

The problem isn't clipdist. The problem is that the dimensions of the tile that you have defined as the projectile are too large. I know it sounds strange, but trust me, there is an engine bug which makes large projectiles not hit the player. I've had to deal with it many times and it sucks. If you are using setuptile or dummytile, keep the dimensions down to like 16x16 to be safe. It's fine to use sizeat (or scale in the case of a model) to make it bigger in game, but the tile dimensions must be small.


Oh didn't know that. Thanks for response.

Eitherway, I think the maximum clipdist value must be increased. (In case of a very very big projectile, or a monster)
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#56

View PostXThX2, on Jul 3 2009, 10:03 AM, said:

Eitherway, I think the maximum clipdist value must be increased. (In case of a very very big projectile, or a monster)


You have a monster or projectile that needs more than 255 clipdist? :D
0

User is offline   XThX2 

  • 19

#57

View PostDeeperThought, on Jul 3 2009, 09:06 AM, said:

You have a monster or projectile that needs more than 255 clipdist? :D


Soon to have :D
0

User is offline   Trooper Dan 

  • Duke Plus Developer
  • 2,241

#58

This is like using an instant messenger.
0

User is offline   XThX2 

  • 19

#59

Quote

Tribomb control
3 xpos
4 ypos
5 laser/tribomb angle
6 1: delay, 3:armed
7 Activate tribomb when T7 reach 0


This is from the "htg_t" article. How do you use htg_t for tripbomb control? I replaced it with a grenade launcher and when I fire, player halts for a very small second and then continues to move. I thought this could be from 1:Delay and would be fixed if I had turned it to 3:armed.
0

User is offline   Chip 

  • 21

#60

I'm having great difficulty in trying to do something simple.
I want a projectile to obtain the ID of who spawned it then have the projectile change its stats (damage / speed / size etc...) from collected gamevars from the spawner.

Firstly I can't seem to be able to make it know who spawned it and used a stupid method of findnearactor as a temp measure.
Secondly I can't get the projectile to change its stats, they are always the same. I.E: "setthisprojectile[THISACTOR].extra 50" does 2 damage which is what the projectile was defined at. Basically I don't appear to be able to override the default values allready defined.


I thought this was going to be easy and the thing I did this morning would be hard but it turned out to be the complete opposite for both. :D
Oh and I tried all my adjustments through event_egs. If I'm not meant to do it through there then how do I get my actor to obtain the ID of the projectile that it spawned?

This post has been edited by Chip: 04 July 2009 - 08:35 AM

0

Share this topic:


  • 72 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Yes, our forum uses cookies. © 2017 Voidpoint, LLC

Enter your sign in name and password


Sign in options