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

Jump to content

  • 124 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • 9
  • 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!

#172

Oh. =( It'd be very cool if a bit could be implemented that allowed a projectile to go through walls.
0

User is offline   Jimmy 

  • Let's go Brandon!

#173

Sorry to double post, but I was wondering how one would go about coding a spawner that would spawn a certain amount of something by a defined var. I know you could do the "ifvare 1, ifvare 2, etc etc" route, but that seems like a waste. Is there a simpler way?
0

User is online   Danukem 

  • Duke Plus Developer

#174

View PostCaptain Awesome, on Aug 7 2009, 08:04 PM, said:

Sorry to double post, but I was wondering how one would go about coding a spawner that would spawn a certain amount of something by a defined var. I know you could do the "ifvare 1, ifvare 2, etc etc" route, but that seems like a waste. Is there a simpler way?


[code]

whilevarn NUMSPAWNS 0
{
espawnvar SPAWNPICNUM
subvar NUMSPAWNS 1
}
0

User is offline   Jimmy 

  • Let's go Brandon!

#175

Doh, I have never used this command before. Thanks.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#176

Is there a way so that I can check if a user map in running without confusing with volume 0 level 7?
0

User is offline   XThX2 

#177

What do you mean with "confusion" ? Is it about the music ?

This post has been edited by XThX2: 08 August 2009 - 12:18 PM

0

User is offline   Chip 

#178

View PostCaptain Awesome, on Aug 7 2009, 08:08 PM, said:

Oh. =( It'd be very cool if a bit could be implemented that allowed a projectile to go through walls.


Its still possible to emulate such a thing with the commands we already have. It wont be perfect but It will still work. :blink: Just have the projectile spawn a pathfind sprite that syncs its possition with the weapon but also ahead slightly. Then have that work out whether its gone through a wall or not then make it adjust the projectile accordingly so it misses the wall and travels through the void.....assuming that we can repossition a live projectile and that it doesn't pop once its out of a sector, if not then have the pathfinder travel through the wall till it reaches a sector then shoot out a new projectile.
0

User is offline   XThX2 

#179

Uhm, I believe hitscan checks and movesprite in EVENT_GAME would work better. (Or simply making it an actor based projectile)
0

User is offline   Chip 

#180

Either way its clearly possible.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#181

View PostXThX2, on Aug 8 2009, 05:17 PM, said:

What do you mean with "confusion" ? Is it about the music ?
I mean, I want to ser up something happen in E1L8, although not to happen in user map...
0

User is offline   XThX2 

#182

Why can't you make the player skip that map and replace your map with E1L9 ? It should save you alot of time.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#183

Meh, that is ugly.
0

User is offline   Jimmy 

  • Let's go Brandon!

#184

Why not just put a special sprite in your E1L8, and if said sprite is not present, such and such does not happen.
0

User is offline   Chip 

#185

Some time next week I'll be doing advanced paving techniques for my actors and with it advanced actor targeting including doing stuff totally different to how I've done things before.
I wont be starting the targeting stuff till the basic paving is done but here's an advance of one of my problems I'll be running into, take a look at the picture below:



My bot will be looking for actors using the findnearactor command and then seeing if he can see them using the canseesprite commands and stuff. The problem in the picture is that my Bot will find enemy number 2 each time findnearactor is used since enemy 2 is the closest target. The Bot cannot see the enemy so I need it to search for the next closest enemy........but how?
Findnearactor will always bring me the ID of the closest target so I can't use that. Each of the 3 enemies are in their own sectors so I can't have my actor quickly check his current sector for enemies, I can't have the enemies tell the Bot their locations if they can see him because enemy 3 in the picture could very well be a sniper and telling the Bot his location would allow the bot to aim his weapons accurately at a target you shouldn't even be able to see till you're much closer so I don't want it to be able to shoot accross the map all because someone hiding can see him and I can't have it check what's in front of it using hitscan because the closest enemy (enemy 1) is on a moderate sized piller which puts it above the Bot's center possition. (also I've never got hitscan to work since it requires sin cos and tan and I don't know how to get those)

Before I make a suggested to TerminX about having an "optional" addon value to the findnearactor commands that allows you to toggle the number of actors it searches before it records the ID (This value would be a gamevar so actors can adjust it themselves), is there any other way to make my Bot in that picture find Actor enemy 1 and other actors in simular situations which aren't the closest but are shootable?

Attached thumbnail(s)

  • Attached Image: Finding_Bots.PNG


This post has been edited by Chip: 09 August 2009 - 03:45 AM

0

User is offline   XThX2 

#186

Wait wait, shouldn't findnearactor fail to return ID when there are more than same of that actor ? That's what I recall it and it's friends doing... Use the looping through all sprites method. I think it was ;

whilevarn spritenum 16384
{
	addvar spritenum 1
	
	getactor[spritenum].picnum picnum
	ifvare picnum <youractor>
	{
		 execute some commands, possibly some distance checks involved in your case ?
	 }
}


I maybe wrong though.
0

User is offline   Chip 

#187

I've never had any problems with findnearactor when there's multiples of the same actor in the same sector.
As for the code, wont that take a while to cycle through all of them? What if there are only 2 enemies it should be looking for, both having a number higher then 16000? Leaving my actor to wounder aound being shot till it checks through all those numbers (Fair enough, my actors will respond to being shot at but only if they get hit still leaving a possible situation of my bots not shooting nearby enemies for a while.)

This post has been edited by Chip: 09 August 2009 - 04:16 AM

0

User is offline   XThX2 

#188

I believe it performs the check faster than what you think it is... Anyway what I meant was not the same sector but the RANGE you define for the command. What if more than one of the same actor in the specified range? Troubles ?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#189

findnearactor actor is quite limited. First it is lying, it doesn't find the nearest actor, but rather the one with the lowest ID. Second you can only find one actor tile at range.
0

User is offline   Chip 

#190

So basically the findnearactor stuff really isn't any good?

Anyway, something else (and should be simple) how do I get an actor to know the sector number it is in (so it can then be past onto another actor) and if an actor is outside of a sector would it treat the sector number as -1?
Basically I need my actor to know if it is outside of a sector (in the void) and It seems more difficult then I first thought mainly because I can't find a way to make the actor obtain the sector number its in.


*edit*

Nevermind, I found this: "updatesector <x> <y> <gamevar>"
I was originally only looking in the wiki's sector structure pages.

This post has been edited by Chip: 09 August 2009 - 01:18 PM

0

User is offline   XThX2 

#191

sectnum

Use it to find the sectorID the actor is at. When you have it, you can check for say, a specific lotag on sector to define your "void" and check if the sector has that tag, your actor can do stuff.
0

User is offline   Chip 

#192

View PostXThX2, on Aug 9 2009, 10:25 PM, said:

sectnum

Use it to find the sectorID the actor is at. When you have it, you can check for say, a specific lotag on sector to define your "void" and check if the sector has that tag, your actor can do stuff.


Damn it! It was in the sprite structure pages!
Anyway I think the updatesector command will be more useful though.
0

#193

I find myself needing some help again. o.o

In NR I have it set that when you have the game paused, it shows a customized display which generally includes a quote from the current character in play as a biting quip to the player directly [breaking fourth-wall type of stuff], which changes between five quotes after a set time. However there's a problem with it in incrementing timer variables in EVENT_DISPLAYREST, which the var will increment at a different speed depending on the specs of the system or the CPU power [i.e. mine takes twice the intended time to cycle quotes, while a friends cycles the quotes 3-4 times faster than it should be].

I wanted to put the incrementing var somewhere else where it wouldn't cause the problem, but putting it in the APLAYER actor is useless since actor code won't run when the game is paused. Code under EVENT_GAME also doesn't seem to run at all when the game is paused, so the timer wouldn't increment in that situation either, and I need to know if there's somewhere I can insert my "addvar [timer] 1" code where it'll increment at a proper speed but still run while the game is paused. Anyone know what to do? o.o
0

User is online   Danukem 

  • Duke Plus Developer

#194

View PostLord Misfit, on Aug 10 2009, 03:19 PM, said:

I find myself needing some help again. o.o

In NR I have it set that when you have the game paused, it shows a customized display which generally includes a quote from the current character in play as a biting quip to the player directly [breaking fourth-wall type of stuff], which changes between five quotes after a set time. However there's a problem with it in incrementing timer variables in EVENT_DISPLAYREST, which the var will increment at a different speed depending on the specs of the system or the CPU power [i.e. mine takes twice the intended time to cycle quotes, while a friends cycles the quotes 3-4 times faster than it should be].

I wanted to put the incrementing var somewhere else where it wouldn't cause the problem, but putting it in the APLAYER actor is useless since actor code won't run when the game is paused. Code under EVENT_GAME also doesn't seem to run at all when the game is paused, so the timer wouldn't increment in that situation either, and I need to know if there's somewhere I can insert my "addvar [timer] 1" code where it'll increment at a proper speed but still run while the game is paused. Anyone know what to do? o.o


I guess you could use this to see how much real time is passing:

http://wiki.eduke32....iki/Gettimedate
0

User is offline   Hendricks266 

  • Weaponized Autism

  #195

If you want to be fancy, you could detect the pause buttonpress in EVENT_PROCESSINPUT, cancel it, and then recreate it using statnums in conjunction with other necessary modifications, like locking the game timer and player input. However, there may still be problems, like the lack of the ability to pause and seek through music.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#196

View PostLord Misfit, on Aug 10 2009, 07:19 PM, said:

I find myself needing some help again. o.o

In NR I have it set that when you have the game paused, it shows a customized display which generally includes a quote from the current character in play as a biting quip to the player directly [breaking fourth-wall type of stuff], which changes between five quotes after a set time. However there's a problem with it in incrementing timer variables in EVENT_DISPLAYREST, which the var will increment at a different speed depending on the specs of the system or the CPU power [i.e. mine takes twice the intended time to cycle quotes, while a friends cycles the quotes 3-4 times faster than it should be].

I wanted to put the incrementing var somewhere else where it wouldn't cause the problem, but putting it in the APLAYER actor is useless since actor code won't run when the game is paused. Code under EVENT_GAME also doesn't seem to run at all when the game is paused, so the timer wouldn't increment in that situation either, and I need to know if there's somewhere I can insert my "addvar [timer] 1" code where it'll increment at a proper speed but still run while the game is paused. Anyone know what to do? o.o
I know what do you meant. I don't use the game paused to create a custom intermission screen, since I want to use another input keys out there (for example Space key doesn't work in paused game), so I can use a var in APLAYER.

I think this could be resolved if there was a gamevar that holds how much tics in a screen event passes for every normal tic.
0

#197

If gettimedate could get the current tic of the current second, I could probably use it for my idea, but I need to be more specific in timer increments than just seconds [aka I need to gauge the time in tics], because I want to have it that every set amount of seconds, it will change the quote and then also play a sound that goes along with it. However, if I do a var check for a second's worth of time using gettimedate [since it can't get the tic value of a second right now], it'll keep playing the sound for all 26 tics of that second since the code will have to use stopsound to cut off a previously playing sound and just it'll sound weird for the first 26 tics, and I'd rather only make it play on the first tic of the first second, if you know what I mean. :blink:
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#198

But that's pretty basic for CON. I meant, just:
Ifvare TEMP 0
{
  sound DUKETALK_BOSSFALL
  setvar TEMP 1
}

Surely it will only do it for a tic.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #199

There's also the getticks command.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#200

View PostHendricks266, on Aug 13 2009, 03:50 PM, said:

There's also the getticks command.
That's pretty good to know
0

User is offline   XThX2 

#201

I need help at making a working railgun. My idea was this;

Make a fake bullet type projectile, have it spawn a trail. The trail goes through actors even if the projectile hit something, which is a good thing. I thought about how to damage the actors and what came to my mind was to make trail actors create hitradiuses with small range at EVENT_EGS. But this has one downside, which is that it damages the player. Well, the thing is, it's htpicnum seems to be 1670 (RADIUSPICNUM) but when I check it with ifvare hitpicnum 1670 setactor[THISACTOR].htextra -1 it still damages the player. I have an invulnerability item which causes the htextra of the player to be -1 when any damage is taken, however it strangely fails against this too. I guess this is a priority issue, but I can't seem to solve this one.

This post has been edited by XThX2: 14 August 2009 - 05:32 AM

0

Share this topic:


  • 124 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • 9
  • 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