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

Jump to content

  • 124 Pages +
  • « First
  • 67
  • 68
  • 69
  • 70
  • 71
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Zaxtor 

#2030

neither has it.
Was gonna pic the arctic still pic, didn't work but scrapped it.

Ending is pretty long tho so is ok.
0

User is offline   Zaxtor 

#2031

when you lockplayer xx
it says (except the ability to look up/down with the mouse)
is there a locking code to temporarily lock mouse movements too?
0

User is offline   Mark 

#2032

This is from a conversation I had with someone not too long ago that might get you started in the right direction.
"you should setplayer[THISACTOR].weapon_pos 1 and also setplayer[THISACTOR].jumping_counter 0
and maybe setinput[].horz 0 maybe even setinput[].bits 0
should keep the player from doing anything when lockplayer is active
firing a gun or jumping
looking up and down
etc"
0

User is offline   Zaxtor 

#2033

with lock player during scene jump, weaps items, movement etc wont work (as suppose to)
i tried with horz and bits (inside player) no workin
like setinput[THISACTOR].horz 0
and other so nothing happens

This post has been edited by Zaxtor: 26 August 2017 - 01:24 PM

0

User is offline   Mblackwell 

  • Evil Overlord

#2034

This won't make much sense but:
http://wiki.eduke32.com/wiki/On_crane

...is the thing set by "lockplayer". So you can probably check in EVENT_PROCESSINPUT if that is set and then do your canceling.
1

User is offline   Zaxtor 

#2035

Crane thing and other wont work..
mouse auto aiming looks around but when I lockplayer etc, can still look and down but not around so is only up and down I need to disable.
So mouse aiming up and down is what I need to disable, it somewhat disabled diagonal, sideway etc not up and down.
it reenable looking around with mouse, weap etc after event / cutscene are over

only up and down cant figure how to disable, iv tried everything

This post has been edited by Zaxtor: 29 August 2017 - 02:22 PM

0

User is offline   Zaxtor 

#2036

UPDATE!!!
Made it work... finally, thx
0

User is offline   Mark 

#2037

Please let the rest of know what you did to solve the problem. Thanks.
0

User is offline   Zaxtor 

#2038

used the thing in
http://wiki.eduke32....NT_PROCESSINPUT

onevent EVENT_PROCESSINPUT
getinput[THISACTOR].avel turning
getinput[THISACTOR].horz mouselook

ifvarn turning 0 setinput[THISACTOR].avel 0
ifvarn mouselook 0 setinput[THISACTOR].horz 0
endevent

(actually atm using 2 comps to do that)
1 to go online, post and read etc

and other to work on duke mod v2 etc
cuz Im at my aunt on vacation and helping with her yard etc. and my comp does not support wireless internet (wifi etc)
so I use her laptop for net etc

so makes things slightly harder

This post has been edited by Zaxtor: 29 August 2017 - 06:41 PM

1

User is offline   Darkus 

#2039

How I make my bot use the 'quick kick' command with 'setinput' rather than using the 'pkick' command?

With this code, I can make my bot jump, crouch down, and press use, but for unknown reason, I can't make it use the quick kick:

onevent EVENT_PROCESSINPUT
  ifvare boting 1
  {
    ifvarg stucktime 5
    { getinput[THISACTOR].bits temp1
      ifvaror temp1 4194304
      { orvar temp1 4194304 setinput[THISACTOR].bits temp1 }
    }
  }
endevent


It's also the same thing for some commands, like activating inventory items.
0

User is online   Danukem 

  • Duke Plus Developer

#2040

View PostDarkus, on 05 October 2017 - 11:44 AM, said:

It's also the same thing for some commands, like activating inventory items.


Yeah, I have the same problem. A lot of the actions cannot be activated by setting the input bits. The most frustrating case is weapon switching, since forcing it by setting other structs can lead to glitches.

I tried setting quick_kick to 1, hoping that it would work like setting kickback_pic to 1 and cause the sequence to continue automatically. But it didn't -- you can try it and see.
1

User is offline   Darkus 

#2041

Well, I tried this and it seems to work:

onevent EVENT_PROCESSINPUT
  ifvare boting 1
  {
    ifvarg stucktime 5
    { ifvarl player[THISACTOR].quick_kick 1 { setplayer[THISACTOR].quick_kick 15 quote 80 }
    }
  }
endevent


Managed also to make it use some inventory items using the same way, except for the portable medkit. Look like I must code it myself.
1

User is online   Danukem 

  • Duke Plus Developer

#2042

View PostDarkus, on 05 October 2017 - 01:32 PM, said:

Well, I tried this and it seems to work:

onevent EVENT_PROCESSINPUT
  ifvare boting 1
  {
    ifvarg stucktime 5
    { ifvarl player[THISACTOR].quick_kick 1 { setplayer[THISACTOR].quick_kick 15 quote 80 }
    }
  }
endevent


Managed also to make it use some inventory items using the same way, except for the portable medkit. Look like I must code it myself.


So apparently it does work kind of like kickback_pic, except that it counts backwards! This is helpful, thanks.

The medkit is actually the only inventory item that I have coded for my bot, so I didn't notice that some of them could be activated with bits.
0

User is offline   Darkus 

#2043

Is there a way to read the listed flags from Definegametype?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #2044

View PostDarkus, on 07 October 2017 - 11:40 AM, said:

Is there a way to read the listed flags from Definegametype?

userdef[].gametypeflags
1

User is offline   Darkus 

#2045

Another problem which I don't know if I'm wrong or EDuke is bugging.

I want the dead players resurrect automatically by pressing the use key.
I made a sample, it works in single player, but it fail in multiplayer:

gamevar botai 0 1

onevent EVENT_GAME
  ifactor APLAYER
  { ifp pdead setvar botai 1 // dead?
	else setvar botai 0
  }
endevent

onevent EVENT_PROCESSINPUT
  ifvare botai 1 setinput[THISACTOR].bits 536870912 // press space
endevent


I tried to replace ifp pdead by ifdead, I have similar results, but it still does not work like it should.
0

User is online   Danukem 

  • Duke Plus Developer

#2046

I'm not sure about why there is a single/multi player difference, but I know I had a similar issue until I realized that I was telling the game to hold space, when I should have been telling it to tap space.

So what I do is this:

ifl sprite[].extra 1
{
	ifvarand botbits 536870912 xorvar botbits 536870912 else
	orvar botbits 536870912
}


Then bits is set to botbits in EVENT_PROCESSINPUT
0

User is offline   Darkus 

#2047

I think it's really a bug, for me EDuke is setting variables to the wrong players. Tapping or pressing the use key seems to have no importance.
For example I started a coop game with 8 players (no bots, only the sample code), I killed all of them to see the results, some randomly resurrect and the others wont (sometimes nobody resurrect). I even was affected by the bug, when suddenly I could no longer shoot at them.

Another example I got, I started my test map with 2 players (first controlled myself and one bot controlled), I followed him, then at one moment, he suddently stopped moving for no reason. When I looked his variables, it was in his 'dead' state, and keeping the use key pressed.

I checked my code and only one line could put him in this state. When I removed this line (ifvarl sprite[].extra 1) the problem was gone.

I have the same results by replacing the line with 'ifdead'.

As for 'ifp pdead', look like it's only affecting the first player. All of these issues are not appearing in single player.
0

User is offline   Darkus 

#2048

Double post: can't edit anymore?

I think I find out the problem:
During the execution of the code, it check the conditions for all the players, but take actions on closest 'living' players.

I tested with this:

onevent EVENT_GAME
  ifactor APLAYER
  { ifaction PEXPLODEAD resetplayer
  }
endevent


Start a 2 players game, blow up the second player, and the player one will keep reseting. Similar thing happen when there are more players, after blowing up some players, the others keep reseting near the dead ones.
2

User is offline   Jenz/Amaka 

#2049

I have five questions :rolleyes:

1st
I've replaced episode starting video with custom one. Sounds work but how do I stop menu music playing during the video?
Here's the code from .def
animsounds START0.ivf { 1 252  50 244 }


.con
onevent EVENT_NEWGAME
    // Only trigger when we come from the skill select menu
    ifvare current_menu 110
    {
        switch VOLUME
            case 0 // episode 1
                redefinequote 254 START0.ivf
                startcutscene 254
                break
            case 1 // episode 2
                redefinequote 254 START0.ivf
                startcutscene 254
                break
            case 2 // episode 3
                redefinequote 254 START0.ivf
                startcutscene 254
                break
        endswitch
    }
endevent


2nd
How to duplicate BLOODPOOL but with different texture? As in, Duplicate working exactly like the BLOODPOOL but with different texture.

3rd
How to make Actors(Palm Trees in this case) that "sort" of work the same as Dolphins in Ep.4. When shot with specific weapon(RPG) it changes to another texture, and when shot again it changes texture again until it reaches final stage when it simply turns to texture that cannot be interacted any further.

4th
I have several new health items that can be picked up by the player but when enemies dies they just simply spawn on floor instead of falling. How do I make it that when enemy dies, the item flies off to random direction? Kinda like how the jibs work.
Currently I simply use SPAWN NewHealthItem1.

5th
How to make custom TV screen breakable?
1

User is offline   Hendricks266 

  • Weaponized Autism

  #2050

1. Put "stopallmusic" before startcutscene.

2. Currently we don't have any sort of inheritance, so you'll have to use a trick. First, you'll need to create a per-actor gamevar like "bloodpooltype". Then,

espawn BLOODPOOL
setactorvar[RETURN].bloodpooltype 1 // or 2, or 3, etc. if you have multiple types


Now there are two ways you can do things.

I'm not sure if this first way will work, but it's simpler. Create an action with an offset from BLOODPOOL to your new tilenum, and apply it to BLOODPOOL actors in EVENT_GAME if their bloodpooltype is the right non-zero value.

The second way is to add "setactor[RETURN].mdflags 16" to the code above, and use EVENT_ANIMATESPRITES to "settspr[THISACTOR].tsprpicnum <your new picnum>" on BLOODPOOL actors. If you do this, you may want to make "bloodpooltype" be the picnum itself instead of 1, 2, 3.

3. Doing this is simple in practice, but hard to explain unless you're familiar with the concept of a finite state machine. Basically, your actor will have some kind of state (unrelated to the CON concept of "state" meaning a subroutine) that can be changed, and it will need to do different things based on that state. The simplest way is to create two new actions for your 2nd and 3rd states (you get the first one for free with "ifaction 0"):

action APalmTree2 1
action APalmTree3 2

useractor notenemy MyPalmTree
    ifaction 0
    {
        ifhitweapon
        {
            action APalmTree2
        }
    }
    else ifaction APalmTree2
    {
        ifhitweapon
        {
            action APalmTree3
        }
    }
    else ifaction APalmTree3
    {
        ifhitweapon
        {
            killit
        }
    }
enda


You can also add "ifwasweapon" inside the ifhitweapon if you only want it to respond to a certain one. Similarly, if you would like it to need to take more than a single point of damage to change state, you can add a strength to the actor, use an "ifdead" condition to check when it has been depleted, and use the "strength" command when setting a new action to set the new necessary value.

4. The easiest way to do this is to shoot a custom projectile that you create with defineprojectile. You can create one projectile for each pickup and set each one's PROJ_SPAWNS accordingly, or you can create a single projectile,

eshoot MyMobilePickup
setthisprojectile[RETURN].spawns MyPickupTilenum


and use EVENT_ANIMATESPRITES to set its .tsprpicnum to its projectile spawn.

5. I need to create an EVENT_DAMAGEWALL. Others may tell you to use a hack they have come up with, but you should not.
3

#2051

Hi there! I'm often playing with my friend and I have recently started studying coding and such. I want to make a gun-game mod to play online. I have a couple of question though: Will it work without eduke but instead through hduke or xduke maybe? Is it achievable by just editing the con files? Here's my thoughts: I would first like to make rpg-objects bounce like the freezeblast (this has nothing to do with the mod) - i cant even find the code for the freezebounce. In the mod i was thinking unlimited ammo, which should be hard to get a workaround on, and then a weapon switch on multiplayer kill. So, lets say you start out with the pistol, you get a kill, then you get the shotgun and so on... so what do you say guys?
PS I KNOW that this will be hard, but I love to learn, so just a little hint will be helpful!
0

User is online   Danukem 

  • Duke Plus Developer

#2052

View PostHendricks266, on 12 October 2017 - 08:22 AM, said:

The second way is to add "setactor[RETURN].mdflags 16" to the code above, and use EVENT_ANIMATESPRITES to "settspr[THISACTOR].tsprpicnum <your new picnum>" on BLOODPOOL actors. If you do this, you may want to make "bloodpooltype" be the picnum itself instead of 1, 2, 3.


I can attest that this is generally more readable and reliable than using actions with big offsets, especially if you want to display alternate pictures for a variety of different things in the game, some of which may not work well with actions.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #2053

View Postthisbecasper, on 12 October 2017 - 08:41 AM, said:

Hi there! I'm often playing with my friend and I have recently started studying coding and such. I want to make a gun-game mod to play online. I have a couple of question though: Will it work without eduke but instead through hduke or xduke maybe? Is it achievable by just editing the con files? Here's my thoughts: I would first like to make rpg-objects bounce like the freezeblast (this has nothing to do with the mod) - i cant even find the code for the freezebounce. In the mod i was thinking unlimited ammo, which should be hard to get a workaround on, and then a weapon switch on multiplayer kill. So, lets say you start out with the pistol, you get a kill, then you get the shotgun and so on... so what do you say guys?
PS I KNOW that this will be hard, but I love to learn, so just a little hint will be helpful!

Unfortunately, most of your ideas are only possible with EDuke32's advanced scripting capabilities, which are not present in any other port. You should be able to do most of what you want using the OldMP branch.

1. Making RPGs bounce: You'll need to create an entirely custom projectile with defineprojectile and set the BOUNCESOFFWALLS flag on it.

2. Unlimited ammo: Trivial, as simple as setting each player's ammo_amount to the maximum in actor APLAYER.

3. Weapon grants on kills: This one will require some bookkeeping in the right places to count kills and execute code when the value changes, and reset it to zero when you're killed (if I understand correctly).
0

#2054

View PostHendricks266, on 12 October 2017 - 09:29 AM, said:

Unfortunately, most of your ideas are only possible with EDuke32's advanced scripting capabilities, which are not present in any other port. You should be able to do most of what you want using the OldMP branch.

1. Making RPGs bounce: You'll need to create an entirely custom projectile with defineprojectile and set the BOUNCESOFFWALLS flag on it.

2. Unlimited ammo: Trivial, as simple as setting each player's ammo_amount to the maximum in actor APLAYER.

3. Weapon grants on kills: This one will require some bookkeeping in the right places to count kills and execute code when the value changes, and reset it to zero when you're killed (if I understand correctly).


What language is it coded in? if you can say that...
I want to make my own enemy, so how do I insert new files to load from the art files? I guess I need some sort of program to view and edit those files.
Also: what does the these lines do:

action MYENEMY_ANIMATIONS 0 3 1 1 4 // order of the numbers and meaning of the number itself?
move MYENEMY_SPEEDS 64 // the only thing that makes sense to change here is 64 i guess, so moving along

ai AIMYENEMY_BOUNCE MYENEMY_ANIMATIONS MYENEMY_SPEEDS geth randomangle //"AIMYENEMY_BOUNCE" is this defined somewhere to be some sort of move pattern?

This post has been edited by thisbecasper: 13 October 2017 - 03:24 AM

0

#2055

View Postthisbecasper, on 13 October 2017 - 02:44 AM, said:

I want to make my own enemy, so how do I insert new files to load from the art files? I guess I need some sort of program to view and edit those files.

I've found "Build ART Files Editor" so I think im good on this one :rolleyes:
OH! What about a modification to a weapon like this: It shoots 3 bullets at a time in succesion - like an Assault rifle in burst mode, with lets say the pistol dmg and sound. After the burst it cant shoot for like 0,3-0,5 seconds (otherwise it would just be a normal pistol i guess). A nice and almost crucial thing to add is that you should not be able to hold down the shoot button, but instead tap the trigger/button in order to shoot with the weapon continously - is it achievable??? :excl:

This post has been edited by thisbecasper: 13 October 2017 - 04:39 AM

0

User is offline   Mark 

#2056

http://wiki.eduke32.com/wiki/Main_Page
0

#2057

View PostMark., on 13 October 2017 - 04:47 AM, said:


Thank you!
0

#2058

View PostMark., on 13 October 2017 - 04:47 AM, said:



Now i've tried a couple of things in order to achieve an rpg projectile that bounces.

//First try
defineprojectile 1660 PROJ_WORKSLIKE 32774
defineprojectile 1660 PROJ_SPAWNS EXPLOSION2
defineprojectile 1660 PROJ_VEL 1000
defineprojectile 1660 PROJ_EXTRA 300
defineprojectile 1660 PROJ_ISOUND PIPEBOMB_EXPLODE
defineprojectile 1660 PROJ_HITRADIUS 2560
defineprojectile 1660 PROJ_BOUNCES 5
defineprojectile 1660 PROJ_OFFSET 14354
defineprojectile 1660 PROJ_CLIPDIST 24
defineprojectile 1660 PROJ_TRAIL SMALLSMOKE


//Second try
//setprojectile[2605].bounces 32774
//setprojectile[2605].workslike

ofc it wont work because im missing something, but i dont see where. In the DEFS.CON ive changed "define RPG 2605" to "define RPG 1660" for the first try.
0

User is offline   Zaxtor 

#2059

My mod has a projectile that bounces off of walls and makes a trail that hurts you.
Works similar to RPG because when it shoots it autoaim the target (player).
Will bounce a few times and vanish.
Projectile will be destroyed if it hits the player.

For case of RPG you can replace the trail by the "smallsmoke trail"

This post has been edited by Zaxtor: 13 October 2017 - 10:02 AM

0

Share this topic:


  • 124 Pages +
  • « First
  • 67
  • 68
  • 69
  • 70
  • 71
  • 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