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

Jump to content

  • 124 Pages +
  • « First
  • 46
  • 47
  • 48
  • 49
  • 50
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Mark 

#1400

I tried 4351 and the intro screens returned, the end of level scoring screen remains, the duke reloading his shotgun screen is gone, and the TEN and some other screens appear at the end now.

This post has been edited by Mark.: 20 January 2014 - 05:11 PM

0

User is offline   Helixhorned 

  • EDuke32 Developer

#1401

View Postpmw, on 20 January 2014 - 12:23 PM, said:

Any advice how to to do a continuous earthquake?
Like, sprite which activates world's shaking and wouldn't ever stop it - until the map changes.

Is it hard-coded function, or what? I have no ideas where to look at.

CON's quake, besides starting the EARTHQUAKE sound, merely sets an unexposed timer to the provided value, which is then decremented every game tic. So, you could code an actor that simply issues quake at certain intervals. Another option would be initializing the quake timer to a huge value, but since it's currently an unsigned 16-bit integer, you'd have at most 65535/30/60 = approx. 36 minutes of quake then.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1402

View PostMark., on 20 January 2014 - 04:55 PM, said:

I'm not sure if I used your info properly or not. I saw that LOGO_FLAGS was considered a gamevar so at the beginning of my defs.con file I added in

gamevar LOGO_FLAGS 0 4096

right after a bunch of other gamevars. What happens is that instead of bypassing the E1 ending screen, the game's loading screens at the beginning are bypassed and the menu appears directly. A handy feature but not what I was expecting. Did I do something wrong on my end?

Yeah, maybe I should have a bit more explicit in the commit log -- the bits are 4096, 8192, 16384 and 32768, for disabling the the four episode ending scenes, respecitvely. LOGO_FLAGS as a CON gamevar is a strange thing: if you don't define it using gamevar, it maintains its default value of 255. That's documented on the wiki, by the way.
0

User is offline   pmw 

#1403

View PostHelixhorned, on 21 January 2014 - 08:28 AM, said:

CON's quake, besides starting the EARTHQUAKE sound, merely sets an unexposed timer to the provided value, which is then decremented every game tic. So, you could code an actor that simply issues quake at certain intervals. Another option would be initializing the quake timer to a huge value, but since it's currently an unsigned 16-bit integer, you'd have at most 65535/30/60 = approx. 36 minutes of quake then.


Sounds OK. But if I change quake timer's value to huge one, isn't it gonna affect to all *quakes* on my game?
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1404

The effect of "quake <somevalue>" is like this:

play EARTHQUAKE
g_earthquakeTime = <somevalue>

So, issuing quake simply unconditionally sets the timer to a new value.

Taking another look at the source code, what you should be worried about is g_earthquakeTime being set from C code. This happens on the following occasions:

- detonating a SEENINE or OOZFILTER
- when a DUKECAR or HELECOPT (sic) explodes
- on activation of an SE2, obviously
0

User is offline   Jblade 

#1405

Would there be a way to disable an enemy's speed being affected by a projectile? at the moment melee monsters are rendered trivial by fast-firing weapons, I was thinking of how to change that so only high-damage projectiles actually stop it. I haven't taken a crack at it yet but I'm just asking here if anybody else has experimented with it.

This post has been edited by James: 10 March 2014 - 06:03 AM

0

User is online   Danukem 

  • Duke Plus Developer

#1406

View PostJames, on 10 March 2014 - 06:03 AM, said:

Would there be a way to disable an enemy's speed being affected by a projectile? at the moment melee monsters are rendered trivial by fast-firing weapons, I was thinking of how to change that so only high-damage projectiles actually stop it. I haven't taken a crack at it yet but I'm just asking here if anybody else has experimented with it.


I wasn't aware that projectiles stopped monsters, unless the monsters are CON coded to flinch from getting hit. So yeah, I would just code them to only flinch if the damage is over a certain percentage of their hit points.

EDIT: IIRC, the default game code actually makes monsters get pulled towards the player when they get hit. This is one of those things that can be changed in CON, and which you may have changed already, by messing with the monster's xvel or using movesprite on them after an impact.

This post has been edited by Trooper Dan: 10 March 2014 - 12:03 PM

0

User is offline   Jblade 

#1407

No, they definitely do - if you use a chaingun and shoot at a newbeast it can't move forward at all. I've just looked at their code and there's no code telling them to stop moving when hit.

This post has been edited by James: 10 March 2014 - 12:05 PM

0

User is online   Danukem 

  • Duke Plus Developer

#1408

View PostJames, on 10 March 2014 - 12:05 PM, said:

No, they definitely do - if you use a chaingun and shoot at a newbeast it can't move forward at all. I've just looked at their code and there's no code telling them to stop moving when hit.


OK, I'm assuming that you have already verified that the newbeast isn't stopping because of its flinching. It could be that those little movements forward involve it's xvel constantly getting reset every time it is hit -- that would explain it. So what I would do is, save its xvel in a variable each tic when it is not getting hit. When it is hit, set the xvel to the stored variable. I hope that made sense.
0

User is offline   Jblade 

#1409

I'll give that a try and see how it goes, hopefully it's not something too hardcoded into the game engine.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1410

It's hard-coded game functionality. Writing a test enemy which only seeks the player,
Spoiler

and setting a watchpoint on sprite[number_known_from_the_map].xvel shows that the culprit is in sector.c:A_DamageObject().
Spoiler

This function is one of the things that could use some form of scripting interfacing, so that its effects could be selectively disabled.
1

User is offline   Jblade 

#1411

View PostHelixhorned, on 10 March 2014 - 01:30 PM, said:

It's hard-coded game functionality. Writing a test enemy which only seeks the player,
Spoiler

and setting a watchpoint on sprite[number_known_from_the_map].xvel shows that the culprit is in sector.c:A_DamageObject().
Spoiler

This function is one of the things that could use some form of scripting interfacing, so that its effects could be selectively disabled.

Thanks for clearing it up, maybe a new spriteflag could be added to disabe that or something?

This post has been edited by James: 10 March 2014 - 01:43 PM

0

User is offline   Kyanos 

#1412

setplayer[THISACTOR].over_shoulder_on 1

I'm using this as a little hack for a map effect in Link3D. Basically F7 is locked out and over the shoulder view is only accessible once the player has the map. My problem is that when I use the map in one level and switch back to another it doesn't work anymore. It's like it uses old coordinates from the previous level? maybe? Does anyone have any idea why this behaves like this? I've tried reading through some source code to no avail. I've run debug.exe it didn't provide anything useful either.
0

User is online   Danukem 

  • Duke Plus Developer

#1413

I'm having some trouble understanding your post. Are you saying the effect works fine in one map (you can turn it on and off with no problem) but when you try to use the effect again in another map, it shows the player from invalid coordinates?? There must a lot more going on here than the one line of code you are showing.
0

User is offline   Kyanos 

#1414

Yeah, it works fine. Then works fine in the next map too. Then is glitchy once I go back to the first map. I use the savemapstate command too. And event enterlevel plus more mess.
0

User is online   Danukem 

  • Duke Plus Developer

#1415

Are you basing your map caching code on the code I wrote for WGR2?

EDIT: Anyway, from what you have said, I would guess it has something to do with how you are using the loadmapstate command.

This post has been edited by Trooper Dan: 12 March 2014 - 07:07 PM

0

User is offline   Kyanos 

#1416

code...
Spoiler

To answer your question, yes it is based off WGR2 code, but without the pdestination stuff and se 67s, you come back to the map at the point that you exited. The 64 count timer stops going straight back to reload the original map.

edit: added spoiler

This post has been edited by Drek: 12 March 2014 - 08:01 PM

0

User is offline   Kyanos 

#1417

View PostTrooper Dan, on 12 March 2014 - 06:56 PM, said:

Are you basing your map caching code on the code I wrote for WGR2?

EDIT: Anyway, from what you have said, I would guess it has something to do with how you are using the loadmapstate command.

Exactly. What would the old mapstate have in it that I can manually edit to fix this?
0

User is online   Danukem 

  • Duke Plus Developer

#1418

View PostDrek, on 12 March 2014 - 07:12 PM, said:

To answer your question, yes it is based off WGR2 code, but without the pdestination stuff and se 67s, you come back to the map at the point that you exited. The 64 count timer stops going straight back to reload the original map.


That's what's puzzling me. The code you posted doesn't change the player's position at all, so I don't see how the coords could get messed up.

Does the problem occur the moment the player reenters a map? And what exactly is happening? Did you try DNDEBUG and look at the results (e.g. where the player is on the map).
0

User is offline   Kyanos 

#1419

The problem is triggerable by pressing alt fire while holding the map. Hence Bbutton 5 being forced while over the shoulder is on, so you can switch back. Yes it is like this any time after using the effect in one map, then trying to do it again in another.

The maps in question are just different variations of themselves. Each has overworld and dungeons in same location, with starting points being what makes them different. I can plainly see that the over the shoulder on starts where I did it last in the previous map, it (the f7 camera) will "float" or "travel" to where I am now and eventually with many on / off switches begin to work properly again... sometimes, or gets stuck in level geometry, player never dies. I will see what DNDEBUG says.
0

User is online   Danukem 

  • Duke Plus Developer

#1420

View PostDrek, on 12 March 2014 - 07:58 PM, said:

The problem is triggerable by pressing alt fire while holding the map. Hence Bbutton 5 being forced while over the shoulder is on, so you can switch back.


Well then it sounds like the crucial part of the code is probably the code associated with pressing alt fire, which you didn't post...
0

User is offline   Kyanos 

#1421

ok, there is this code too.
Spoiler

I made a quick video. The only way to describe it short of sharing the tc with you. Which I'm willing to do too. I can pack it up neat tomorrow.
https://www.mediafir...g4lf3j1sxxt5ljk here is my sample video, 4 mins 41 MB, shows off a few weapons and effects too.
0

User is online   Danukem 

  • Duke Plus Developer

#1422

Kickass TC you've got there :blink:

But please, please increase Link's walking speed!

As for the bug....looking at the video, it's pretty clearly a problem with the camera positioning, and I don't think you have posted the relevant code. I think you are messing with the camera vars (camerax, cameray, cameraz, cameresect, camderadist). Perhaps you have saved values from a different map, and when you switch to the external cam it is starting from those saved values and the code isn't able to get the camera to a sane position.

EDIT: Try putting the camera vars in your savegamevar/readgamevar routines. Especially your own camera vars, since the ones I mentioned get updated automatically.

This post has been edited by Trooper Dan: 12 March 2014 - 08:41 PM

1

User is offline   Kyanos 

#1423

Thanks.
I'm looking into the camera vars today, but you assumed wrong, I never once manually setup a camera. It is all seen from the perspective of Dukes first person view, with [THISACTOR].ang, and .horiz being forced within certain limits. It's as if the world and link exist down at his feet, very hackish IMO, yet simple and effective.

I'm sure that by playing with the camera vars you mention I'll be able get this world map effect working proper. Still it doesn't explain why my F7 view hack is not working atm, which is irrelevant really.

Thanks again. And yes, Link will be faster.

Added:
I simply added a few lines to log the camera vars when the map gets turned off and on, definitely found the issue with those camera vars. It's logging camerasect as -1 when it's glitchy for me.
Spoiler




Added more: I gave up using over_shoulder_on and just manually coded the same effect by moving the camera. It's actually better this way because it is customizable now.

This post has been edited by Drek: 13 March 2014 - 03:51 PM

0

User is offline   Mblackwell 

  • Evil Overlord

#1424

That's a known bug with over_shoulder_on. At least known to me... it's been that way since forever and basically locks out forcing over_shoulder_on to 1. Something internally must get toggled when pushing F7.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1425

View PostDrek, on 13 March 2014 - 06:15 AM, said:

CONLOGVAR: L=741 camerasect (Global) =-1 (this is where the cam is, switched map OFF)

When the third person view is in effect, 3072 is subtracted from the player's z position, after which a hitscan() is issued to determine the ultimate camera position. The initial subtraction may get the camera into void space in very cramped situations, like in the "appended" space ship in E2L1. With revision 4369, when this happens, we try to determine the camera position a second time without the subtraction. This may or may not be the cause for your trouble, but my experiments in said space ship have shown that under Polymer, the outside view tends to be drawn less frequently then (still remaining possible though).
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1426

View PostJames, on 10 March 2014 - 01:42 PM, said:

Thanks for clearing it up, maybe a new spriteflag could be added to disabe that or something?

Added with r4371.

For actors that you define yourself, usage from CON would be with the spriteflags directive. If you want to modify existing actor's behavior, it gets a little tricky though. The spriteflags directive (i.e. translation-time command) is "destructive" in the sense that it overwrites the previous actor flags with the passed value. This is in contrast to other sprite* directives like spritenoshade, which bitwise-OR them in. So if you wanted to remove the damage-pushing behavior for the newbeast, you'd have to issue "spriteflags 4610 SFLAG_NODAMAGEPUSH" before its definition in GAME.CON. This rules out its usage with mutators, as these get translated after the regular CON files.

In Lunatic, we can have this:
-- Add NODAMAGEPUSH flag to NEWBEAST.
gameactor { D.NEWBEAST, AF.chain_end + AF.NODAMAGEPUSH, function() end }


Edit: corrected "spriteflags SFLAG_NODAMAGEPUSH" --> "spriteflags 4610 SFLAG_NODAMAGEPUSH"
1

User is offline   Hendricks266 

  • Weaponized Autism

  #1427

Why not

onevent EVENT_PREGAME
ifactor NEWBEAST
{
getactor[THISACTOR].htflags temp
orvar temp SFLAG_NODAMAGEPUSH
setactor[THISACTOR].htflags temp
}
endevent

0

User is offline   Kyanos 

#1428

Is it possible to load a savegame via con? I find it odd that save 9 works but load 9 is an error. I can't seem to figure out how Eduke prompts to load the last save when the player dies, I want the same effect. I've tried simply addphealth -999 to kill the player and prompt edukes load game system, it didn't work, also I've set dead_flag to a few non 0 values.

How can I script "load last save y/n?" for my TC like eduke32 does running Duke3D?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1429

For htflags or mdflags, I prefer to set it once during LOADACTOR and EGS.

View PostDrek, on 15 March 2014 - 02:01 PM, said:

Is it possible to load a savegame via con? I find it odd that save 9 works but load 9 is an error. I can't seem to figure out how Eduke prompts to load the last save when the player dies, I want the same effect. I've tried simply addphealth -999 to kill the player and prompt edukes load game system, it didn't work, also I've set dead_flag to a few non 0 values.

How can I script "load last save y/n?" for my TC like eduke32 does running Duke3D?

I think you need to use resetplayer command. Keep in mind it works differently in multiplayer, and ti simply respawn the player...

This post has been edited by Fox: 15 March 2014 - 02:04 PM

1

Share this topic:


  • 124 Pages +
  • « First
  • 46
  • 47
  • 48
  • 49
  • 50
  • 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