Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 942 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Action not found #72440
04/28/06 16:24
04/28/06 16:24
Joined: Sep 2002
Posts: 199
Chicago, Illinois
Thehawk Offline OP
Member
Thehawk  Offline OP
Member

Joined: Sep 2002
Posts: 199
Chicago, Illinois
Hello,

Where do I add actions to a script when I'm loading a new level?

I'm currenty calling the load level function, but after the level is loaded, I get an "Action_X" not found message.

Thank you in advance. Let me know if this is unclear.

Re: Action not found [Re: Thehawk] #72441
04/28/06 16:29
04/28/06 16:29
Joined: Sep 2003
Posts: 2,174
Israel, Haifa
ROMAC Offline
Expert
ROMAC  Offline
Expert

Joined: Sep 2003
Posts: 2,174
Israel, Haifa
You have function main which is a function that is called when the engine starts. In there you need to call level_load(level_name)
Actions are defined outside of the function anywhere in the code, they look like this:
Code:

action test
{
// code goes here
while (1)
{
wait(1);
}
}


You can't make an action inside a function, it must be outside, anywhere you want.

Re: Action not found [Re: ROMAC] #72442
04/28/06 16:30
04/28/06 16:30
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
a common mistake is to place functions/actions OVER the main function, which also results in a action not found.

you must place it AFTER the main function in order to make it work correctly


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Action not found [Re: Michael_Schwarz] #72443
04/28/06 16:32
04/28/06 16:32
Joined: Sep 2003
Posts: 2,174
Israel, Haifa
ROMAC Offline
Expert
ROMAC  Offline
Expert

Joined: Sep 2003
Posts: 2,174
Israel, Haifa
Quote:

a common mistake is to place functions/actions OVER the main function, which also results in a action not found.

you must place it AFTER the main function in order to make it work correctly




That shouldn't be a problem. Placing actions/functions over the main function is fine, you do it all the time when you use include.

Re: Action not found [Re: ROMAC] #72444
04/28/06 16:36
04/28/06 16:36
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Quote:

Quote:

a common mistake is to place functions/actions OVER the main function, which also results in a action not found.

you must place it AFTER the main function in order to make it work correctly




That shouldn't be a problem. Placing actions/functions over the main function is fine, you do it all the time when you use include.




actually, when I place a action over the main function it gives me the same error... could be a unique problem for me though


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Action not found [Re: Michael_Schwarz] #72445
04/28/06 17:03
04/28/06 17:03
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
I've never had a problem when placing functions over Main. I always do this.

However the orginal quesiton is not answered.

I think you need to make a script, and from there put in your actions. If you have done this then you have not connected the script with that level. If you have done both of these make sure that you have spelled the name of your action correctly.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Action not found [Re: FoxHound] #72446
04/28/06 19:58
04/28/06 19:58
Joined: Sep 2002
Posts: 199
Chicago, Illinois
Thehawk Offline OP
Member
Thehawk  Offline OP
Member

Joined: Sep 2002
Posts: 199
Chicago, Illinois
Thanks for all of your replies. Foxhound you are closer to the solution to my problem. I've tried to create a script seperate from my main level. These included all the actions and functions than I would need for the second level of the game. (Where the player goes after stepping through the teleporter in level 1)

the script looks like this:

Code:
 action level_change
{
my.event = impact;
my.function = Load_level;
}

function load_level

{
if blah blah blah
{
load_level (levelname.wmb)
/*The tutorial i used said to place any actions for the next level after that level's loading function... which would be here
*/

other stuff
}



But the problem is when I do that, the engine says: action Change_level is an unkown parameter.

i hope this is clearer.

Re: Action not found [Re: Thehawk] #72447
04/28/06 20:03
04/28/06 20:03
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
maybe becuase its called level_change and not change_level?


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Action not found [Re: Michael_Schwarz] #72448
04/28/06 21:11
04/28/06 21:11
Joined: May 2005
Posts: 338
Brasil
Filipe Offline
Senior Member
Filipe  Offline
Senior Member

Joined: May 2005
Posts: 338
Brasil
i don't know if i understood your code correctly, but if i did i think that's the problem:

Code:


function load_level
{
if blah blah blah
{
level_load ("levelname.wmb");//you forgot the ""
/*The tutorial i used said to place any actions for the next level after that level's loading function...*/
other stuff
}
/*...which would be HERE, outside the load_level function*/
action level_change
{
//my.event = impact; //'my.event' is actually the function
// that handles the event
//my.function = Load_level;//as far as i know, 'my.function' only works for particles...
my.enable_impact = on;
my.event = load_level;
}



Re: Action not found [Re: Filipe] #72449
04/29/06 00:34
04/29/06 00:34
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
I think I know your problem. You haven't included your scecond script into your main script. Basically you only make on set of scripts. You add them as "includes" into the main script, which is what you set for all the levels. You don't make one script for each level.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1