
EDuke32 Scripting "CON coding help"
#172 Posted 07 August 2009 - 11:08 AM
#173 Posted 07 August 2009 - 07:04 PM
#174 Posted 07 August 2009 - 07:18 PM
Captain Awesome, on Aug 7 2009, 08:04 PM, said:
[code]
whilevarn NUMSPAWNS 0
{
espawnvar SPAWNPICNUM
subvar NUMSPAWNS 1
}
#176 Posted 08 August 2009 - 12:15 PM
#177 Posted 08 August 2009 - 12:17 PM
This post has been edited by XThX2: 08 August 2009 - 12:18 PM
#178 Posted 08 August 2009 - 01:44 PM
Captain Awesome, on Aug 7 2009, 08:08 PM, said:
Its still possible to emulate such a thing with the commands we already have. It wont be perfect but It will still work.

#179 Posted 08 August 2009 - 01:58 PM
#181 Posted 08 August 2009 - 02:13 PM
XThX2, on Aug 8 2009, 05:17 PM, said:
#182 Posted 08 August 2009 - 02:39 PM
#184 Posted 08 August 2009 - 06:11 PM
#185 Posted 09 August 2009 - 03:37 AM
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?
This post has been edited by Chip: 09 August 2009 - 03:45 AM
#186 Posted 09 August 2009 - 03:56 AM
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.
#187 Posted 09 August 2009 - 04:15 AM
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
#188 Posted 09 August 2009 - 04:25 AM
#189 Posted 09 August 2009 - 07:51 AM
#190 Posted 09 August 2009 - 01:11 PM
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
#192 Posted 10 August 2009 - 02:21 AM
XThX2, on Aug 9 2009, 10:25 PM, said:
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.
#193 Posted 10 August 2009 - 02:19 PM
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
#194 Posted 10 August 2009 - 02:45 PM
Lord Misfit, on Aug 10 2009, 03:19 PM, said:
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
#195 Posted 10 August 2009 - 07:07 PM
#196 Posted 11 August 2009 - 04:16 AM
Lord Misfit, on Aug 10 2009, 07:19 PM, said:
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 think this could be resolved if there was a gamevar that holds how much tics in a screen event passes for every normal tic.
#197 Posted 13 August 2009 - 02:47 AM

#198 Posted 13 August 2009 - 07:28 AM
Ifvare TEMP 0 { sound DUKETALK_BOSSFALL setvar TEMP 1 }
Surely it will only do it for a tic.
#200 Posted 13 August 2009 - 12:06 PM
Hendricks266, on Aug 13 2009, 03:50 PM, said:
#201 Posted 14 August 2009 - 05:32 AM
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