Small Triggers/Scripting Preview

Keep up with the exciting discoveries of our scientists, researchers and developers.

Small Triggers/Scripting Preview

Postby null » 15 Aug 2009, 21:15

Image

Image

Image

Code: Select all
function testOnEnter(trigger, ent)
    trigger:setMaterial("red")
end

function testOnExit(trigger, ent)
    trigger:setMaterial("green")
end


Scripting is done via Lua. The possibilities are endless ;) The above is only a small test with triggers Q:)
OS: Windows XP Pro 32bit / Arch Linux 64bit; CPU: AMD Athlon64 X2 4800+; RAM: 2GB; Graphics card: Nvidia 8800 GTS 320MB
User avatar
null
Developer
Developer
 
Posts: 500
Joined: 28 Apr 2008, 23:17

Re: Small Triggers/Scripting Preview

Postby Eriksrocks » 15 Aug 2009, 21:30

Very nice. Will all the custom LUA be saved in a file that goes along with the level? :)
Erik

OS: Windows Vista Home Premium / openSUSE 32-bit; CPU: Intel Pentium 4 2.8 GHz; RAM: 1.5GB DDR; Graphics card: ATI Radeon HD 2600 XT.
OS: Windows XP MCE; CPU: Intel Pentium D 805 2.66 GHz; RAM: 3GB DDR2; Graphics card: Nvidia 8800 GT 512MB OC.
User avatar
Eriksrocks
Tester
Tester
 
Posts: 465
Joined: 13 Aug 2008, 05:59

Re: Small Triggers/Scripting Preview

Postby Gran PC » 15 Aug 2009, 21:30

That's pretty awesome! When can we expect a release? :) Also, can the Lua files be compiled?
OS: Windows XP SP3 (32-bit) / Ubuntu 9.04 (32-bit); CPU: Intel P4 (2) @ 3GHz; RAM: 1 GB; GPU: Intel Corporation 82865G Integrated Graphics Controller (rev 02)
OS: Windows XP SP3 (32-bit) / Ubuntu 8.10 (32-bit); CPU: AMD Athlon LE-1600 (64-bit) @ 2.21 GHz; RAM: 1 GB; GPU: nVidia GeForce 6100
OS: Debian Lenny (64-bit); CPU: AMD Semprom @ 1.6 GHz (64-bit); RAM: 895 MB; GPU: nVidia GeForce 6100
Each line is a computer. I have more, btw. Ask me for the specs if you want them.
Gran PC
Void Appearance
Void Appearance
 
Posts: 6
Joined: 10 Aug 2009, 09:25

Re: Small Triggers/Scripting Preview

Postby null » 15 Aug 2009, 21:33

Eriksrocks wrote:Very nice. Will all the custom LUA be saved in a file that goes along with the level? :)

Yeah, each level will have it's own Lua script for all the triggers/events/etc.

Gran PC wrote:That's pretty awesome! When can we expect a release? :) Also, can the Lua files be compiled?

Release: look around on the forums and the main site, we've mentioned it about 10^10000000 times by now. And the Lua files are currently not compiled, makes things a lot easier. Perhaps later on we can add support for compiled Lua files.
OS: Windows XP Pro 32bit / Arch Linux 64bit; CPU: AMD Athlon64 X2 4800+; RAM: 2GB; Graphics card: Nvidia 8800 GTS 320MB
User avatar
null
Developer
Developer
 
Posts: 500
Joined: 28 Apr 2008, 23:17

Re: Small Triggers/Scripting Preview

Postby Gran PC » 15 Aug 2009, 21:38

null wrote:
Gran PC wrote:That's pretty awesome! When can we expect a release? :) Also, can the Lua files be compiled?

Release: look around on the forums and the main site, we've mentioned it about 10^10000000 times by now.

I was asking if there's a closer estimate other than "before the end of summer".
OS: Windows XP SP3 (32-bit) / Ubuntu 9.04 (32-bit); CPU: Intel P4 (2) @ 3GHz; RAM: 1 GB; GPU: Intel Corporation 82865G Integrated Graphics Controller (rev 02)
OS: Windows XP SP3 (32-bit) / Ubuntu 8.10 (32-bit); CPU: AMD Athlon LE-1600 (64-bit) @ 2.21 GHz; RAM: 1 GB; GPU: nVidia GeForce 6100
OS: Debian Lenny (64-bit); CPU: AMD Semprom @ 1.6 GHz (64-bit); RAM: 895 MB; GPU: nVidia GeForce 6100
Each line is a computer. I have more, btw. Ask me for the specs if you want them.
Gran PC
Void Appearance
Void Appearance
 
Posts: 6
Joined: 10 Aug 2009, 09:25

Re: Small Triggers/Scripting Preview

Postby ColeScheffler » 15 Aug 2009, 22:16

Gran PC wrote:
null wrote:
Gran PC wrote:That's pretty awesome! When can we expect a release? :) Also, can the Lua files be compiled?

Release: look around on the forums and the main site, we've mentioned it about 10^10000000 times by now.

I was asking if there's a closer estimate other than "before the end of summer".

I'm guessing it will probably be in the first half of September, unless they decide that they should postpone the release as far as possible, on September 22nd...lol

Anyways, this looks like pretty much anyone will be able to do this kind of simple stuff, but I'm sure you can go super-advanced if you know the Lua. ;)

But wait, what do the OnEnter and OnExit boxes in the properties window do? Owait, whenever something is touching it, onEnter is activated?
Gaming: OS: Windows 7 64-bit, Ubuntu x86_64 with KDE 4.3; CPU: Intel Core2Duo e8400 @ 3.5Ghz; RAM: 4GB DDR2; GPU: XFX 9800GT.
Mobile: OS: Windows XP 32-bit, Linux (soon); CPU: Intel Atom N270 @ 1.66GHZ; RAM: 1GB DDR2; GPU: Intel GMA 950.
User avatar
ColeScheffler
Intermediary Appearance
Intermediary Appearance
 
Posts: 151
Joined: 28 Jun 2009, 20:58
Location: Harlan, Iowa

Re: Small Triggers/Scripting Preview

Postby Eriksrocks » 15 Aug 2009, 22:34

ColeScheffler wrote:But wait, what do the OnEnter and OnExit boxes in the properties window do? Owait, whenever something is touching it, onEnter is activated?

onEnter is triggered when something collides with the trigger, onExit is triggered when that object stops colliding with the trigger. Basically, when something enters the collision box of the trigger, and when it leaves the collision box of the trigger. :)
Erik

OS: Windows Vista Home Premium / openSUSE 32-bit; CPU: Intel Pentium 4 2.8 GHz; RAM: 1.5GB DDR; Graphics card: ATI Radeon HD 2600 XT.
OS: Windows XP MCE; CPU: Intel Pentium D 805 2.66 GHz; RAM: 3GB DDR2; Graphics card: Nvidia 8800 GT 512MB OC.
User avatar
Eriksrocks
Tester
Tester
 
Posts: 465
Joined: 13 Aug 2008, 05:59

Re: Small Triggers/Scripting Preview

Postby Frizi » 15 Aug 2009, 22:37

oh! i love triggers :D
anybody maybe known jass from warcraft 3? :>

what features have this implementation? You can change entity properties, how about bulid-in collision detection (or something like that)?

@edit:
oh... nice :D
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Re: Small Triggers/Scripting Preview

Postby null » 15 Aug 2009, 22:49

Frizi wrote:what features have this implementation? You can change entity properties, how about bulid-in collision detection (or something like that)?

You can do anything from the trigger callback. The most common operations would probably be modifying the entity that caused the trigger to activate, doing something in the scene based on a specific entity entering a specific trigger, etc.
OS: Windows XP Pro 32bit / Arch Linux 64bit; CPU: AMD Athlon64 X2 4800+; RAM: 2GB; Graphics card: Nvidia 8800 GTS 320MB
User avatar
null
Developer
Developer
 
Posts: 500
Joined: 28 Apr 2008, 23:17

Re: Small Triggers/Scripting Preview

Postby Frizi » 15 Aug 2009, 22:58

it is possible to affect all entities matching specific condition (or just all) on trigger executing?
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Re: Small Triggers/Scripting Preview

Postby null » 15 Aug 2009, 23:12

Frizi wrote:it is possible to affect all entities matching specific condition (or just all) on trigger executing?

Well right now the only way to fetch a specific entity is to get it from the game world via gameWorld:get("someEntity").
OS: Windows XP Pro 32bit / Arch Linux 64bit; CPU: AMD Athlon64 X2 4800+; RAM: 2GB; Graphics card: Nvidia 8800 GTS 320MB
User avatar
null
Developer
Developer
 
Posts: 500
Joined: 28 Apr 2008, 23:17

Re: Small Triggers/Scripting Preview

Postby Frizi » 15 Aug 2009, 23:22

then if you can add (:D) gameWorld:get("EntityType".All), only for events ofc, for actions maybe loops like foreach on all/selected/manipulated/activated or something else objects
or just method GetAllEntities (list or array).
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Re: Small Triggers/Scripting Preview

Postby null » 15 Aug 2009, 23:28

I can add something like that, but the question is when you would need to grab all of the entities (even of a specific type)? I can think of a million reasons to want to grab some specific entity(s) when an event is trigger, but I can't think of any reason you'd want to do something to all the entities.
OS: Windows XP Pro 32bit / Arch Linux 64bit; CPU: AMD Athlon64 X2 4800+; RAM: 2GB; Graphics card: Nvidia 8800 GTS 320MB
User avatar
null
Developer
Developer
 
Posts: 500
Joined: 28 Apr 2008, 23:17

Re: Small Triggers/Scripting Preview

Postby BionicCryonic » 16 Aug 2009, 02:43

Frizi wrote:it is possible to affect all entities matching specific condition (or just all) on trigger executing?


This could provide some badass timing events. Imagine two blocks, fixated to the air, or something. They can't move. They are sloped, and one is perpendicular to the other, a short distance away. They have special collide triggers, and link to a whole other bunch of world stuff. Anyways, a ball rolls from the first one on to the next, goes through a portal, and back onto the first one. Infinate loop, lus pulsating trigger-age.

Could be cool.
OS: Macintosh OS X 10.0.5 | CPU: 1GB RAM, 1920x1200 Pixel Resolution | Video Card: GMA 950 - 64 MB VRAM

PM me if you want anything, I'm always open.
User avatar
BionicCryonic
Void Appearance
Void Appearance
 
Posts: 13
Joined: 22 Jun 2009, 01:07

Re: Small Triggers/Scripting Preview

Postby FlyingHonda » 16 Aug 2009, 11:17

Nice, I check this from my iPod at the airport... C:-) IM'A THINKIN OF THE POSSIBILITIES!
OS: Mac OSX 10.6.1 W00T! Snow Leopards Here! / Windows XP; CPU: 2.53 Intel Core 2 Duo; RAM: 4gb 1067 MHz DDR3 RAM; HDD 250gb 7200 RPM; GFX: Nvidia 9400m 256mb integrated;
User avatar
FlyingHonda
Temporary Appearance
Temporary Appearance
 
Posts: 37
Joined: 20 Jun 2009, 02:58

Re: Small Triggers/Scripting Preview

Postby Frizi » 16 Aug 2009, 15:56

hmm...
i dont know lua (currently ;P), then it is python like pseudocode:

for object in (all object in map of type sphere):
   if object.x >= 0:
      object.setMaterial("red")
   else:
      object.setMaterial("green")

this is really easy example, you may need get count of all object on whole map or specific area (ex. -10 < x < 10, -5 < y < 7, 1 < x 112).

you may create new data structure "objectgroup" for loops and returns specific object on every iteration ;)
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Re: Small Triggers/Scripting Preview

Postby TiagoTiago » 16 Aug 2009, 20:14

what about somthing kinda like sending a message and having the intended group of object each be listening for that message and run their own code when they hear it?


btw, is Lua capable of polymorphism? (code that modify itself or can replace itself with a modified version of itself)
(some typos survive longer than the edit button does, sorry)
OS: Windows XP Pro SP3; CPU: P4 3Ghz with HT; RAM: 3072MB; Graphics card: NVIDIA GeForce 7300GT; 2 CRT monitors, 1280x1024 max each
somtimes reply notifications don't work for me, pls PM me if you think that has happened
TiagoTiago
Arrived Appearance
Arrived Appearance
 
Posts: 513
Joined: 25 Aug 2008, 13:08

Re: Small Triggers/Scripting Preview

Postby Frizi » 16 Aug 2009, 20:51

polymorphism is not self-modificated code :O
http://en.wikipedia.org/wiki/Polymorphi ... rogramming
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Re: Small Triggers/Scripting Preview

Postby TiagoTiago » 16 Aug 2009, 21:28

really? erm....oops

edit:I oculd swear I had heard someone use "polymorphism" to describe viruses that mutate themselves, oh well, the meaning I waws going for is "being able to modify itself"
(some typos survive longer than the edit button does, sorry)
OS: Windows XP Pro SP3; CPU: P4 3Ghz with HT; RAM: 3072MB; Graphics card: NVIDIA GeForce 7300GT; 2 CRT monitors, 1280x1024 max each
somtimes reply notifications don't work for me, pls PM me if you think that has happened
TiagoTiago
Arrived Appearance
Arrived Appearance
 
Posts: 513
Joined: 25 Aug 2008, 13:08

Re: Small Triggers/Scripting Preview

Postby Svenstaro » 16 Aug 2009, 21:38

LUA is able to do all the fancy object orientation stuff of any other scripting language and as such it supports polymorphism. As Frizi pointed out, polymorphism is not self-modyfing code, polymorphism is overriding methods on inherited objects.
OS: Windows 7 64bit / Arch Linux x86_64; CPU: Intel Core Quad 3.2 Ghz; RAM: 8GB; Graphics card: Nvidia 8800 GTX 768MB
Portalized Steam Community Group
User avatar
Svenstaro
Developer
Developer
 
Posts: 820
Joined: 28 Apr 2008, 22:34
Location: Germany

Re: Small Triggers/Scripting Preview

Postby TiagoTiago » 16 Aug 2009, 21:49

ok, it wasn't exactly what I was thinking, but somewhat close: http://en.wikipedia.org/wiki/Polymorphic_code
(some typos survive longer than the edit button does, sorry)
OS: Windows XP Pro SP3; CPU: P4 3Ghz with HT; RAM: 3072MB; Graphics card: NVIDIA GeForce 7300GT; 2 CRT monitors, 1280x1024 max each
somtimes reply notifications don't work for me, pls PM me if you think that has happened
TiagoTiago
Arrived Appearance
Arrived Appearance
 
Posts: 513
Joined: 25 Aug 2008, 13:08

Re: Small Triggers/Scripting Preview

Postby deathlord » 17 Aug 2009, 20:17

very nice and easy
partially easier and better than some editors of commercial games
E8600@4Ghz|Watercooling - Kingston-800-DDR2 Ram - GTX280 - Gigabtye ga-x48-ds4 - vista ultimate 32bit :( , archlinux :)
deathlord
Temporary Appearance
Temporary Appearance
 
Posts: 25
Joined: 01 May 2009, 09:14
Location: Germany

Re: Small Triggers/Scripting Preview

Postby Phosfor » 17 Aug 2009, 20:47

I hate the triggers in hammer becouse they are so complicated for some advanced mapping (switching lights is easy but then...)

this is a good idea(scriptinglanguage + triggers) which solves the problems in a good way i think.

only "non-programmers" could get problems
OS: Windows Vista 32bit / Ubuntu 64bit;
CPU: Intel Core 2Duo: 2.66 Ghz;
RAM: 4GB;
Graphics card: Nvidia Geforce 8600GS 256MB
User avatar
Phosfor
Intermediary Appearance
Intermediary Appearance
 
Posts: 141
Joined: 16 Aug 2009, 12:57
Location: Germany

Re: Small Triggers/Scripting Preview

Postby ColeScheffler » 17 Aug 2009, 20:56

Phosfor wrote:I hate the triggers in hammer becouse they are so complicated for some advanced mapping (switching lights is easy but then...)

this is a good idea(scriptinglanguage + triggers) which solves the problems in a good way i think.

only "non-programmers" could get problems

Luckily Lua is a very easy scripting language to learn, and doesn't take long to get all of the basics down.
Gaming: OS: Windows 7 64-bit, Ubuntu x86_64 with KDE 4.3; CPU: Intel Core2Duo e8400 @ 3.5Ghz; RAM: 4GB DDR2; GPU: XFX 9800GT.
Mobile: OS: Windows XP 32-bit, Linux (soon); CPU: Intel Atom N270 @ 1.66GHZ; RAM: 1GB DDR2; GPU: Intel GMA 950.
User avatar
ColeScheffler
Intermediary Appearance
Intermediary Appearance
 
Posts: 151
Joined: 28 Jun 2009, 20:58
Location: Harlan, Iowa

Re: Small Triggers/Scripting Preview

Postby Frizi » 18 Aug 2009, 10:10

partially easier and better than some editors of commercial games

see jass: http://www.wc3jass.com/index.php?scripts=1
jass is compilated to bytecode on map loading, what about LUA in Portalized?
OS: Windows XP Home SP2
CPU: Intel Pentium Dual Core E2108 on 3.33GHz
RAM: Kingston HyperX Black Edition 1GB
VGA: GeForce 7600GS (1680x1500)
Frizi
Temporary Appearance
Temporary Appearance
 
Posts: 39
Joined: 18 Jun 2009, 23:00

Next

Return to News

Who is online

Users browsing this forum: No registered users and 1 guest

cron