EDuke32 Scripting "CON coding help"
#1576 Posted 30 December 2014 - 02:04 AM
This post has been edited by RichardStorm: 30 December 2014 - 02:05 AM
#1577 Posted 30 December 2014 - 05:17 AM
#1578 Posted 03 January 2015 - 02:47 PM
to have a countdown in a map which ends the map, if it's not finished in the given time, has been seen several times. But is it possible to have a countdown for a complete episode (maybe even hub-maps connected) either.
The idea behind this:
a mod, where the player's time is running up to complete a task (or the episode). Best, if the player could go back and forth through the maps by a hub system. After two hours for example the whole game ends if the player hasn't completed the task.
So is something like this possible at all or is this sticker to single maps?
Any suggestions here?
Thank you in advance.
#1579 Posted 03 January 2015 - 03:49 PM
This post has been edited by Mark.: 03 January 2015 - 03:50 PM
#1580 Posted 26 January 2015 - 01:03 AM
#1582 Posted 30 January 2015 - 02:21 AM
Jblade, on 26 January 2015 - 01:03 AM, said:
Bumping because this is a fairly important thing I need to get working.
#1583 Posted 30 January 2015 - 02:27 AM
#1584 Posted 30 January 2015 - 03:13 AM
#1585 Posted 07 February 2015 - 09:23 AM
Jblade, on 26 January 2015 - 01:03 AM, said:
That was implemented in r3666. Can you provide a failing test case?
I checked trueror1.map with
- a liztroop,
- a LIZMANJUMP that jumps higher than normal (by editing the source), and
- the COMMANDER.
All three work fine here.
#1586 Posted 07 February 2015 - 11:13 AM
So if you could, test it with the Drone and Newbeast to see if they work properly in your test map.
#1587 Posted 07 February 2015 - 01:35 PM
Helixhorned, on 07 February 2015 - 09:23 AM, said:
I checked trueror1.map with
- a liztroop,
- a LIZMANJUMP that jumps higher than normal (by editing the source), and
- the COMMANDER.
All three work fine here.
I just uploaded a map called htest.map to the AMC repository - I spawned a liztroop in and it indeed moved no problem but my enemy just raises up and then struggles to move out of the sector. It's possible it may be related to it being a useractor enemy and the liztroop is just a standard actor? I'm using the same kind of checks the liztroop does to move upwards as well.
This post has been edited by Jblade: 07 February 2015 - 01:35 PM
#1588 Posted 20 February 2015 - 03:00 PM
Jblade, on 07 February 2015 - 01:35 PM, said:
The reason the enemy didn't take into account TROR boundaries is that it never issues fall. Unfortunately, this is pretty much the only place that updates actor[].ceilingz and actor[].floorz in a proper fashion for a given sprite. These members are intended as cached versions of the upper and lower bounds for vertical movement. If you search for these members in the EDuke32 source code, you'll find a lot of places where they are set to the sector's ceiling or floor z -- without regard to slope, and now, TROR. My earlier fix (r3666) modified the updating of these members for the COMMANDER and DRONE to consider movement through TROR bunches as well.[1] However, carrying out the same kind of tweak for all other enemies (when moving vertically) in r4975 entailed unwanted behavior: enemies would start moving through blocking sprite constructions (reported by Micky C on IRC, reached me via TX in a PM).
[1]And for upward-moving enemies, but without storing actor[].ceilingz. Actually, that's kind of weird now I think about it. This idea behind that was probably to allow Enforcers jump across bunches. But it seems that the actor's sector number may fail to be updated, then. Needs to be reviewed.
The reason is the above-mentioned proper actor[] .ceilingz and .floorz update, namely using the engine function getzrange. For actors, this is pretty much only called via fall.
The solution I have settled at is to have CON coders issue getzrange themselves whenevery they see fit. In r5016, I added a CON file thisactor_getzrange.con that reimplements EDuke32's hardcoded way of doing that: the initial z position is the actor's one minus 256, and the actor's cstat is temporarily cleared to 0 (to prevent hitting itself). This is only one part of the source's A_GetZLimits(); the other part disables fake floor shadows on hitting a certain class of face sprite below and effects the "sliding" above enemies (regardless of how far away the sprite is above it, actually!). That part was not reproduced.
So, thisactor_getzrange.con is intended to be copied into your mod, includeing it once somewhere and calling "state thisactor_getzrange" where you would issue fall for a falling actor. Note that getzrange() needs to check all sprites in the collected set of sectors for collision -- watch out for quadratic run time. You may also want to call it less frequently than every game tic as a microoptimization, for example every fourth one and only when the actor moves vertically.
#1589 Posted 21 February 2015 - 02:38 AM
#1590 Posted 21 February 2015 - 04:22 AM
#1591 Posted 21 February 2015 - 06:00 AM
Mark., on 21 February 2015 - 04:22 AM, said:
Well I don't actually know if it's more efficient this way, it's just a case of checking to see if a variable is equal to 0, if it is than run the check and set that variable then to something like 5 and take away 1 from it if it doesn't equal 0 to create a basic counter. I think that will do what helix described as only checking every few tics but it might be not as efficient as it could be. I doubt you really need to worry about that anyways unless you're using lots and lots of enemies and lots of sprites in the same sector.
#1593 Posted 24 February 2015 - 02:34 PM
#1594 Posted 24 February 2015 - 02:40 PM
#1596 Posted 24 February 2015 - 03:07 PM
Fox, on 24 February 2015 - 02:40 PM, said:
It's lua, not luna. CON won't be replaced, it'll always be around. But it does seem like lua will ultimately be the more powerful and flexible language (I mean they wouldn't have bothered implementing it if it didn't have significant advantages). So it would be worth learning lua straight up. There's a probably a guide floating around the forum somewhere.
It'd be worth looking up the wiki though, since familiarizing yourself with various aspects of the coding system will give you a leg up when it comes to learning lua for eduke. http://wiki.eduke32.com/wiki/Scripting
#1597 Posted 24 February 2015 - 03:15 PM
#1598 Posted 24 February 2015 - 03:21 PM
#1600 Posted 24 February 2015 - 03:45 PM
DavoX, on 24 February 2015 - 03:21 PM, said:
I lol'd...
The colours and shit are there for a reason...
But yes, notepad++ is what most programmers use.
You would have to be a idiot to try edit with notepad/word.
It removes all the formatting and indentation.
Also, if you want to learn LUA, the best place to start would be to look around the Garry's Mod community.
It's the main coding language used for all the mods/addons.
The structure *should* be identical to how it's used in EDuke32.
This post has been edited by Commander Cody: 24 February 2015 - 03:48 PM
#1601 Posted 24 February 2015 - 04:27 PM
#1602 Posted 24 February 2015 - 04:32 PM
define ROBOTDUDE *tilenumber*
and then you can simply use ROBOTDUDE if you want to refer to that actor in other code.
#1603 Posted 10 March 2015 - 05:16 PM
move BEACHBABEWALKSPEED 70
move BEACHBABERUNSPEED 140
move BEACHBABESHRUNKSPEED 40
move BEACHBABESTOP
action BEACHBABEWALK 0 3 5 1 20
action BEACHBABERUN 0 3 5 1 13
action BEACHBABEFROZE 0 1 5
ai AIBEACHBABEROAM BEACHBABEWALK BEACHBABEWALKSPEED randomangle geth getv
ai AIBEACHBABEWANTDUKE BEACHBABEWALK BEACHBABEWALKSPEED faceplayerslow geth getv
ai AIBEACHBABERUNAWAY BEACHBABERUN BEACHBABERUNSPEED randomangle geth getv
ai AIBEACHBABESHRUNK BEACHBABEWALK BEACHBABESHRUNKSPEED randomangle geth getv
ai AIBEACHBABEGROW BEACHBABEWALK BEACHBABESTOP faceplayerslow
ai AIBEACHBABEFROZEN BEACHBABEFROZE BEACHBABESTOP
ai AIBEACHBABEPOSE BEACHBABEFROZE BEACHBABESTOP
ai AIBEACHBABEFLEE BEACHBABEWALK BEACHBABEWALKSPEED fleeenemy geth getv
state BABEREMARK
ifactioncount 1
{
ifrnd 254 nullop else
{
resetactioncount
ifrnd 1 sound BABECOMM1
else ifrnd 1 sound BABECOMM2
else ifrnd 1 sound BABECOMM3
else ifrnd 1 sound BABECOMM4
else ifrnd 1 sound BABECOMM5
}
}
ends
state BABEHURTREMARK
ends
state BEACHBABEFLEESTATE
state BABEREMARK
ifcount 5
{
ifpdistl 2000
{
ai AIBEACHBABEFLEE
resetcount
break
}
ai AIBEACHBABEWANTDUKE
}
ends
state BEACHBABEROAMSTATE
ifrnd 16 ai AIBEACHBABEROAM
ifcansee
ifpdistl 10000
ifrnd 32
ai AIBEACHBABEWANTDUKE
ends
state BEACHBABEWANTDUKESTATE
ifpdistl 2000 ai AIBEACHBABEFLEE
ifpdistg 10000
ifrnd 32
{
ai AIBEACHBABEROAM
break
}
state BABEREMARK
ends
state BEACHBABERUNAWAYSTATE
ifactioncount 1
{
resetactioncount
ifrnd 2 sound BABESCREAM1
else ifrnd 2 sound BABESCREAM2
else ifrnd 2 sound BABESCREAM3
else ifrnd 2 sound BABESCREAM4
}
ifrnd 16 ai AIBEACHBABERUNAWAY
ends
state BEACHBABESTATE
fall
cstator 257
state babechecksquished
ifai 0
{
ifrnd 64 sound BABECOMM1
else ifrnd 85 sound BABECOMM2
else ifrnd 128 sound BABECOMM3
else sound BABECOMM4
ai AIBEACHBABEROAM
}
ifvare vaca_pose 1
{
ai AIBEACHBABEPOSE
break
}
ifai AIBEACHBABEPOSE ai AIBEACHBABEROAM
ifai AIBEACHBABESHRUNK
{
ifcount SHRUNKDONECOUNT
{
ai AIBEACHBABERUNAWAY
cstat 257
}
else
{
ifcount SHRUNKCOUNT sizeto 40 40
else state genericshrunkcode
}
}
else ifai AIBEACHBABEGROW
{
ifcount 32
{
state stopbeachbabebathersounds
respawnhitag
guts JIBS4 20
guts JIBS6 20
// guts JIBS4 20
// guts JIBS6 20
spawn EXPLOSION2
sound PIPEBOMB_EXPLODE
// spritepal 6
soundonce BABESCREAM4
// debris SCRAP3 4
sound SQUISHED
killit
}
else
{
sizeto MAXXSTRETCH MAXYSTRETCH
break
}
}
ifai AIBEACHBABEFROZEN
{
ifhitweapon
{
ifwasweapon FREEZEBLAST
{
strength 0
break
}
lotsofglass 30
sound GLASS_BREAKING
respawnhitag
ifrnd 84 spawn BLOODPOOL
killit
}
else
{
ifp pfacing
ifpdistl FROZENQUICKKICKDIST
pkick
}
ifcount THAWTIME
{
getlastpal
ai AIBEACHBABERUNAWAY
}
else
ifcount FROZENDRIPTIME
ifactioncount 26
{
spawn WATERDRIP
resetactioncount
}
}
ifhitweapon
{
sound SQUISHED
ai AIBEACHBABERUNAWAY
ifdead
{
ifwasweapon GROWSPARK
{
cstat 0
move 0
sound ACTOR_GROWING
ai AIBEACHBABEGROW
break
}
else ifwasweapon FREEZEBLAST
{
ai AIBEACHBABEFROZEN
move 0
spritepal 1
strength 0
sound SOMETHINGFROZE
break
}
state stopbeachbabebathersounds
ifrnd 128 sound DUKE_HIT_STRIPPER1 else sound DUKE_HIT_STRIPPER2
respawnhitag
// state standard_bjibs
state standard_bjibs
state random_wall_jibs
spawn BLOODPOOL
// spritepal 6
soundonce BABESCREAM4
killit
}
else
{
ifwasweapon SHRINKSPARK
{
sound ACTOR_SHRINKING
move 0
ai AIBEACHBABESHRUNK
cstat 0
break
}
else
{
guts JIBS6 1
}
// else ifwasweapon GROWSPARK sound EXPANDERHIT
}
}
/*
ifdead
{
state standard_bjibs
sound SQUISHED
killit
}
*/
ifai AIBEACHBABEROAM state BEACHBABEROAMSTATE
else ifai AIBEACHBABEWANTDUKE state BEACHBABEWANTDUKESTATE
else ifai AIBEACHBABERUNAWAY state BEACHBABERUNAWAYSTATE
else ifai AIBEACHBABEFLEE state BEACHBABEFLEESTATE
ends
useractor notenemy BEACHBABE1 BEACHBABESTRENGTH BEACHBABEWALK
state BEACHBABESTATE
enda
#1604 Posted 11 March 2015 - 12:28 AM
ifvare vaca_pose 1
{
ai AIBEACHBABEPOSE
break
}
What is this? Vars are an eduke thing; the original Vacation did not have them.
If vaca_pose is set to 1, that will cause the sprite to do that ai and break, so that would make it freeze (since the ai in question doesn't move).
#1605 Posted 11 March 2015 - 01:33 PM
BEACHBAB.CON:
Edukelog:

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


