EDuke32 Scripting "CON coding help"
#61 Posted 04 July 2009 - 08:29 AM
#62 Posted 04 July 2009 - 08:36 AM
getactor[RETURN].owner TEMPby using the eshoot command. The owner will give you the ID of the sprite which spawned it, so you can refer to the owner like
getactor[TEMP].bla blablaor anything like that.
To your second issue, I had the same problem too, couldn't figure out anything simple for that though. I ended up adding extra damage in actor code of every monster if got hit by that special projectile. (Refer to Dr. Kylstein or James' solution they gave you for adding up damage)
#63 Posted 04 July 2009 - 08:41 AM
Captain Awesome, on Jul 4 2009, 05:29 PM, said:
I didn't think the actor structure stuff works on projectiles hense why they had their own member structures but that has sovled part 1 of my problem.
Part 2 is having the projectile change its stats but if the actor member structure worked above then I guess I can use that here too?
I'm just going to do some testing now.
#64 Posted 04 July 2009 - 08:46 AM
So basically the getactor stuff worked better on projectiles then the getthisprojectile stuff.
setactor[THISACTOR].extra 50 worked in over riding the damage and now that I can have it obtain the spawner's ID I can therefore make changing damage amounts based on the actor using it (despite being the same actor sprite - this is my leveling system at work again)
Quote
That may come in handy later on.
Thanks guys.
This post has been edited by Chip: 04 July 2009 - 08:49 AM
#65 Posted 04 July 2009 - 09:37 AM
Chip, on Jul 4 2009, 09:46 AM, said:
Yeah, I have also noticed that get/set thisprojectile doesn't always work. That is to be expected if you are dealing with one of the old projectiles like RPG, but IIRC it is a problem with custom projectiles as well.
#66 Posted 04 July 2009 - 09:47 AM
Quote
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.
DT, have you experienced with this before?
This post has been edited by XThX2: 04 July 2009 - 09:47 AM
#67 Posted 04 July 2009 - 10:14 AM
XThX2, on Jul 4 2009, 10:47 AM, said:
DT, have you experienced with this before?
I can happily report that I've never messed with that stuff before, thereby getting me off the hook.
#68 Posted 05 July 2009 - 04:37 AM
#69 Posted 05 July 2009 - 04:46 AM
This post has been edited by Spiker: 05 July 2009 - 04:46 AM
#70 Posted 05 July 2009 - 04:54 AM
x = How many frames should be skipped from the actor's define number.
y = Amount of frames.
z = Amount of angles.
t = I think this takes either 1 or -1 which are normal and inverse.
e = Action Time.
#71 Posted 05 July 2009 - 06:27 AM
XThX2, on Jul 5 2009, 01:37 PM, said:
The max sound limit's 2560.
#72 Posted 05 July 2009 - 09:47 AM
James, on Jul 5 2009, 10:27 AM, said:
And if you pass that number, you're a pretentious dick.
#73 Posted 05 July 2009 - 03:52 PM
DeeperThought, on Jun 30 2009, 10:50 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.
hmmm no luck I tried different variables countless times... what would be the demensions & coordinates if I wanted to just display a sprite dead center in the screen during HEAT_ON?
#74 Posted 06 July 2009 - 02:47 AM
Line 885, getactor: tried to get picnum on invalid target sprite (-16382) from spr 29 pic 1979 gv TEMP Line 885, getactor: tried to get picnum on invalid target sprite (-16382) from spr 28 pic 1979 gv TEMP
getactor[THISACTOR].htmovflag TEMP ifvarn TEMP 0 { addvar TEMP 16384 getactor[TEMP].picnum temp ifvarn temp UFORSAKEN ifvarn temp APLAYER setactorvar[THISACTOR].w_return 1 }
This code prints the messages at top of my post. Why does it do that? (Walls?)
This post has been edited by XThX2: 06 July 2009 - 02:48 AM
#75 Posted 06 July 2009 - 08:20 AM
This post has been edited by DeeperThought: 06 July 2009 - 08:20 AM
#76 Posted 06 July 2009 - 08:45 AM
getactor[THISACTOR].cstat cst ifvarand cst 1 { xorvar cst 1 setactor[THISACTOR].cstat cst }
This post has been edited by XThX2: 06 July 2009 - 08:45 AM
#77 Posted 06 July 2009 - 08:50 AM
XThX2, on Jul 6 2009, 09:45 AM, said:
getactor[THISACTOR].cstat cst ifvarand cst 1 { xorvar cst 1 setactor[THISACTOR].cstat cst }
That's the wrong cstat bit. The one you want is 256. Other than changing cstat on the sprites, I don't know how you could prevent a projectile from hitting them.
#78 Posted 06 July 2009 - 08:51 AM
This post has been edited by XThX2: 06 July 2009 - 08:51 AM
#79 Posted 07 July 2009 - 03:14 AM
#80 Posted 07 July 2009 - 05:00 AM
#81 Posted 07 July 2009 - 07:33 AM
Spiker, on Jul 7 2009, 08:00 AM, said:
So your goal is to replace the shotgun with a completely custom art sequence?
Then what you're going to want is getplayer[THISACTOR].kickback_pic.
http://wiki.eduke32....ki/Kickback_pic
From there you can use EVENT_DISPLAYWEAPON to display your frames using rotatesprite.
To define TOTALTIME, etc, you will want these vars:
WEAPONx_CLIP
WEAPONx_FIREDELAY
WEAPONx_FIRESOUND
WEAPONx_FLAGS
WEAPONx_INITIALSOUND
WEAPONx_SHOOTS
WEAPONx_SHOTSPERBURST
WEAPONx_SPAWN
WEAPONx_SPAWNTIME
WEAPONx_TOTALTIME
(too many to link, just look them up on the Wiki)
Note that x indicates the weapon slot number.
EDIT:
Isn't there also a WEAPONx_RELOADTIME or something along those lines? I didn't see it listed in the Wiki, but I seem to recall that when CLIP is reached RELOADTIME is added to TOTALTIME (and thus kickback_pic's value/sequence).
This post has been edited by Mblackwell: 07 July 2009 - 07:38 AM
#82 Posted 07 July 2009 - 07:50 AM
WEAPON2_TOTALTIME 24
WEAPON2_FIREDELAY 18
WEAPON2_RELOADTIME 48
WEAPON2_CLIPS 8
When you exceed the clip amount, it will go for the 25th frame of weapon and go on until it reaches to 48th frame.
#83 Posted 07 July 2009 - 08:26 AM
This post has been edited by Spiker: 07 July 2009 - 08:29 AM
#84 Posted 07 July 2009 - 10:04 AM
ifvare playervar[THISACTOR].a 1
work but,
ifvare actorvar[THISACTOR].a 1
works? I get that this is not an array in the log file but not when I try with actorvar.
Quote
This one is solved.
Quote
This post has been edited by XThX2: 07 July 2009 - 12:17 PM
#85 Posted 07 July 2009 - 12:04 PM
Quote
You could always have the projectile spawn a hidden actor which is synced to the projectiles possition but with some distance infront of it.
Have this hidden actor constantly search for actors within a very small distance (400) and when it finds one, wait a tic or 2 (ifcount 1) and then have the projectile move to the hidden actor's possition (or a little furthre). You'll have to work out some timing to stop the projectile moving too early and end up still on path towards the actor. If you leave it too late then the actor gets hit.
That's what I would have done (but haven't tried it yet)
This post has been edited by Chip: 07 July 2009 - 12:06 PM
#86 Posted 07 July 2009 - 12:19 PM
#87 Posted 11 July 2009 - 06:38 AM
getactor[THISACTOR].owner owner getactor[owner].xvel xvel getactor[owner].yvel yvel getactor[owner].zvel zvel movesprite THISACTOR xvel yvel zvel CLIPMASK0 RETURNVAR
I've been messing with it a lot, multiplied/divided/added/substracted but nothing worked. It all just changed the speed of it. (Multiplying with -1 made the direction change) I also thought about setting up x/y/z values for the actors but then it would case them to disappear in walls/floors/ceilings also this actor needs to move around the main actor and it looks bad when you do it (I got the move thing done by adding up to it's angle per count). A suggestion about this would be nice.
This post has been edited by XThX2: 11 July 2009 - 07:20 AM
#88 Posted 11 July 2009 - 09:40 AM
Example:
getactor[THISACTOR].owner owner getactor[owner].x xvar getactor[owner].y yvar getactor[owner].z zvar subvar zvar 6000 setactor[THISACTOR].x xvar setactor[THISACTOR].y yvar setactor[THISACTOR].z zvar
Question: I once read somewhere that Edue32 only does whole numbers for multiplication and division so you cannot do sometihng like "mulvar TEMP 0.02" Is that true?
This post has been edited by Chip: 11 July 2009 - 09:43 AM
#89 Posted 11 July 2009 - 10:15 AM
#90 Posted 11 July 2009 - 10:19 AM
state rollaround getactor[THISACTOR].ang angle ifcount 2 { spawn FRAMEEFFECT1 addvar angle 64 setactor[THISACTOR].ang angle resetcount } ends
This state is in my owner actor's code, and if you set x/y/z and such of it, it get's stupid. I want this to move in circles around the actor that spawns it. The code above does the circle part, it just needs to move along with the owner actor.
This post has been edited by XThX2: 11 July 2009 - 10:19 AM