EDuke32 Scripting "CON coding help"
#31 Posted 16 June 2009 - 11:08 AM
I'll check my jumping code, I remember coding something to limit the jump of the player...
#32 Posted 25 June 2009 - 08:09 AM
/* 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
#33 Posted 25 June 2009 - 08:12 AM
#34 Posted 25 June 2009 - 10:43 AM
#35 Posted 25 June 2009 - 02:51 PM
#36 Posted 26 June 2009 - 12:47 AM
Quote
I saw this below the reply box, right under the text "Attachments". Is this a joke ? D:
#37 Posted 26 June 2009 - 07:16 AM
XThX2, on Jun 26 2009, 01:47 AM, said:
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)
#38 Posted 28 June 2009 - 06:19 AM
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
#39 Posted 28 June 2009 - 07:51 AM
#40 Posted 28 June 2009 - 10:38 AM
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
#41 Posted 28 June 2009 - 10:58 AM
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 ?
#42 Posted 29 June 2009 - 07:14 PM
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
#43 Posted 30 June 2009 - 09:06 AM
#44 Posted 30 June 2009 - 09:50 AM
MIKE SIMS, on Jun 30 2009, 10:06 AM, said:
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.
#45 Posted 30 June 2009 - 12:05 PM
Quote
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
#46 Posted 30 June 2009 - 12:21 PM
Chip, on Jun 30 2009, 12:05 PM, said:
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 !
#47 Posted 30 June 2009 - 03:48 PM
#48 Posted 30 June 2009 - 04:12 PM
Captain Awesome, on Jun 30 2009, 04:48 PM, said:
Take away the NOENEMYHITS flag. That makes it bounce off of all sprites.
#49 Posted 30 June 2009 - 04:24 PM
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?
#50 Posted 30 June 2009 - 04:34 PM
Captain Awesome, on Jun 30 2009, 05:24 PM, said:
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.
#52 Posted 01 July 2009 - 03:38 PM
#53 Posted 03 July 2009 - 08:26 AM
#54 Posted 03 July 2009 - 08:56 AM
XThX2, on Jul 3 2009, 09:26 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.
This post has been edited by DeeperThought: 03 July 2009 - 08:58 AM
#55 Posted 03 July 2009 - 09:03 AM
DeeperThought, on Jul 3 2009, 08:56 AM, said:
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)
#56 Posted 03 July 2009 - 09:06 AM
XThX2, on Jul 3 2009, 10:03 AM, said:
You have a monster or projectile that needs more than 255 clipdist?
#57 Posted 03 July 2009 - 09:06 AM
DeeperThought, on Jul 3 2009, 09:06 AM, said:
Soon to have
#59 Posted 04 July 2009 - 02:56 AM
Quote
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.
#60 Posted 04 July 2009 - 08:17 AM
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.
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