
EDuke32 Scripting "CON coding help"
#1883 Posted 19 March 2016 - 12:06 AM
This post has been edited by Fox: 19 March 2016 - 12:07 AM
#1884 Posted 29 April 2016 - 12:02 PM
1. I already created casings that drop on the ground. However, I would like the casings to be visible in first person as they leave the weapon (like the original sprite ones). I know I can modify the angle horizontally that they appear as such, but then the casings drop in front of Duke instead of next to him. I use code such as this:
ifactor RIFLESHELL { move FORWARD getactor[THISACTOR].ang TEMP subvar TEMP -412 randvar TEMP2 128 addvarvar TEMP TEMP2 setactor[THISACTOR].ang TEMP }
I know the fix is probably easy and I'm missing something obvious, but do help a brother out here.
2. Is it possible for the Eggs and Sharks to be counted in the overall tally count BEFORE killing them? (as in, the mid level enemy count that can be turned on in eDuke can show the proper number of enemies instead of an estimate)
#1885 Posted 29 April 2016 - 12:34 PM
move FORWARD getactor[THISACTOR].ang TEMP subvar TEMP -412 randvar TEMP2 128 addvarvar TEMP TEMP2 setactor[THISACTOR].ang TEMP getactor[THISACTOR].owner TEMP8 setvarvar TEMP3 sprite[TEMP8].x addvar TEMP3 256 getactor[TEMP8].ang TEMP4 addvar TEMP4 128 rotatepoint sprite[TEMP8].x sprite[TEMP8].y TEMP3 sprite[TEMP8].y TEMP4 TEMP5 TEMP6 setactor[THISACTOR].x TEMP5 setactor[THISACTOR].y TEMP6 getactor[TEMP8].z TEMP subvar TEMP 8096 ifspawnedby APLAYER { getplayer[THISACTOR].horiz TEMP2 subvar TEMP2 100 mulvar TEMP2 16 subvarvar TEMP TEMP2 } setactor[THISACTOR].z TEMP
Hopefully you can get a gist of what needs doing. I'm sure the code could be improved but I have a dozen other things that need working on at the same time.
This post has been edited by Jblade: 29 April 2016 - 12:35 PM
#1887 Posted 12 August 2016 - 02:21 AM
Mr. Alias Nameless, on 21 February 2016 - 06:35 AM, said:
I need a function that takes parameters: camerax,cameray,cameraz,camerasect,camerahoriz,cameraang, screenx,screeny (xd,yd) and return x,y,z in build coordinates.

Can somebody help with programming such functions for non classic modes?
I did it!
This post has been edited by Mr. Alias Nameless: 12 August 2016 - 02:23 AM
#1889 Posted 15 August 2016 - 11:42 PM
Mblackwell, on 12 August 2016 - 12:46 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.
This post has been edited by Mr. Alias Nameless: 15 August 2016 - 11:47 PM
#1890 Posted 18 August 2016 - 04:44 PM
below the ifwasweapon SHOTSPARK1:
sound SOMETHINGHITFORCE spawn TRANSPORTERSTAR spritepal 7
This post has been edited by stumppy84: 18 August 2016 - 05:20 PM
#1891 Posted 18 August 2016 - 05:25 PM
espawn TRANSPORTERSTAR setactor[RETURN].pal 7
#1893 Posted 19 August 2016 - 02:50 AM
#1894 Posted 19 August 2016 - 03:27 AM
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.
#1895 Posted 19 August 2016 - 07:25 AM
Mr. Alias Nameless, on 15 August 2016 - 11:42 PM, said:
I mean screen resolution, yes. For example setting 16:10 vs 16:9 and 4:3 as well as 5:4
#1896 Posted 19 August 2016 - 07:26 AM
Mblackwell, on 19 August 2016 - 07:25 AM, said:
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
#1897 Posted 19 August 2016 - 12:50 PM
#1898 Posted 19 August 2016 - 02:53 PM
Jblade, on 19 August 2016 - 03:27 AM, said:
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..
#1899 Posted 19 August 2016 - 02:56 PM

#1900 Posted 20 August 2016 - 07:44 AM
#1901 Posted 20 August 2016 - 11:33 AM
stumppy84, on 20 August 2016 - 07:44 AM, said:
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
#1902 Posted 23 August 2016 - 04:05 AM
- 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.
#1903 Posted 23 August 2016 - 10:47 AM
RichardStorm, on 23 August 2016 - 04:05 AM, said:
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
#1904 Posted 23 August 2016 - 01:30 PM
#1905 Posted 23 August 2016 - 02:37 PM
Anyway, getting htextra at very top of enemy codes (before states etc) works quite well, many thanks.
But still:
Eduke Wiki of Secrets said:
i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What
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
#1906 Posted 23 August 2016 - 05:26 PM
RichardStorm, on 23 August 2016 - 02:37 PM, said:
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).
RichardStorm, on 23 August 2016 - 02:37 PM, said:
i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What
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).
RichardStorm, on 23 August 2016 - 02:37 PM, said:
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.
#1907 Posted 23 August 2016 - 08:18 PM
Great times!
#1908 Posted 15 December 2016 - 06:21 PM
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?
#1910 Posted 15 December 2016 - 08:46 PM
I put the setsprite THISSPRITE and the xyz coordinates etc.
#1911 Posted 27 December 2016 - 12:17 PM
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
#1912 Posted 01 January 2017 - 08:37 AM
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)
-
testswitch.zip (23.42K)
Number of downloads: 558
This post has been edited by DotK3D: 01 January 2017 - 08:38 AM