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

Jump to content

  • 123 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   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

User is offline   Chip 

#202

You could perhaps make it only play the radiusexplosion if its a certain distance away from the playersprite. If you plan on having multiple players in that map with this weapon that you want to harm then you could possibly have the main projectile have a gamevar which once set (by its trail buddies) to something it forces the blast to always occur on each of its spawned trails regardless of the player's distance so it can strike players......but just not within a few tics after being shot out.
But more than likely there will be efficent and better ways to do this then what I suggested so you so probably best wait for someone else to reply.


Anyway a question of my own, Its simple really - my "useractor notenemy" does not seem to want to do certain things after death, he wont play sound files and he wont change his cstat to 0 (so it remains cstat 257)
My useractor enemy which I coppied this code from worked fine so is this a limitation to the useractor notenemy sprites?

This post has been edited by Chip: 14 August 2009 - 06:50 AM

0

User is online   Danukem 

  • Duke Plus Developer

#203

View PostChip, on Aug 14 2009, 07:47 AM, said:

Anyway a question of my own, Its simple really - my "useractor notenemy" does not seem to want to do certain things after death, he wont play sound files and he wont change his cstat to 0 (so it remains cstat 257)
My useractor enemy which I coppied this code from worked fine so is this a limitation to the useractor notenemy sprites?


Are you sure it isn't a bug in your code? I've never had a problem like that.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#204

View PostXThX2, on Aug 14 2009, 10:32 AM, said:

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.
You should use projectile flag 65536 so that you can return "ifhitweapon MYPROJECTILE" from the hitradius too.

I can came to my mindo how to do the projectile you want. I would use a normal hitscan projectile and use other methods for creating the Railgun...
0

User is offline   m210® 

#205

If I have distances to many objects how to find the minimum distance to object?
0

User is offline   XThX2 

#206

I can't think of anything but a translation of bubblesort to CON. Well, it basically involves searching through all sprites, comparing two of their distances, if it's lower than the other, adds it to the upper queue and compares it to the next in line. I think you can use the thing I explained on top of this page, with some limitations like defining the picnum of your object so it won't slow things down. Yet, you are better off asking it to someone who knows doing that. :blink:
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#207

Heh, I guess it would be necessary a more complex command, like one to check several sprites. I meant, something like whilevarn and that stores the current (while) sprite ID.

This post has been edited by Ilovefoxes: 14 August 2009 - 07:00 PM

0

User is online   Danukem 

  • Duke Plus Developer

#208

He didn't express clearly what the problem is, but I doubt it's very complicated.
0

User is offline   Chip 

#209

View PostDeeperThought, on Aug 14 2009, 04:32 PM, said:

Are you sure it isn't a bug in your code? I've never had a problem like that.


Yeah it was a bug in my code - I solved this around 30 minutes after making that post but by then I had no access to that computer for the rest of the day so I couldn't edit out my post.
The problem was that my actor dying was an action which does not cancel ai strings (ai AIENEMYWALKING etc...) and that ai string gets read before the dying action thus throwing my actor back into its seek state and not its dying one.



The reason I used an action and not ai is because I did plan on having no ai strings at all because I was going to have varying speeds with my actor based on gamevars and as such the ai strings would have been just a duplicate of the actions defined since they're just an action with a movement.
However I have recnetly found out why we have ai strings........because controlling movement is just so damn crappy!

placing a move command within a state instantly stops the actor from counting so all ifcount commands fail to function and replacing the move command to setactor[THISACTOR].xvel 40 has absolutly no effect what so ever so I guess you can't set an actor's speed using that which ruins my whole plan about having gamevar based movements.
Now, I added my move command at the top of my actors state so perhaps I may get away with it by throwing them in at the very bottom of the state after all ifcount commands but I still wont have my gamevar based movment.

So is it at all possible to have movement adjusted by gamevars or am I just going to have to define like a million move commands and then have a million "ifvare SPEED 32 move 32 geth" thrown in as well?

This post has been edited by Chip: 15 August 2009 - 07:19 AM

0

User is offline   XThX2 

#210

ifmove YOURMOVE nullop else move YOURMOVE <commands>


That will solve your problem about continuous move calls. Try to use addlogvar with some actor structure members that are relevant to what you want and see if they fit the speed of the move.
0

Share this topic:


  • 123 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