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

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

  • 85 Pages +
  • « First
  • 78
  • 79
  • 80
  • 81
  • 82
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,686

#2371

View PostForge, on 01 October 2018 - 03:17 PM, said:

there should be - nuances and all.
It's something a lot of first time script modders aspire to do. That and new enemies. Modified huds and equipment items are probably high on the wish-list as well.


I feel somewhat responsible for this, especially since I started a tutorial on making new enemies and then didn't finish it (although I still could). I have two excuses, and neither of them is very good. The first excuse is that time spent writing the tutorial is coming straight out of the time I would otherwise be spending getting a project closer to release (recently that has been AA and now an AA update). The second excuse is that, with both enemies and weapons, it's better for the tutorial if it's as generic as possible. But I'm not interested in making generic enemies and weapons. So I would have to make a special, more generic enemy or weapon just for the purpose of the tutorial.

The reason why non-generic is bad is it always involves bringing in techniques and features that will be confusing as hell to someone trying to learn. If you look at the aforementioned enemy tutorial that I stopped working on, that was pretty much the reason. It was getting to the part on the cyber-enforcer where I would have to explain how to make it jump from long distance onto its target.
0

User is offline   Forge 

  • 8,276

#2372

View PostMark, on 01 October 2018 - 03:36 PM, said:

But some ways are more time efficient than others.

technically you won't be 'wrong', or 'stupid'. Just inefficient.
Inefficient is better than none.
Again. the information can be updated.

Posted Image
0

User is offline   Forge 

  • 8,276

#2373

View PostTrooper Dan, on 01 October 2018 - 03:38 PM, said:

The reason why non-generic is bad is it always involves bringing in techniques and features that will be confusing as hell to someone trying to learn.

Start with the base generic script
make an advanced section and update sporadically when it's convenient or a question gets answered.
0

User is offline   Mark 

  • Honored Donor
  • 2,843

#2374

I didn't realize a new page started. I added to my post on the previous page. DUH.
0

User is offline   Forge 

  • 8,276

#2375

View PostMark, on 01 October 2018 - 03:54 PM, said:

I didn't realize a new page started. I added to my post on the previous page. DUH.

If you don't want to do it, don't do it. Nobody else is stepping up, so you're in good company.
1

User is online   Micky C 

  • Honored Donor
  • 3,749

#2376

View PostHendricks266, on 01 October 2018 - 01:18 PM, said:

I don't consider the current state of CON coding functionality to be sufficient for new users to learn easily. Everything is bespoke and ad hoc to the extreme. About the only good ways to learn how to do things are to look at existing code or to ask publicly and have it spoonfed to you. Even then, you end up with every mod having its own versions of boilerplate like weapon drawing functions that can never be modified by improved source port development without updating the mod, and which require the source port to painfully maintain old, flawed ways of doing things.


Was Lua meant to be the solution? Helixhorned gave the impression that it was going to be a sort of clean slate for coding, in addition to the con system.

If so, would that system be worked on and finished at some point?

Polymer wishlist: Global illumination, SSAO, Bloom, reflective surfaces, adjustable specular (wetness), volumetric lighting.
Mapper of the Month December 2014.

Herbs? Tell me more!

This post has been edited by Micky C: 01 October 2018 - 04:31 PM

0

User is offline   Hendricks266 

  • Weaponized Autism
  • 6,356

  #2377

View PostMicky C, on 01 October 2018 - 04:31 PM, said:

Was Lua meant to be the solution? Helixhorned gave the impression that it was going to be a sort of clean slate for coding, in addition to the con system.

If so, would that system be worked on and finished at some point?

Lunatic was fundamentally misplaced. Helixhorned wanted to rewrite Duke 3D's game logic in Lua, and Lua would suck for that purpose. It's on the to-do list to torch all of Lunatic except the language bindings.
0

User is offline   MusicallyInspired 

  • 3,369

#2378

I was wondering why nothing was happening with Lunatic and nobody was using it.

Roland SC-55 Music Packs
Latest release: Heretic SC-55 Music Pack (12/12/18)
*new* Buy the Mage's Initiation Original Soundtrack on Bandcamp by me!
Buy the P&C Adventure/RPG game Mage's Initiation on Steam, GOG, and Humble
0

User is offline   Zaxtor 

  • 1,594

#2379

Is there such a code to make a "kill tile" for monsters.

Like for duke, purplelava, ordinarylava, slime hurts you.

but is there a code to make if a monster walks into a sector(number) or floor tile(number) it kills them etc?

So I can make if a monster falls into the lava (accidentally) or etc, they die

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website
0

User is offline   Mblackwell 

  • Evil Overlord
  • 872

#2380

Yes, within an actor's code get/setsector[THISACTOR] will be the sector the current actor is standing in. So:
iffloordistl 1 // if on the ground
{
    getsector[THISACTOR].floorpicnum TEMP // the sector's floor tile
    ifvare TEMP MYHURTTILE // MYHURTILE should be whatever tile number you want to hurt the enemy
    {
        getactor[THISACTOR].extra TEMP // extra is enemy health
        ifvarg TEMP 0
            subvar TEMP 1
        setactor[THISACTOR].extra TEMP
    }
}


would probably do it for a quick and dirty version.

Music: The Rejected Applications (listen now)
EDuke32 || EDuke32 Wiki || Latest EDuke32 Snapshots
I'm getting too old for this shit...
1

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,686

#2381

I don't think that will trigger monster death, though, since "ifdead" checks are typically inside of "ifhitweapon" checks. This might work better for the damage code:

setactor[THISACTOR].htextra 1
setactor[THISACTOR].htpicnum MYHURTILE 


Setting htpicnum isn't really necessary, but it could be useful because it will make ifwasweapon return the lava picnum.
0

User is offline   Zaxtor 

  • 1,594

#2382

It works.
Actor died when he gets (near the killable floor) diff height or not. (like in red line or between the 2 sectors). so translated, he dies without touching the lavafloor except if he flies over it.
lavasector is a mask based floor (one seen in the pics I posted on the thread of my map im working on)

So I changed it into "getsector[THISACTOR].ceilingpicnum TEMP"

and tile numb in var below etc
And when he falls inside the killable sector (lava sector with lava ceiling) he dies cuz of the "hurtable ceiling" inside the lava sector.

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website

This post has been edited by Zaxtor: 01 October 2018 - 10:11 PM

0

User is offline   December Man 

  • 61

#2383

View PostHank, on 01 October 2018 - 03:20 PM, said:

Looks to me you guys just volunteered to update that wiki.

Just ask questions here, and once settled, add to the wiki. :)


That'd be great... if I knew what these events even do.
0

User is offline   thisbecasper 

  • 1

#2384

DELETED

This post has been edited by thisbecasper: 03 October 2018 - 09:32 AM

0

User is offline   Perro Seco 

  • 237

#2385

View PostTrooper Dan, on 30 September 2018 - 03:18 PM, said:

I think some people get caught up on the convenience of the vending machine and never learn how to cook. If you are making a mod that has non-trivial coded features, you should learn how to cook.
Hey, you talking to me? I'm a professional chef and glasses of water are my speciality. :D

View PostTrooper Dan, on 29 September 2018 - 06:59 AM, said:

As for why it's not working when you set posx and posy, it could be because you aren't setting the sector but I think it's more likely something else which is blocking your attempt. The first thing I would check is make sure that Lezing's bike code is not setting the player's coords at that point, since it could be overriding your attempt. Also, you should verify 100% that you have calculated the new coordinates correctly. You can do a visual confirmation by espawning a sprite there and setting it to those coordinates; do so in F7 view mode so that you can see it in game and verify it is in the right place.
Thank you for your help. You were right, I was changing the player's position and sector correctly, but below there were some lines interfering with the operation. However, I found a problem when changing posx and posy: the player can be moved through invisible blocking walls.

But I found another way to do it: spawning two invisible sprites when the player exits the car and moving one to the left and the other to the right. If one of them hits a wall, I delete it, and then I set the player position to one of those sprites, preferably to the left unless the sprite was deleted.

Posted Image
1

User is offline   thisbecasper 

  • 1

#2386

In my zombies I use randvar to randomly generate loot and powerups. It has been working fine for a long time but recently I think it's causing more and more desyncs (net_randomsynccheck out of sync). Is there a safe alternative to generate a random number used in multiplayer, or do you guys know other things that can cause desyncs without it being mentioned in the wiki?
0

User is offline   Hendricks266 

  • Weaponized Autism
  • 6,356

  #2387

Randvar is supposed to be the multiplayer-safe way to get random numbers. The unsafe versions are called displayrand*. The issue may be that you are calling it different numbers of times on different hosts.
1

User is offline   thisbecasper 

  • 1

#2388

View PostHendricks266, on 07 October 2018 - 10:43 AM, said:

Randvar is supposed to be the multiplayer-safe way to get random numbers. The unsafe versions are called displayrand*. The issue may be that you are calling it different numbers of times on different hosts.

In 5 out of 6 places it is used in newbeastcode when they die. The sixth place is when one player gets revived by another, then he calls randvar and uses it to speak a random line (is that what you mean by one duke calling it different amount of times than another, in one tick?) Or else I'm afraid you'll have to elaborate what you mean with "different hosts". Very helpful response indeed!

This post has been edited by thisbecasper: 07 October 2018 - 11:27 AM

0

User is offline   Hendricks266 

  • Weaponized Autism
  • 6,356

  #2389

I would recommend adding the "addlog" command immediately before every randvar, and then comparing the eduke32.log of two players who go out of sync.
0

User is offline   thisbecasper 

  • 1

#2390

View PostHendricks266, on 07 October 2018 - 11:31 AM, said:

I would recommend adding the "addlog" command immediately before every randvar, and then comparing the eduke32.log of two players who go out of sync.

Great idea! Before though? Wouldn't it desync if the randvar is different between two players right after it is set and used?
0

User is offline   Hendricks266 

  • Weaponized Autism
  • 6,356

  #2391

Hmm, I was thinking "addlog" as in just tracking the positions of calls that are made, but "addlogvar" of the resulting value after the randvar call could not hurt and might provide further information.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,988

#2392

View Postthisbecasper, on 07 October 2018 - 08:32 AM, said:

In my zombies I use randvar to randomly generate loot and powerups. It has been working fine for a long time but recently I think it's causing more and more desyncs (net_randomsynccheck out of sync). Is there a safe alternative to generate a random number used in multiplayer, or do you guys know other things that can cause desyncs without it being mentioned in the wiki?

Can you post the code?
0

User is offline   Mark 

  • Honored Donor
  • 2,843

#2393

I want to have an enemy that when you get close will either ( do something ) if the player is not holding any weapon or will ( do something else ) if they are holding any weapon. How do I have that enemy detect if the player is holding a weapon?

This post has been edited by Mark: 09 October 2018 - 11:49 AM

0

User is offline   Perro Seco 

  • 237

#2394

View PostMark, on 09 October 2018 - 11:48 AM, said:

I want to have an enemy that when you get close will either ( do something ) if the player is not holding any weapon or will ( do something else ) if they are holding any weapon. How do I have that enemy detect if the player is holding a weapon?
This may help: https://wiki.eduke32.../Holster_weapon

But I'm not sure if you're talking about hidding a weapon with the holster weapon key or hidding it by selecting the kick. In the second case it will work if you check the player's weapon with this: https://wiki.eduke32...iki/Curr_weapon

Posted Image
1

User is online   Sanek 

  • 635

#2395

View PostMark, on 09 October 2018 - 11:48 AM, said:

I want to have an enemy that when you get close will either ( do something ) if the player is not holding any weapon or will ( do something else ) if they are holding any weapon. How do I have that enemy detect if the player is holding a weapon?


Isn't there a feature like that in TekWar? I don't remember exactly, but cops and citizens have a certain reaction either to a shooting or a weapon holding.


This post has been edited by Sanek: 09 October 2018 - 12:06 PM

0

User is offline   Mark 

  • Honored Donor
  • 2,843

#2396

I can probably make use of the CURRENT_WEAPON feature. Thanks.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,988

#2397

delete

This post has been edited by Fox: 09 October 2018 - 12:11 PM

0

User is offline   Mark 

  • Honored Donor
  • 2,843

#2398

Working with structs is one of my many weak points in con coding. I'll attempt to trial and error my way through it first before asking for help. ;)
0

User is online   Sanek 

  • 635

#2399

I need a one-line, one-time message that will appear on the screen when player enter the room. What is the most effortless way to make it? Can it be tied to a sound?
I'm speaking of the small messages that appear in the upper half of the screen.
0

User is online   conoklast 

  • 29

#2400

I've started dipping my feet into .CON coding, so there's a chance I'll be posting here regularly and making a nuisance of myself :D

Anyway - I thought I'd start with breakable actors.. specifically I want to make my own breakable walls (like the W_TECHWALL actors)

However I can only get the code to function as a sprite; when the tile is applied to a wall it doesn't respond. I'm just using the basic code from the edukewiki;

define OFFICEWALL 7684 //office wall
define OFFICEWALLBR 7685 //office wall damaged

useractor notenemy OFFICEWALL
 cstat 257
ifwasweapon RADIUSEXPLOSION
{
 sound VENT_BUST
 debris SCRAP1 4
 cactor OFFICEWALLBR
 }

0

Share this topic:


  • 85 Pages +
  • « First
  • 78
  • 79
  • 80
  • 81
  • 82
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password


Sign in options