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

Jump to content

  • 119 Pages +
  • « First
  • 51
  • 52
  • 53
  • 54
  • 55
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Zaxtor 

#1561

View PostHendricks266, on 15 December 2014 - 01:46 AM, said:

The control for detonation is some funky shit, but the part you ask about is this:

                    int32_t j;

                    x = s->extra;
                    m = 0;
                    switch (DYNAMICTILEMAP(s->picnum))
                    {
                    case HEAVYHBOMB__STATIC:
                        m = g_pipebombBlastRadius;
                        break;
                    case MORTER__STATIC:
                        m = g_morterBlastRadius;
                        break;
                    case BOUNCEMINE__STATIC:
                        m = g_bouncemineBlastRadius;
                        break;
                    }

                    A_RadiusDamage(i, m,x>>2,x>>1,x-(x>>2),x);
                    j = A_Spawn(i,EXPLOSION2);
                    A_PlaySound(PIPEBOMB_EXPLODE,j);
                    if (s->zvel == 0)
                        A_Spawn(i,EXPLOSION2BOT);
                    for (x=0; x<8; x++)
                        RANDOMSCRAP;


Where g_pipebombBlastRadius is the tenth parameter of gamestartup (defined in the stock USER.CON as PIPEBOMBRADIUS), and x = getactor[<pipebomb actor>].extra = the strength of the HEAVYHBOMB actor (defined by default as HANDBOMB_WEAPON_STRENGTH).

So:

setvar temp1 HANDBOMB_WEAPON_STRENGTH
shiftvarr temp1 2
setvar temp2 HANDBOMB_WEAPON_STRENGTH
shiftvarr temp1 1
setvar temp3 HANDBOMB_WEAPON_STRENGTH
subvarvar temp3 temp1
hitradiusvar PIPEBOMBRADIUS temp1 temp2 temp3 HANDBOMB_WEAPON_STRENGTH






I don't think I need that.
What I mean is.
I made a Pseudopipebomb or pipebomb clone that we take.
The normal heavyhbomb is incharge for the rest.

The reason I made that "clone" like you know when you shoot or anything hit a heavyhbomb on the floor it blows up.
If you set the var of the enhancer it will make "all the heavyhbomb" make the super explosion.
So to not make that I cloned the pipebomb (item we take).
The Pseudopipebomb doesn't make the "Super explosion" when you shoot it, it get shot or destroyed if never taken.


The Pseudopipe bomb is to prevent untaken pipebomb from making "Super explosion" of the enhanced pipebomb,
The enhanced pipebomb thing works, All I need is just the hitradius of the pipebomb in numbers or etc to the Pseudopipebomb (A_PIPEBOMB).

Its code

actor A_PIPEBOMB
 sizeat 9 9
 cstator 256
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addweapon HANDBOMB_WEAPON HANDBOMBAMOUNT
        quote 55
        ifspawnedby A_PIPEBOMB
          state getcode
        else
          state quikget
      }
 ifhitweapon { hitradius xxxx xx xx xx sound PIPEBOMB_EXPLODE spawn EXPLOSION2 debris SCRAP1 3 debris SCRAP6 4 killit }

enda



All I need is the radius.

This post has been edited by Zaxtor: 15 December 2014 - 06:52 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1562

What Hendricks posted would be more appropriate, but I will make it easier for you:
hitradius PIPEBOMBRADIUS 625 1250 1875 2500

0

User is offline   Zaxtor 

#1563

View PostFox, on 15 December 2014 - 08:04 AM, said:

What Hendricks posted would be more appropriate, but I will make it easier for you:
hitradius PIPEBOMBRADIUS 625 1250 1875 2500





Hundreds and thousands in the strength???
That would be a deadly pipebomb.

I need a radius that does the same damage as the normal heavyhbomb.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1564

View PostFox, on 15 December 2014 - 08:04 AM, said:

What Hendricks posted would be more appropriate, but I will make it easier for you:
hitradius PIPEBOMBRADIUS 625 1250 1875 2500


I think you did the math wrong...

define HANDBOMB_WEAPON_STRENGTH 140

Also not that we're shifting right and not left.
1

User is offline   Zaxtor 

#1565

I just need the hitradius thing.

Like a replica of the hit radius of the explosion when you destroy the pipebomb from shooting it.


When you take it and rethrow it it becomes the normal pipebomb as suppose to. Why applied the enhancement if you took the enhancement (set var etc)


I made the replica so when you take the enhancement it doesn't make the untaken (never touch before) pipebomb make a super explosion if the bomb get accidentally shot or blown up by you or an enemy from shooting the pipebomb.



Everything works
All I need is the replica of the hitradius of the pipebomb.
Because I want it to explode the same when you shoot it, etc.

If the message doesn't work
I mind make a video of what I mean.

This post has been edited by Zaxtor: 15 December 2014 - 04:37 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1566

View PostZaxtor, on 15 December 2014 - 02:43 PM, said:

Hundreds and thousands in the strength???
That would be a deadly pipebomb.

I need a radius that does the same damage as the normal heavyhbomb.

LOL
hitradius PIPEBOMBRADIUS 35 70 105 140

2

User is offline   Zaxtor 

#1567

View PostFox, on 15 December 2014 - 05:27 PM, said:

LOL
hitradius PIPEBOMBRADIUS 35 70 105 140



thx
0

#1568

On the wiki I cannot find the right vars and/or bitfields for disabling any polymer effect on certain sprites; there are only global console controls and htflags bits for avoid light emission, but not for effects from sources. Actually, i don't know if there is what i search.

I need it for disabling polymer lights on snowflake sprites only for my new snow code; it runs fine on polymost, but lights cast on falling snow drop the fps to ~5.
I could remove polymer features at all, but is not reasonable for 1-2 line of code, if this is possible.

Can anyone help me ?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1569

http://hendricks266....ymer_lights.con
0

#1570

Hendricks, my request was different: avoid that light affects specific actors, not removing some lights at all.

This post has been edited by RichardStorm: 30 December 2014 - 02:05 AM

0

User is offline   Diaz 

#1571

I think I've asked for something similar in the past - sprite foliage affected by Polymer lights in my maps was rendered multiple times, killing FPS. There was no solution back then, maybe there is now.
0

User is offline   blizzart 

#1572

Hello guys,
to have a countdown in a map which ends the map, if it's not finished in the given time, has been seen several times. But is it possible to have a countdown for a complete episode (maybe even hub-maps connected) either.
The idea behind this:
a mod, where the player's time is running up to complete a task (or the episode). Best, if the player could go back and forth through the maps by a hub system. After two hours for example the whole game ends if the player hasn't completed the task.

So is something like this possible at all or is this sticker to single maps?

Any suggestions here?
Thank you in advance.
0

User is offline   Mark 

#1573

I'm thinking you will piss off a bunch of players if they get shut down when they were seconds or minutes away from finishing the whole episode. Unless you still have the save game feature. I have no idea if saved games handle countdowns.

This post has been edited by Mark.: 03 January 2015 - 03:50 PM

0

User is offline   Jblade 

#1574

How do I get an enemy to move through a TROR layer? He flies right up to the top of the sector and then just flails about randomly.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#1575

Sounds exactly how enemies react in water sectors.
0

User is offline   Jblade 

#1576

View PostJblade, on 26 January 2015 - 01:03 AM, said:

How do I get an enemy to move through a TROR layer? He flies right up to the top of the sector and then just flails about randomly.

Bumping because this is a fairly important thing I need to get working.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1577

You might need to run clipmove on your sprite and detect if the ceiling it hits calculate if the sprite's Z coordinate is the highest it will go in the sector considering clipping (by looking at the function for it in the source code), detect if the ceiling in question is a TROR surface, and if so warp the sprite yourself.
1

User is offline   Jblade 

#1578

Alright, I sort of suspected that it would have to be forced. It does seem like something that should be built into TROR since it means the default Duke enemies can't move through them out of the box, but it doesn't sound too hard to work around for a mod. Thanks for clarifying!
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1579

 Jblade, on 26 January 2015 - 01:03 AM, said:

How do I get an enemy to move through a TROR layer? He flies right up to the top of the sector and then just flails about randomly.

That was implemented in r3666. Can you provide a failing test case?

I checked trueror1.map with
- a liztroop,
- a LIZMANJUMP that jumps higher than normal (by editing the source), and
- the COMMANDER.

All three work fine here.
0

User is offline   Mark 

#1580

I tested using 4575 in my Graveyard mod, which was installed to check out something else for you, and my newbeast replacement which can jump quite high would not break through the TROR barrier. My Drone replacement would not break through until the player submerged into the lower sector and then went back up to the upper sector. Then the Drone followed me up.

So if you could, test it with the Drone and Newbeast to see if they work properly in your test map.
0

User is offline   Jblade 

#1581

 Helixhorned, on 07 February 2015 - 09:23 AM, said:

That was implemented in r3666. Can you provide a failing test case?

I checked trueror1.map with
- a liztroop,
- a LIZMANJUMP that jumps higher than normal (by editing the source), and
- the COMMANDER.

All three work fine here.

I just uploaded a map called htest.map to the AMC repository - I spawned a liztroop in and it indeed moved no problem but my enemy just raises up and then struggles to move out of the sector. It's possible it may be related to it being a useractor enemy and the liztroop is just a standard actor? I'm using the same kind of checks the liztroop does to move upwards as well.

This post has been edited by Jblade: 07 February 2015 - 01:35 PM

0

User is offline   Helixhorned 

  • EDuke32 Developer

#1582

 Jblade, on 07 February 2015 - 01:35 PM, said:

I just uploaded a map called htest.map to the AMC repository - I spawned a liztroop in and it indeed moved no problem but my enemy just raises up and then struggles to move out of the sector.

The reason the enemy didn't take into account TROR boundaries is that it never issues fall. Unfortunately, this is pretty much the only place that updates actor[].ceilingz and actor[].floorz in a proper fashion for a given sprite. These members are intended as cached versions of the upper and lower bounds for vertical movement. If you search for these members in the EDuke32 source code, you'll find a lot of places where they are set to the sector's ceiling or floor z -- without regard to slope, and now, TROR. My earlier fix (r3666) modified the updating of these members for the COMMANDER and DRONE to consider movement through TROR bunches as well.[1] However, carrying out the same kind of tweak for all other enemies (when moving vertically) in r4975 entailed unwanted behavior: enemies would start moving through blocking sprite constructions (reported by Micky C on IRC, reached me via TX in a PM).

[1]And for upward-moving enemies, but without storing actor[].ceilingz. Actually, that's kind of weird now I think about it. This idea behind that was probably to allow Enforcers jump across bunches. But it seems that the actor's sector number may fail to be updated, then. Needs to be reviewed.

The reason is the above-mentioned proper actor[] .ceilingz and .floorz update, namely using the engine function getzrange. For actors, this is pretty much only called via fall.

The solution I have settled at is to have CON coders issue getzrange themselves whenevery they see fit. In r5016, I added a CON file thisactor_getzrange.con that reimplements EDuke32's hardcoded way of doing that: the initial z position is the actor's one minus 256, and the actor's cstat is temporarily cleared to 0 (to prevent hitting itself). This is only one part of the source's A_GetZLimits(); the other part disables fake floor shadows on hitting a certain class of face sprite below and effects the "sliding" above enemies (regardless of how far away the sprite is above it, actually!). That part was not reproduced.

So, thisactor_getzrange.con is intended to be copied into your mod, includeing it once somewhere and calling "state thisactor_getzrange" where you would issue fall for a falling actor. Note that getzrange() needs to check all sprites in the collected set of sectors for collision -- watch out for quadratic run time. You may also want to call it less frequently than every game tic as a microoptimization, for example every fourth one and only when the actor moves vertically.
2

User is offline   Jblade 

#1583

great, just tested it and the code works fine - I also added in a little bit of code so it only checks every 4 tics as suggested as well. Thanks a lot for taking the time to write up the code, I appreciate it.
0

User is offline   Mark 

#1584

Could we please have that extra snippet of code Jblade? Thanks.
0

User is offline   Jblade 

#1585

 Mark., on 21 February 2015 - 04:22 AM, said:

Could we please have that extra snippet of code Jblade? Thanks.

Well I don't actually know if it's more efficient this way, it's just a case of checking to see if a variable is equal to 0, if it is than run the check and set that variable then to something like 5 and take away 1 from it if it doesn't equal 0 to create a basic counter. I think that will do what helix described as only checking every few tics but it might be not as efficient as it could be. I doubt you really need to worry about that anyways unless you're using lots and lots of enemies and lots of sprites in the same sector.
0

User is offline   Mark 

#1586

Okey Dokey.
0

User is offline   xenoxols 

#1587

Yo, I'm new around here and I have no Idea where to start with CON scripting. Can anyone point me in the direction of an easy to understand tutorial? I have been modding GZDoom for about a year, but I'm guessing that that will not help.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1588

There is a tutorial on the beginning of GAME.CON. But in the future CON language will be replaced with Luna.
0

User is offline   xenoxols 

#1589

So should I wait for luna? Or will that be a while?
0

User is offline   Micky C 

  • Honored Donor

#1590

View PostFox, on 24 February 2015 - 02:40 PM, said:

There is a tutorial on the beginning of GAME.CON. But in the future CON language will be replaced with Luna.


It's lua, not luna. CON won't be replaced, it'll always be around. But it does seem like lua will ultimately be the more powerful and flexible language (I mean they wouldn't have bothered implementing it if it didn't have significant advantages). So it would be worth learning lua straight up. There's a probably a guide floating around the forum somewhere.

It'd be worth looking up the wiki though, since familiarizing yourself with various aspects of the coding system will give you a leg up when it comes to learning lua for eduke. http://wiki.eduke32.com/wiki/Scripting
0

Share this topic:


  • 119 Pages +
  • « First
  • 51
  • 52
  • 53
  • 54
  • 55
  • 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