ok...one last thing......

Posted By: Blink

ok...one last thing...... - 04/27/10 22:27

ok, now that my menu issue has been resolved, i have a level loading issue. i have certain "abilities" that i dont want to give the player until the level after, and the codes are on the level that you go to, but when i go to the level with the codes intact, i get a action not found error. is there a way to get this to work? now to be honest, i dont what i can do to maybe make them an action to collect to faux have the new ability or if it can be done? any thoughts friends?
Posted By: Blink

Re: ok...one last thing...... - 04/28/10 23:37

ok, maybe if i explain what i am looking for? I have a code, Emre's physic template which allows your player to use a graviton gun to move objects. If i include it on the level, it works fine. my player is "earning" that special power later on in the game. my issue is, i have it as an include on the level that the player is going to, but not on the start level. i dont want him to already have that ability. how can i make it so he either can pick it up as a power up on the new level, or a way to have the script load when the new level loads. Any ideas? I am at a loss.
Posted By: Uhrwerk

Re: ok...one last thing...... - 04/29/10 01:27

Just include the script. That shouldn't give the player the ability unless it's defined in a _startup funtion. Have you tried just including the file in your main script?
Posted By: Blink

Re: ok...one last thing...... - 04/29/10 02:10

see, the main script is the menu code, i dont want him to have the ability when the game starts, he gets it in later levels. you mean, adding it like: gravitation_gun; after the main();?
Posted By: Blink

Re: ok...one last thing...... - 04/29/10 02:28

ok, tried it, it didnt work!
Posted By: TeutonicDarkness

Re: ok...one last thing...... - 04/30/10 01:13

Your going about this all wrong...

You need to restructure your code differently.
Your First code should have all your include scripts.
You don't need any other scripts attached to other levels.
Except for trying levels in Wed you could
attach a scipt to say level2
called Level2.wdl
this script simply contains

include <Mainscript.wdl;

Without knowing the full working...
I can Say I could accomplish your goal With a simple
Var defined in Mainscript.wdl


VAR Majic power,
Var Majic power = 0;


Then In A action on your player restore code
in each additional level..
add a function:

function Majic power update()

{
Majic power + = 1;

}


Have another function running somwhere:

Majic power check()

{
If Majic power = 12;
Majic power event() // awesome function defined elsewhere
}



Hope that helped... been down a similar road.
I know when you get into multiple levels you
have to start thinking different!
Posted By: Blink

Re: ok...one last thing...... - 04/30/10 10:27

ok, i kinda understand. the main levels should have "all" of the includes, and the levels I change to should not? then other levels should have the same codes? then how do I introduce new abilities? i looked at what you coded above, but i am not sure where to insert that.
Posted By: Blink

Re: ok...one last thing...... - 04/30/10 10:28

you might have to explain another way so i can get it right,lol.
Posted By: TeutonicDarkness

Re: ok...one last thing...... - 04/30/10 23:33

Originally Posted By: Blink
ok, i kinda understand. the main levels should have "all" of the includes, and the levels I change to should not? then other levels should have the same codes? then how do I introduce new abilities? i looked at what you coded above, but i am not sure where to insert that.


Yes Only The Main level..
No other levels even need includes.

However If You Have for example 50 levels you might not
want to go to all the way through the levels
to see if level 50 code works.

If You want to start level 50 from Wed level 50

scripts should look like this:


include <Mainscript.wdl>;


Thats all thats needed!

You Main script should have all the includes
necessary and actions associated with it.
Doing it any other way could give you Double
Action problems.

For New stuff you would simple Add your new
include to Mainscript.wdl

include <Newcode.wdl>;


I'm working with multiple levels myself and
setting it up this way has really saved me. laugh
Posted By: Blink

Re: ok...one last thing...... - 05/01/10 00:12

ok, let me get this straight. instead of having the includes on all of the levels, just include the original level.wdl, say my menu level, and thats it? when it gets to that level, the codes that are in use will automatically be used? how will that work for my problem? if i include the physics template code in the mainscript.wdl, it will be active from level one, wont it? i dont want it to be active until say the last 4 levels.
Posted By: TeutonicDarkness

Re: ok...one last thing...... - 05/01/10 00:35

Originally Posted By: Blink
ok, let me get this straight. instead of having the includes on all of the levels, just include the original level.wdl, say my menu level, and thats it? when it gets to that level, the codes that are in use will automatically be used? how will that work for my problem? if i include the physics template code in the mainscript.wdl, it will be active from level one, wont it? i dont want it to be active until say the last 4 levels.


This does not necessarily Effect your added power
on level 40 problem.
But will save you nightmares later.

Phyisic code will be active from level 1
"The code is there anyway"
As I said before You need a function to check
for it.

Add a Varible That gets updated then
For example if Magic power = 12 // do cool stuff

Without seeing your project I can't say much
more but it will work!


On my project As an example I have a Var set for each
level that tells me level number.
In my Change level code for level 2
right after player impact I have Levelnumber = 2

A function run else where to check this number
and ent_Create player acording to the Levelnumber.
Obviously If I wanted to spawn on a Mountain top
it would be different that other levels.
So I have To create different player positions
for different levels.

It does require a little pre-planning but is working
quite nicely!


You can PM me if I can provide any futher assistance.
I can't guarantee anything but will help if I can!
Posted By: Blink

Re: ok...one last thing...... - 05/01/10 01:53

i tried to pm you, but it says you are over the private message limit.
© 2024 lite-C Forums