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

Jump to content

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

EDuke32 Scripting  "CON coding help"

User is offline   Jimmy 

  • Let's go Brandon!

#61

You could try using "getthisactor[THISACTOR].owner TEMP" in like EVENT_EGS or EVENT_GAME, and it should give you all the information you need.
0

User is offline   XThX2 

#62

You could do that in the actor code anyway, type
getactor[RETURN].owner TEMP
by 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 blabla
or 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)
0

User is offline   Chip 

#63

 Captain Awesome, on Jul 4 2009, 05:29 PM, said:

You could try using "getthisactor[THISACTOR].owner TEMP" in like EVENT_EGS or EVENT_GAME, and it should give you all the information you need.


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.
0

User is offline   Chip 

#64

OK, it all worked!
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

getactor[RETURN].owner TEMP


That may come in handy later on.


Thanks guys.

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

0

User is offline   Danukem 

  • Duke Plus Developer

#65

 Chip, on Jul 4 2009, 09:46 AM, said:

So basically the getactor stuff worked better on projectiles then the getthisprojectile stuff.


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.
0

User is offline   XThX2 

#66

Quote

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.


DT, have you experienced with this before?

This post has been edited by XThX2: 04 July 2009 - 09:47 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#67

 XThX2, on Jul 4 2009, 10:47 AM, said:

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?


I can happily report that I've never messed with that stuff before, thereby getting me off the hook. ;)
0

User is offline   XThX2 

#68

What's the maximum amount of sound files you can define in defs.con and user.con?
0

User is offline   Spiker 

#69

Noobish question: How can I increase the number of displayed frames for explosion from 21 to 24 ;) I know this question may be obvious for you but I'm serious ;)

This post has been edited by Spiker: 05 July 2009 - 04:46 AM

0

User is offline   XThX2 

#70

action EXPLOSION (I don't know if this is the correct one) x y z t e

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.
0

User is offline   Jblade 

#71

 XThX2, on Jul 5 2009, 01:37 PM, said:

What's the maximum amount of sound files you can define in defs.con and user.con?

The max sound limit's 2560.
0

User is offline   Jimmy 

  • Let's go Brandon!

#72

 James, on Jul 5 2009, 10:27 AM, said:

The max sound limit's 2560.

And if you pass that number, you're a pretentious dick. ;)
0

User is offline   MIKE SIMS 

#73

 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?
0

User is offline   XThX2 

#74

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

0

User is offline   Danukem 

  • Duke Plus Developer

#75

Because the value of TEMP was -16382, and valid sprite IDs are between 0 and 16383.

This post has been edited by DeeperThought: 06 July 2009 - 08:20 AM

0

User is offline   XThX2 

#76

Is it possible to make a projectile go through actors ? (One way I thought would be to make it a normal actor and have this in it's code, but I want to keep it as a projectile on it's own)

	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

0

User is offline   Danukem 

  • Duke Plus Developer

#77

 XThX2, on Jul 6 2009, 09:45 AM, said:

Is it possible to make a projectile go through actors ? (One way I thought would be to make it a normal actor and have this in it's code, but I want to keep it as a projectile on it's own)

	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.
0

User is offline   XThX2 

#78

Oh that explains why my actors were blocking... Thanks!

This post has been edited by XThX2: 06 July 2009 - 08:51 AM

0

User is offline   XThX2 

#79

How can I identify if an actor hit the wall or a sprite by htmovflag? I realized the bug errors given to me by the invalid sprite number is definitely because of hitting walls, and I need the code to not execute when that happens. To explain what I'm doing with htmovflag, I'm using it to deal damage to what it hit and spawn it's explosion frame. (The actor in question is a projectile with no defineprojectile)
0

User is offline   Spiker 

#80

Another question, how do I define new frames when for example the player is holding a shotgun? I would like to have a special set of frames for it like the kick has. Sorry if I'm asking obious questions but it's not so easy to find it in the wiki.
0

User is offline   Mblackwell 

  • Evil Overlord

#81

 Spiker, on Jul 7 2009, 08:00 AM, said:

Another question, how do I define new frames when for example the player is holding a shotgun? I would like to have a special set of frames for it like the kick has. Sorry if I'm asking obious questions but it's not so easy to find it in the wiki.


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

0

User is offline   XThX2 

#82

AFAIK, the reload time is the maximum time that the weapon has including the reloading frames. It excludes the totaltime of the weapon, and directly jumps to the frame right after it. Example;

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.
0

User is offline   Spiker 

#83

Wow thanks! I will try this out. Hmmm I'm just wondering if this works the same for models and sprites? At the moment I'm for using models but they may be situations later when I resolve to using sprites (hope not).

This post has been edited by Spiker: 07 July 2009 - 08:29 AM

0

User is offline   XThX2 

#84

Why won't,

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.

Oh and, mind if I repeat this ?

Quote

How can I identify if an actor hit the wall or a sprite by htmovflag? I realized the bug errors given to me by the invalid sprite number is definitely because of hitting walls, and I need the code to not execute when that happens. To explain what I'm doing with htmovflag, I'm using it to deal damage to what it hit and spawn it's explosion frame. (The actor in question is a projectile with no defineprojectile)


This one is solved.

Quote

valid sprite IDs are between 0 and 16383.


This post has been edited by XThX2: 07 July 2009 - 12:17 PM

0

User is offline   Chip 

#85

Quote

Is it possible to make a projectile go through actors ? (One way I thought would be to make it a normal actor and have this in it's code, but I want to keep it as a projectile on it's own)


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

0

User is offline   XThX2 

#86

That's what I would've done months ago but I've learned a better method to do what I asked for, and it was what I suggested. It's painful, but works just as flawlessly. Thanks for the comment eitherway ;)
0

User is offline   XThX2 

#87

How can I make an object move along with the actor that spawned it? Just like the weapon icons above your head in multiplayer. (Except that the actors in question are moving) My best bet was to use this code below,

	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

0

User is offline   Chip 

#88

I would not use the movesprite command and instead just get the spawner's X,Y,Z possitions and set that to the spawned actors possition (with some subtraction used on the Z possition so its higher then the spawner's)

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

0

User is offline   Jimmy 

  • Let's go Brandon!

#89

Yeah, the game can't use decimals/fractions. However you can do things like dividing a var of 3 by 2, which creates a var of 1.5, or at least I think it works in theory. I haven't really had a use for specific decimals/fractions yet.
0

User is offline   XThX2 

#90

I put an edit at the end of my post. To elaborate more,

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

0

Share this topic:


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


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options