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

Jump to content

  • 120 Pages +
  • « First
  • 62
  • 63
  • 64
  • 65
  • 66
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Hendricks266 

  • Weaponized Autism

  #1891

Commands like spritepal work only on the current sprite.

espawn TRANSPORTERSTAR
setactor[RETURN].pal 7

0

User is offline   stumppy84 

#1892

Thanks again Hendricks!! :P
0

User is offline   stumppy84 

#1893

How hard is it to code in a shotgun knockback feature? That would knock back the actors. I've looked at other mods but it seems a bit complicated...
0

User is offline   Jblade 

#1894

A simple way to do it would be like this:
ifvarg sprite[THISACTOR].htextra 0 // Is this actor taking damage?
 {
 getactor[THISACTOR].htpicnum TEMP // get the tile number of the attack
  ifvare TEMP SHOTGUN // if it's the shotgun...
   {
   setactor[THISACTOR].xvel -10 // set its backwards velocity by 10
   }
 }

Make sure to define the TEMP gamevar if you haven't already.

That should do it - it's a quick and dirty method but it should work. Then you can go from there and make it a bit more complex. You would put this in the actor code - I can't remember if it has to be before or after a 'ifhitweapon' statement so try both.
0

User is offline   Mblackwell 

  • Evil Overlord

#1895

View PostMr. Alias Nameless, on 15 August 2016 - 11:42 PM, said:

What do you mean? Screen resolution - yes to all. Aspect setted up by setaspect function - halfway, it is necessary to choose the coefficients for each values of "viewingrange" and "yxaspect". Now I try to find a mathematical relationship.


I mean screen resolution, yes. For example setting 16:10 vs 16:9 and 4:3 as well as 5:4
0

User is offline   Micky C 

  • Honored Donor

#1896

View PostMblackwell, on 19 August 2016 - 07:25 AM, said:

I mean screen resolution, yes. For example setting 16:10 vs 16:9 and 4:3 as well as 5:4


Hasn't someone already done code for something like this that works in the software renderer, but is off in the gl renderers due to the different perspective?

It was for drawing boxes around actors from memory.

This post has been edited by Micky C: 19 August 2016 - 07:27 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#1897

Yeah I remember that code, but I can't remember what mod that was for.
0

User is offline   stumppy84 

#1898

View PostJblade, on 19 August 2016 - 03:27 AM, said:

A simple way to do it would be like this:
ifvarg sprite[THISACTOR].htextra 0 // Is this actor taking damage?
 {
 getactor[THISACTOR].htpicnum TEMP // get the tile number of the attack
  ifvare TEMP SHOTGUN // if it's the shotgun...
   {
   setactor[THISACTOR].xvel -10 // set its backwards velocity by 10
   }
 }

Make sure to define the TEMP gamevar if you haven't already.

That should do it - it's a quick and dirty method but it should work. Then you can go from there and make it a bit more complex. You would put this in the actor code - I can't remember if it has to be before or after a 'ifhitweapon' statement so try both.


Thanks Jblade! I'm not 100% about defining the 'TEMP gamevar' but I will try to look around the Wiki a bit and see if its explained there..
0

User is offline   Jblade 

#1899

gamevar TEMP 0 0 - basically the first letter is the variable's starting number, and the second defines what kind of variable. 0 is global, so everything can access it - 1 is per-player which means it's unique for every player and 2 is per-actor which means it's unique for every single actor :P
0

User is offline   stumppy84 

#1900

Thanks! I couldn't really find in the wiki so this is a great help!!
0

User is offline   Danukem 

  • Duke Plus Developer

#1901

View Poststumppy84, on 20 August 2016 - 07:44 AM, said:

Thanks! I couldn't really find in the wiki so this is a great help!!


http://wiki.eduke32.com/wiki/Scripting

You can read the first section on gamevars.

Also, there is an entry here:

http://wiki.eduke32....ar_manipulation
0

#1902

Two bugs found? (using last eduke version, since dunno):

- getting htextra from enemies always returns -1 rather than incurring damage (i also used useractor as additional caution as wiki suggests)

- if adding cstat 256 to dead corpses for being able to shoot them, they use some hardcoded clipping rectangle as high as the living actor (see pic below); maybe i miss something, but I found no way to change it by working on clipdist or various flags.

I know that the first issue can be avoided by constantly checking actor's extra, and the second with separate actors for corpses.
Unfortunately the separate actor solution opens several issues in a project i'm working on, if not solvable via attributes or some strange trick.

Attached thumbnail(s)

  • Attached Image: duke0002.jpg

0

User is offline   Danukem 

  • Duke Plus Developer

#1903

View PostRichardStorm, on 23 August 2016 - 04:05 AM, said:

- getting htextra from enemies always returns -1 rather than incurring damage (i also used useractor as additional caution as wiki suggests)


If that were true it would break just about every one of my mods, and since I have released tested versions of some mods using the latest r5811 snapshot, I have to conclude that you are doing something wrong. Most likely, you are checking htextra after the actor has called ifhitweapon (that command resets htextra to -1).

EDIT: I made an edit to the wiki page to clear that up http://wiki.eduke32.com/wiki/Htextra

This post has been edited by Trooper Dan: 23 August 2016 - 11:37 AM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1904

The idea behind EVENT_PREGAME and EVENT_PREWORLD is to let you get the htextra before any ifhitweapon commands are run. I don't recall if they actually work for that though.
0

#1905

If only the obscure ifhitweapon behavior was on Wiki ages ago, i'd have skipped that question and not played the "dumb"role. Seriously, why and how do you suppose i had that info ?
Anyway, getting htextra at very top of enemy codes (before states etc) works quite well, many thanks.

But still:

Eduke Wiki of Secrets said:

If the actor in question is a useractor enemy, it will not count damage higher than the actor health.

i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What Wiki i miss, again ?


Now, my main interest is that clipping shaping, i should expect another CON secret...

This post has been edited by RichardStorm: 23 August 2016 - 02:38 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#1906

View PostRichardStorm, on 23 August 2016 - 02:37 PM, said:

If only the obscure ifhitweapon behavior was on Wiki ages ago, i'd have skipped that question and not played the "dumb"role. Seriously, why and how do you suppose i had that info ?


I didn't realize that the information was missing from the wiki entry until you asked the question and I checked on it. I would argue that this is an example of the system working well -- someone asks a question, it gets answered, and then the wiki is updated so that other people won't have to ask (in theory).


View PostRichardStorm, on 23 August 2016 - 02:37 PM, said:

But still:

i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What Wiki i miss, again ?


I don't know who wrote that line in the wiki. Maybe it was correct at one time. Anyone with a wiki account can delete that line (maybe I will do that when I get home from work).

View PostRichardStorm, on 23 August 2016 - 02:37 PM, said:

Now, my main interest is that clipping shaping, i should expect another CON secret...


At the risk of being blasted for revealing that I know stuff, here goes... The hittable dimensions of an actor are determined by the tile number that it is defined on, not on the dimensions of the tile it happens to be displaying at a given moment. If an actor is displaying a dead body sprite because of an action command, that will not change the hittable area. What you need to do is use the cactor command to change its picnum to the dead body tile number. Then make the dead body tile number an actor with appropriate code.
0

User is offline   Mblackwell 

  • Evil Overlord

#1907

A fun bit in some old mods I was working on was making the initial sprite slightly smaller than the display version and giving it an offset so only a certain section of the enemy sprite was actually hittable.

Great times!
0

User is offline   Zaxtor 

#1908

Is there such code as to move(teleport) a sprite as we can do to the player?


Like for the player we have
Which can move the player to any areas of the level (at the speed of light) without any use of `move` code.

*
setplayer[THISACTOR].cursectnum (sector ID numbers number)
setplayer[THISACTOR].posx (horizontal distance number)
setplayer[THISACTOR].posy (vertical distance number)
setplayer[THISACTOR].posz (height altitude number)
setplayer[THISACTOR].ang (its angle number)


But is there a version of this code to teleport an individual sprite*
Like a version as the code above but for nonplayer sprites?
0

User is offline   Danukem 

  • Duke Plus Developer

#1909

http://wiki.eduke32.com/wiki/Setsprite
1

User is offline   Zaxtor 

#1910

it worked, thx.
I put the setsprite THISSPRITE and the xyz coordinates etc.
0

User is offline   David B. 

#1911

Working on a mod, I need to skip/deactivate the following menus ; I know about the events scripts but I can't figure out which current_menu port is related and/or if this is even doable :
I havent found enough information about that.

1- "status and crosshair" page (available from "display options" menu) ;
2- "select skill" when loading a new game ; I know this is port 110 but how to skip it ? manipulating the RETURN would lead back to a menu again. Maybe I'm not reasoning in the right way...??

As a subsidiary question : I managed to skip "cheat" menu - and other unused ones - but when I click on them, the main menu is "reloaded" and thus "slides".
I don't want to see that ; I would have liked nothing happens when an user select an "unavailable" page.

This post has been edited by David B.: 30 December 2016 - 09:12 AM

0

User is offline   DotK3D 

#1912

Hello everyone and Happy New Year.

I wanted to try some things in scripting and I have a small problem :

I have made a switch to operate a door and I want this switch to get back to "released" state after a delay while in "pressed" state you can't activate it.
It works nearly as I want but sometimes the switch is reactivated nearly immediately (the door open a bit and close afterwards - and vice versa).

Any help is welcome,
Bye,
DotK3D

here the code :
// Custom switches
define NEWSWITCH 3585

action NEWSWITCHRELEASE 0 1 1 1 1 
action NEWSWITCHPRESS 1 1 1 1 1 

eventloadactor NEWSWITCH
 gamevar activatorLotag 0 2
 getactor[THISACTOR].lotag activatorLotag
enda
useractor notenemy NEWSWITCH 0 NEWSWITCHRELEASE
  ifp pfacing
   ifpdistl 1280
    ifhitspace
     ifaction NEWSWITCHRELEASE
     {
      action NEWSWITCHPRESS
      soundonce SWITCH_ON
      operateactivators activatorLotag 0
      break
     }
  ifaction NEWSWITCHPRESS
   ifcount 64
   {
    action NEWSWITCHRELEASE
    resetcount
    break
   }
enda


and the test map with art file and game.con

Attached File(s)



This post has been edited by DotK3D: 01 January 2017 - 08:38 AM

1

User is offline   Hendricks266 

  • Weaponized Autism

  #1913

Try adding a resetcount alongside the "action NEWSWITCHPRESS" and "soundonce SWITCH_ON".
2

User is offline   DotK3D 

#1914

That's a quick answer !

It seem to works. I have added resetcount just after soundonce SWITCH_ON

Thanks a lot,
DotK3D

PS : I have read somewhere that a EVENT_DAMAGEWALL was planned, to do custom breakable screens If I have understand correctly, is it available ?

This post has been edited by DotK3D: 01 January 2017 - 09:37 AM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1915

Not yet but it is very high on my to-do list.
1

User is offline   DotK3D 

#1916

Ok, nice.

Thanks again,
Dotk3D
0

#1917

I'm trying to add to my projectile_type projectiles a way to press buttons... my idea is to shoot a short-range hitscan dummy on event_killit, but it doesn't work:

define _BPRESS ####

defineprojectile _BPRESS  PROJ_WORKSLIKE 1     // or 16
defineprojectile _BPRESS  PROJ_EXTRA 1              // or 0
defineprojectile _BPRESS  PROJ_XREPEAT 4
defineprojectile _BPRESS  PROJ_XREPEAT 4
defineprojectile _BPRESS  PROJ_RANGE 128

onevent EVENT_KILLIT
 switch sprite[THISACTOR].picnum
  ...
 case FIRELASER
 case PLASMA_PROJ
 case ...
  shoot _BPRESS
 break

 endswitch
endevent
 


I tried various combinations of size, damage, no_aim flag, zshoot at 0, different range...

Is something wrong/odd in the projectile declaration, or is the whole idea wrong and there are other ways to do that ?

// edit
Also, i would know the description of the PROJECTILE_REALCLIPDIST, _ACCURATE and _NOSETOWNERSHADE flags, not yet on wiki

This post has been edited by RichardStorm: 13 January 2017 - 11:42 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1918

REALCLIP: Something to do with hard-coded behavior. Very specific usage.

ACCURATE: Bullet-type projectile doesn't spread.

NOSETOWNERSHADE: Shooting actor won't glow when firing the projectile.

This post has been edited by Fox: 13 January 2017 - 12:01 PM

0

User is offline   Mark 

#1919

After a long break I'm getting back into con coding ( what little I know ) . I'm a little rusty and need some help. I have an animated md3 model that unfortunately was created facing sideways. Its causing me problems when trying to use the faceplayerslow command. As expected the model's side faces the player as you move around it. So then I had the bright idea of using the angoff command to offset the model at the start to get it to spin 90 degrees CW. Problem is, when faceplayer kicks in the model still never quite faces the player. I can't seem to get the full 90 degree spin I need. I tried inserting angoff at the very beginning of the actor's code and also tried inside the brackets with the move and faceplayer command. Nothing gets me exactly what I want.

For starters, what are the min/max values for the angoff command? It is not stated in the Wiki. Second, am I going about it all wrong?

Editing the model itself is a last resort because of it being an md3 and not something with a skeleton. I would have to manually spin all the frames by 90 degrees to keep it intact.

This post has been edited by Mark.: 30 January 2017 - 04:20 PM

0

User is offline   Mark 

#1920

Double post, ahh... Blender Guru TeaMonster came to the rescue with an older version of Blender that still imported and exported md3 models properly. He was able to spin the model so I don't need the con solution right away. But for the sake of learning I would still like to know if there was a con solution that I missed.
0

Share this topic:


  • 120 Pages +
  • « First
  • 62
  • 63
  • 64
  • 65
  • 66
  • 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