Passing Actors to Global Subroutine

Non-platform specific questions.

Passing Actors to Global Subroutine

Postby jazz_e_bob » Thu Oct 28, 2004 3:41 am

I have a collision event script.

The script includes Physical Response and some other stuff.

The same code is used in many places.

Can I somehow pass the event and collide actors to a global routine for processing?

( Quick example if possible. :) )

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Thu Oct 28, 2004 12:19 pm

You can use the actions with "Event Actor" and "Collide Actor" names inside global code.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Thu Oct 28, 2004 7:42 pm

:)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby jazz_e_bob » Tue Jan 18, 2005 12:40 am

So...

In global code I can use:

Actions with "Event Actor" and "Collide Actor" names.

I can assign and read parameters to and from event and collide actors.

BUT I can't assign and read user vars to and from event and collide actors.

:(

Please tell me this is an easy fix. :) :wink:

Image

I still think it might be nice to be able to pass actors to global code...

GE RULES!
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Tue Jan 18, 2005 6:21 pm

If you have an actor variable lives, for example, in your global code you can use like other variable in Script Editor:

lives = lives + 1;

Will update the Event Actor lives var.

collide.lives = collide.lives + 1;

Will update de Collide Actor lives var.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Tue Jan 18, 2005 9:31 pm

:oops:

I thought I tested this and it didn't work.

It does work!

Sorry to trouble you!

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest