EDuke32 Scripting "CON coding help"
#2689 Posted 28 February 2021 - 07:36 AM
#2690 Posted 28 February 2021 - 10:44 AM
#2691 Posted 28 February 2021 - 12:11 PM
Danukem, on 28 February 2021 - 10:44 AM, said:
if that also prevents the weapon firing that might also work, i choose for holster because its a more realistic way of handeling things, you cant hold a 2 handed weapon, ánd a binocular at the same time so holstering seemed like a logical way to handle it. maybe that would be usefull for a sniper rifle, if i decide to add one.
how do i remove the enemy spritepal wen using the NV goggles, tried several things but it seems pretty persistent.
as for the airstrike, i recon making the marker a switch that triggers an activator, but can only be switched on when looking through the binoculars, and perhaps you would also have to be near a radioman, i could use a FPS view of a handy talky but programming that is a bit too advanced for me.
i have found a way to keep the binoculars at 100%
so i figure using it to call an airstrike would immediatly deplete it to 0 to prevent multiple uses, and then recharge it over time and being able to call a new one once it reaches 100%.
been thinking about the other inventory items, and the steroids might just stay as they are, but also add a temporary health boost. thinking about changin it to panzerchocolade, chocolat bars the germans used laced with pervitin ( meth ) so a temporary stat boost combined with a witty comment and a screenpal like purple to simulate a rush.
but im thinking out loud again
[edit] changed the pal to purple for the pervitin, and added some fire for optimal effect, it would be fun if you are on steroids, you can kick someone and send them flying back, or explode like in doom.
[edit]
whats the correct command to initiate the loogie animation? i want to use it to say, draw blood on the screen if the player is under a certain amount of health
found that setting numloogs and loogcnt does display loogies, but does not animate the way they normally do in the game :/
This post has been edited by jimbob: 28 February 2021 - 02:41 PM
#2692 Posted 01 March 2021 - 01:12 PM
ideally i would like to set it up that i can controll exactly how many mortars it shoots, and the timing inbetween actuall shots. this is dirty, but for now it does function, albeit indefinatly.\
looking at it, i suspect resetactioncount also resets count so it never reaches 300, but i need it to reset the angle to random evertime it is about to spawn a mortarline.
action USMORTARFIRE 0 1 1 1 8
action USMORTARLOADING 0 1 1 1 16
useractor notenemy USMORTARSPAWN 0 USMORTARLOADING
cstat 32768
ifaction USMORTARFIRE
ifcount 300 killit
{
ifactioncount 2
{
move 0 0 randomangle
spawn USMORTARLINE
resetactioncount
}
}
ifaction USMORTARLOADING
ifactioncount 120 // when done loading, fire away
{
action USMORTARFIRE // the firing state
}
enda
[edit] resetactioncount seemed to be the culprit, now it starts and stops, though the starting does not respond to the delay i want to set
action USMORTARFIRE 0 1 1 1 16
action USMORTARLOADING 0 1 1 1 16
useractor notenemy USMORTARSPAWN 0 USMORTARLOADING
cstat 32768
ifaction USMORTARFIRE
ifcount 150 killit
{
ifactioncount 2
{
move 0 0 randomangle
ifrnd 64 spawn USMORTARLINE
ifactioncount 40 killit
}
}
ifaction USMORTARLOADING
ifactioncount 120 // when done loading, fire away
{
action USMORTARFIRE // the firing state
}
enda
This post has been edited by jimbob: 01 March 2021 - 01:29 PM
#2693 Posted 01 March 2021 - 02:01 PM
However, any move command applied DOES reset count. So each time you apply "move 0 0 randomangle" that resets the count.
Count is how many tics have passed since the actor got its current move.
#2694 Posted 02 March 2021 - 09:03 AM
#2695 Posted 03 March 2021 - 01:47 PM
anyway, unrelated question, is it possible to have an actor play a music file ( .ogg or midi ) i need this for purposes
#2696 Posted 03 March 2021 - 02:05 PM
jimbob, on 03 March 2021 - 01:47 PM, said:
If you want it to be specifically defined as music and not a sound, then use one of these commands:
https://wiki.eduke32...wiki/Starttrack
#2697 Posted 04 March 2021 - 08:06 AM
i would prefer if it could be used as a sound, what im trying to do is make a functional record player that plays back X amount of musical tracks depending on how often you use it, i could use short samples liek say 30 seconds but even that in half decent audio in WAV requires a lot of space, so if i could play a midi file of .ogg file from that actor as a sound comming from a 'recordplayer' that would be pretty neat.
#2698 Posted 04 March 2021 - 07:36 PM
jimbob, on 04 March 2021 - 08:06 AM, said:
i would prefer if it could be used as a sound, what im trying to do is make a functional record player that plays back X amount of musical tracks depending on how often you use it, i could use short samples liek say 30 seconds but even that in half decent audio in WAV requires a lot of space, so if i could play a midi file of .ogg file from that actor as a sound comming from a 'recordplayer' that would be pretty neat.
Alien Armageddon has a bunch of ogg samples loaded via `definesound` in attcons/ATTDEFS.CON
#2699 Posted 05 March 2021 - 04:15 AM
#2700 Posted 05 March 2021 - 11:35 AM
jimbob, on 05 March 2021 - 04:15 AM, said:
There's not much to look at in AA that would help you make a record player, he was just pointing out that you can use .ogg as a sound format.
A really simple way to do what you want would be to make a separate actor for each individual record and have them spread across a table with the record player in the middle. The player would walk up to the record they want to play, then the record would be an actor with code something like:
useractor notenemy RECORD1 0
ife RECORD1UNLOCK YES
{
cstat 32
ifp palive ifp pfacing ifpdistl 1280 ifhitspace ifcansee
{
stopsound REC2SOUND stopsound REC3SOUND
soundonce REC1SOUND
}
enda
You would make the record sprites start as invisible in mapster, and define the sounds with a large radius so that they seemed to emanate from the entire room. You would declare a global var for each variable (RECORD1UNLOCK, RECORD1UNLOCK, etc) and set them to NO (NO = 0, YES = 0). Then all you have to do code some things in the game to make them turn to YES.
#2701 Posted 05 March 2021 - 12:51 PM
Danukem, on 05 March 2021 - 11:35 AM, said:
A really simple way to do what you want would be to make a separate actor for each individual record and have them spread across a table with the record player in the middle. The player would walk up to the record they want to play, then the record would be an actor with code something like:
useractor notenemy RECORD1 0
ife RECORD1UNLOCK YES
{
cstat 32
ifp palive ifp pfacing ifpdistl 1280 ifhitspace ifcansee
{
stopsound REC2SOUND stopsound REC3SOUND
soundonce REC1SOUND
}
enda
You would make the record sprites start as invisible in mapster, and define the sounds with a large radius so that they seemed to emanate from the entire room. You would declare a global var for each variable (RECORD1UNLOCK, RECORD1UNLOCK, etc) and set them to NO (NO = 0, YES = 0). Then all you have to do code some things in the game to make them turn to YES.
right now i have one record on the gramophone player, the actor has a few tracks you can go to by pressing space, i have it set up like this.
action RECORDTRACK1 0 1 1 1 8
action RECORDTRACK2 0 1 1 1 8
action RECORDTRACK3 0 1 1 1 8
action RECORDTRACK4 0 1 1 1 8
action RECORDSTOPPED 0 1 1 1 8
move RECORDSPINNING 0 0
move RECORDSTOPSPINNING 0 0
useractor notenemy RECORDS 0 RECORDTRACK1
ifaction RECORDTRACK1
{
soundonce BONUSMUSIC
move RECORDSPINNING spin
// ifactioncount 8 action RECORDTRACK1
ifpdistl 2048
ifp palive
ifcansee
ifhitspace
{
ifactioncount 4
action RECORDSTOPPED
}
}
else
ifaction RECORDSTOPPED
{
move RECORDSTOPPED stopsound BONUSMUSIC
ifpdistl 2048
ifp palive
ifcansee
ifhitspace
{
ifactioncount 4
action RECORDTRACK1
}
}
enda
this way i can just make new actions for each track it has to play, and eventually either stop, like i have now, or loop back to track 1
note, the actor is set relative to the floor, so it is flat and spins right round like a record baby.
This post has been edited by jimbob: 05 March 2021 - 12:52 PM
#2702 Posted 07 March 2021 - 03:45 PM
#2703 Posted 16 March 2021 - 05:18 PM
This post has been edited by jimbob: 16 March 2021 - 05:19 PM
#2704 Posted 16 March 2021 - 05:47 PM
#2705 Posted 17 March 2021 - 12:03 AM
Danukem, on 16 March 2021 - 05:47 PM, said:
you are right, i used event_spawn and not EGS :doh:
using event EGS doesnt actually resize the items and enemies
[edit]
placed the whole shebang under event_game and that works flawelessly.
This post has been edited by jimbob: 17 March 2021 - 12:12 AM
#2706 Posted 17 March 2021 - 01:18 AM
You just have to make sure that the actor isn't size 0 0 before you apply your own size to it. For example, instead of using "sizeat 24 24" you would use"ifg sprite[].xrepeat 4 sizeat 24 24"
EVENT_GAME works but the sprite is running that code every single tic, which is not efficient. It may never matter in your project, but enough inefficient code will eventually bog the game down. Also, if you want the actor to be resizable, your EVENT_GAME code has to be written to allow that, because if you are just constantly setting the size in that event it will override whatever size you set in the actor code.
#2707 Posted 17 March 2021 - 04:35 AM
Danukem, on 17 March 2021 - 01:18 AM, said:
You just have to make sure that the actor isn't size 0 0 before you apply your own size to it. For example, instead of using "sizeat 24 24" you would use"ifg sprite[].xrepeat 4 sizeat 24 24"
EVENT_GAME works but the sprite is running that code every single tic, which is not efficient. It may never matter in your project, but enough inefficient code will eventually bog the game down. Also, if you want the actor to be resizable, your EVENT_GAME code has to be written to allow that, because if you are just constantly setting the size in that event it will override whatever size you set in the actor code.
ill put it back in event_spawn with the added fix, i plan on using a ton of enemies, and have them resizing too.
#2708 Posted 21 March 2021 - 08:25 AM
onevent EVENT_DISPLAYREST // rezise ammo health and inventory box. switch sprite[spriteid].picnum case HEALTHBOX gettspr[].tsprxrepeat x div x 2 gettspr[].tsprxrepeat y div y 2 settspr[].tsprxrepeat x settspr[].tspryrepeat y break endswitch // resize hud icons endevent
but no matter where i place it, it doesnt scale the art down half to compensate the larger res art.
#2709 Posted 21 March 2021 - 11:43 AM
For the hud you need to draw your own using rotatesprite and similar command, then you can size and place things however you want. Its a huge pain in the ass to get all the numbers right, though.
#2710 Posted 21 March 2021 - 12:40 PM
[edit] i suppose an easy but dirty fix would be to delete the original art tiles and use rotatesprite to draw a new one scaled to size on the originals position using EVENT_DISPLAYROOMSEND.
heres an image of what i try to do, the bottom ones are the originals, the top what i want, but on the bottom
This post has been edited by jimbob: 21 March 2021 - 12:49 PM
#2711 Posted 21 March 2021 - 02:52 PM
#2712 Posted 21 March 2021 - 11:23 PM
Danukem, on 21 March 2021 - 02:52 PM, said:
i'll look into it today, thanks
#2713 Posted 29 March 2021 - 12:13 PM
#2714 Posted 29 March 2021 - 12:45 PM
Getting seems to work without sets/setw but changing values not so.
Also with sectors you have sector[].floor/ceilingpicnum -- Floors/ceilings do not have their own structs.
#2716 Posted 30 March 2021 - 04:34 AM
oasiz, on 29 March 2021 - 12:45 PM, said:
Getting seems to work without sets/setw but changing values not so.
Also with sectors you have sector[].floor/ceilingpicnum -- Floors/ceilings do not have their own structs.
that seems to work, though i did just a quick test, im going to use this to spawn dirt kicking up when hitting sandy floors etc, much like when shooting water surfaces.

Help
Duke4.net
DNF #1
Duke 3D #1


