21 models avialbel during creation scrreen

Posted By: Anonymous

21 models avialbel during creation scrreen - 07/20/01 01:43

I have been trying to get this to work for a couple of weeks now and am unable to do so.
what I have is 21 models character class models 42 if you include the male/female....

what I am trying to do is this.
1. the models are broken up into 3 male and
3 female of 7 models each. there are
three race types
2. when you click on the race type buttons
the the approiate group of 7 models are
displayed. by default the male models are
displayed. If the female button is
clicked then the female models will be
displayed for the approiate race type.
3. I know how to attach an action to a model.
what I need help with is how to make the
models appear and dissappear. I will
place all models in the level initially.
Only 7 models will be displayed out of
the 42 models.the models will be using
the invisble flag in the properties. then when you press the second race button the next 7 will be displayed and the frist 7
will be turned off. The modells will just stand still at this time.

4. after the player has created thier character. I will need to associate that model with the save slot. this is easy to do.
but I need to have the model used in the game for the character model. not sure how to this at this time.

if anyone could help me with this I would apperciate it. It has me stumped at this time.

I think part of the puzzle is this
these functions are used to turnon and off the individual models.

function male_fire_mutant
funciton male_water_mutant
.....all the way through 21 male models
function female_fire_mutant
through all 21 female models

these functions would be used to turn on and off the 3 group of females and male models
ie..
function turnon_male mutants
call all 7 fucntions to turnon the male mutant models and turnoff all the other models.

function turnon_female_mutants

function turnon_male_cyborgs....

function turnoff_female_mutants etc.....

function assign_player_model.

I have only some basic ideas on what to put into the functions I know I will need to turn on and off the invisible flag. but havent figured out how to do the rest.should these be actions or functions to assign to the individual models. I will be calling these from the 3 race buttons and the male / female buttons.????

Is there anyway to delete a .sav file from within the game or do you need to zero all the stats out????? I am using a4. commercial.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/20/01 23:58

Here's one way to approach the task of making specific models visible or invisible through code:

Declare a synonym for each model, e.g.:
synonym syn_water_mutant {type entity;}

Declare a numeric variable for each model:
water_mutant = 1;

Put that same number into one of the first eight skills for the model in WED (let's say skill8)

Make an action that you attach to all the models with code that associates each model with it's synonym. (A single action script in WDL that would have an if statement for each model).

if my._SKILL8 == 1 {
syn_water_mutant = me;
}
etc.

This gives you a synonym for each model. Then you can write a function that you can call to change the visibility of all the models in your predetermined groups:

syn_water_mutant.invisible = ON;
etc.

Now don't quote me on the exact syntax of all this, but this should get you pretty close. Of course, the experts out there are bound to have different ideas about how to do this ... and I'm anxious to hear 'em. Good luck!


-------------------------------------------

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/21/01 03:02

heres what i gotten so far. it aint much though.
function spawn_male_fire
{ temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<humanoid.mdl>,temp,null);

}

i call a function that calls this routine. when i click on the mutants button all 7 default models appears. I havent figured out how to make them dissappear. also I have to call the make_models_display function from a button to make this work.

I think what i need to do is the following but not sure.

define male_fire 101; /// id number of the model
define ent_id ,skill34; // a flag to set the model number to

now do i need an action or a functiion here

action make_the_damn_male_fire_appear // hehe
{ my.ent_id=male_fire
my.visible=on;
or remove ???/ to make it dissappear would be another function to do this.
}

do i need to attach the action to a model. or can i associate it another way???

for my routine for my if statment.

function make_models_appear
{ if (race_selected=1) && (gender_selected==1)// male mutants
{ call the functions that make the male mutants appear.
spawn_male_fire();
........
}
check for each group and sex combo
}

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/21/01 06:25

In the examples in the Venture workshop, you'll see that actions are really just initialization code for an entity. The engine itself calls the action after the model is created or after the level containing the entity is loaded. You can attach the same action to multiple entities which is very handy.

So, typically, you have the initialization code (and in your case it could contain multiple if statements to test my.ent_ID and assign the proper synonym to each) and then the last statement in your action could be a function like update_model() or model_movement() or something. These "update" functions just run perpetually.

You can certainly make the model appear with the create method, but I think that would mean having an individual action for each model, in order to get the correct synonym assigned. You can do it, but it's a lot tougher to maintain your code that way (42 actions instead of 1). This is why I was suggesting putting that ID number into one of the first 8 skills, because you can do it in WED and assign all those models the same action. Then test for the my.skill8 (or whatever) in the action and assign the synonym there.

The reason you need a synonym for each model is that's the only way to be able to refer to a specific model later in code. If you want to make a model disappear in some function, you need to be able to say: syn_mutant_fire.invisible = ON.

The most common approach that I've seen would be to toggle the visibility in the perpetual update function that I mentioned above (and then it would be my.invisible = ON). That's slightly more complicated, but can make for more organized code, because you wind up with a set of states that you're constantly testing for. See the code for the lady character in the venture workshop and you'll see what I mean.

Again, if somebody has a better way to approach this, I'm anxious to hear it. My game has similar issues to Kman's.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/21/01 06:29

OKAY I am so lost on this one. theres no decent tutorial on this anywhere , I have been going all of the tutorials and the documentatioin is not very good. It seems that if I can use the following to make the model appear there should be an easy way to make it go away, I know that I am going to use the remove me but I am sooo lost on how to do this. HELP would be apperciated.
grrr instead of all the fancy features I would like to see better documentation and explantions,,,,, i.e. small codes examples of how to do things. This has always been a big issue since 3.7. In this case I think theres plenty of information just not organized at all.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/21/01 06:57

the only place that I will be using this code is in the character creation process. after you have selected the character then the save array will contain an index ie.. water_mutant=1 copy this into slot1_save_array[2] , then when you load the acuatual level we look at the index and pull the approriate model. ie. if slot1_save_array[2] == 1 call the function that will place the model. Then I can see using the synonym, I dont want a continual running funciton. thats one reason I am trying to do this the brute force way. but I am thinking it might be easier to try the way your talking about.It seems either way that I will have to use a synonym so that I can remove the figures. The nice part of doing it with the create is that you dont have to all the models in the level.

heres is what i have so far
synonym syn_male_fire_mutant{type entity;}

ACTION spawn_male_fire
{syn_male_fire_mutant=ME;
syn_male_fire_mutant.INVISIBLE=OFF;

}
the .invisible=off; is giving me empty synonym error if I remark it out then the error goes away.
Hell I cant even get one model to become visible right now much less than 42 models.
As soon as I figure out this then I will give you the code.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/21/01 21:51

Reverse the ME statement.

It Should be:
ME = syn_male_fire_mutant;

Then you can set the entity invisible.

Want him to disapperar
syn_male_fire_mutant.visible = 0;
Now that mutant will disappear.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 00:06

grrrr I feel so stupid. I am missing something big time here.
okay heres what I have now

synonym syn_male_fire_mutant {type entity;}

/// functions to spawn the mutant models
function spawn_male_fire
{me=syn_male_fire_mutant;
temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<humanoid.mdl>,temp,null);

}

function TURNOFF_MALE_FIRE
{ me=syn_male_fire_mutant;
me.visible=0;
}

function turnon_models
{if ((race_selected==1)&& (gender_selected==1))
{spawn_male_fire();
spawn_male_wind();
spawn_male_earth();
spawn_male_water();
spawn_male_light();
spawn_male_nature();
spawn_male_weather();
}
}

function turnoff_models
{TURNOFF_MALE_FIRE();// need to put in the check for race and gender here. after i get this working.
}

function display_mutants
{call turnoff models here
and call turnon models here.
}

okay when you click on a race button the approiate models should appear, that works.

when you click on a race button the current modles should be turned off and the new models should be turned on.

okay i have tried to do the morphing thing
i have tired doing the invisible thing. that is still giving me an error of empty syn_male_fire_mutant.visible=0 and/or
me.visible=0, doesnt generate error unless i put previous line of code in.

do i need to place the models in the level and attach an action to them.... for some reason I am just not getting this. this should be a easy task but i am missing an imporant concept/ idea i believe. after i create the model(its not in the level at this time.) it appears with no problem. but getting them to dissappear is the issue.

I am so confused hehee. I understand what needs to be done but the brains cells are missig on all cyclinders on this one.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 02:07

Just my quick obervation, in your function spawn_male_fire function, you set the synonym before you created the model. Have you tried something like this:

synonym syn_male_fire_mutant {type entity;}

function male_fire_mutant
{syn_male_fire_mutant = ME;
}

/// functions to spawn the mutant models
function spawn_male_fire
{
temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<humanoid.mdl>,temp,male_fire_mutant);

}

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 02:21

As far Kevin Ross's idea goes: I didn't know you could set a value for ME in WDL. My understanding is that ME is read-only variable that is set by the engine.

Keebo's code seems like it should work and if it doesn't, try changing the word "function" to "action" on the spawn function.

Again, doing it this way is going to give you an action for each model, which means a lot of code to maintain (if you're doing 21 models) but at this stage, just get it to work any way you can.

_-------------------------------

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 02:23

Excuse me, in my previous post, I meant to say change "function" to "action" on the line that says "function male_fire_mutant"

---------------------------------

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 03:13

The main difference in ACTION and FUNCTION is the ability to attach the ACTION to an entity within WED. If it is being created in runtime then FUNCTION will work and not clutter up the ACTION property window in WED.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/24/01 22:18

okay now that fixed the synonum error but still the model is not being removed.. weeeee getting closer.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/25/01 01:30

If you are successfully setting the synonym like Keebo suggested:

function male_fire_mutant
{syn_male_fire_mutant = ME;
}

... where this function is the action you assigned when you created the model (with your create statement), then this should do it:

syn_male_fire_mutant.invisible = ON;

I just tried this last night in my game and turning visible off didn't seem to do it.


-----------------------------------------

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/25/01 02:52

Yes, Michael is correct. MY.INVISIBLE = OFF and MY.INVISIBLE = ON is the proper usage.

I too tried visible = 0 and got a weird effect in which the camera detaches from the player and has gravity applied to it. Could be useful for something I suppose.

Kevin, does the visible = 0 work correctly for you?

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/25/01 10:10

ok, now 0 is working for me and 1. But I have adjusted the code, let me go back to his code and try it and see what happens.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/25/01 23:53

this is very strange. whenever i do add the syn_male_fire_mutant.invisible= ; then i get the empty synonym error.

function TURNOFF_MALE_FIRE
{male_fire_mutant()// set the synonym
wait 1;
syn_male_fire_mutant.invisible=on;;
}
if I take this out the syn_male_fire_mutant then the error goes away. from all of the code i have looked at this should work???

however this one does not generate an error but it does nothing.
function TURNOFF_MALE_FIRE
{male_fire_mutant();// set the synonym
wait 1;
remove syn_male_fire_mutant;
}

okay this version also gives the synonym error.
function TURNOFF_MALE_FIRE
{male_fire_mutant();// set the synonym
wait 1;
me.invisible=off;
}

I am using a4 commericial.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 00:19

The only time you'll be able to set the synonym (with this approach) is when the action or function attached to the entity runs. In other words, whatever function you specify when you use CREATE to create the entity should have the me = syn_male_mutant_fire; command in it. Then you won't need to set that synonym again; you can just use it.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 02:24

Try adding:

WHILE (syn_male_fire_mutant == NULL) {WAIT (1);}

before the invisible = ON instead of the WAIT(1).

Credit Ronny for that little nugget.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 03:59

yes that works, however because the syn_male_fire_mutant is never being set i.e. synonym empty error. empty=null=not set right= error. i cant believe this is not working yet. its a very simple concept.okay now i dont get the error message. because of the while statment. Suprisingly enough the model still doesnt go invis. geeze this is getting kinda of funnie.

my code looks like and smells like working code but it isnt hehe.


umm maybe micheal is right, hehe

so maybe i should just put all the models in my level with the invisible flag set. then when i need them set the synonym and visible flag . Would this be easier than using the create function. Michael no matter how you look at it the code the to turn on and off the models will be the same amount. either you use create up front or put the models in the world up front. but the flow of the code will be about the same, that is if I have done my flowcharting correctly.
ummmmm that sounds mighty familiar.

I know someone must have something out there that works like this.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 05:15

OK this is getting frustrating to me too. I created a empty test level and added:

code:

synonym syn_male_fire_mutant {type entity;}

function male_fire_mutant
{syn_male_fire_mutant = ME;
}

/// functions to spawn the mutant models
function spawn_male_fire
{
temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<guard.mdl>,temp,male_fire_mutant);

}

FUNCTION remove_male_fire () {
//REMOVE syn_male_fire_mutant//this works too
syn_male_fire_mutant.INVISIBLE = ON;

}

ON_1 spawn_male_fire;
ON_2 remove_male_fire;


This works with turning the entity's invisible on or by removing it. This is of course just by hitting the keys and you must be calling it from another function. Refresh me on how you are trying to acheive the on and off functions.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 11:37

kman,

Here is a snippet that might help get you started. The male_mutants (guard.mdl) fade in just after the level loads. Pressing the 2 key (change to your panel button) fades the male_mutants out and fades the female_mutants (cbabe.mdl) in. The 1 key reverses this process. I used the create and remove method instead of the visible and invisible method to save framerate. Maybe you can use this template to add your cyborgs and other races. This has been tested in a empty level with the exception of a position (default camera).

/////////////////////////////////////////////////////////////////
// The MAIN function is called at game start
function main()
{
load_level(<KmanProj.WMB> );
load_status(); // restore global skills
// client_move(); // for a possible multiplayer game
// call further functions here...
WAIT(5);
spawn_male_mutants();// spawn male mutants upon loading
}

SYNONYM syn_male_fire_mutant {type entity;}
SYNONYM syn_male_water_mutant {type entity;}
SYNONYM syn_male_3_mutant {type entity;}
SYNONYM syn_male_4_mutant {type entity;}
SYNONYM syn_male_5_mutant {type entity;}
SYNONYM syn_male_6_mutant {type entity;}
SYNONYM syn_male_7_mutant {type entity;}

SYNONYM syn_female_fire_mutant {type entity;}
SYNONYM syn_female_water_mutant {type entity;}
SYNONYM syn_female_3_mutant {type entity;}
SYNONYM syn_female_4_mutant {type entity;}
SYNONYM syn_female_5_mutant {type entity;}
SYNONYM syn_female_6_mutant {type entity;}
SYNONYM syn_female_7_mutant {type entity;}

// toggle models
FUNCTION m_m_from_f_m () {//male_mutants_from_female_mutants
remove_female_mutants ();
WAITT(10);
spawn_male_mutants ();
}

FUNCTION f_m_from_m_m () {//female_mutants_from_male_mutants
remove_male_mutants ();
WAITT(10);
spawn_female_mutants ();
}

/// MALE MUTANTS
/// functions to spawn the male mutant models
FUNCTION spawn_male_mutants () {
spawn_male_fire_mutant ();
spawn_male_water_mutant ();
spawn_male_3_mutant ();
spawn_male_4_mutant ();
spawn_male_5_mutant ();
spawn_male_6_mutant ();
spawn_male_7_mutant ();
}

FUNCTION spawn_male_fire_mutant{
temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_fire_mutant);

}

function spawn_male_water_mutant{
temp.x=135;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<guard.mdl>,temp,male_water_mutant);
}

FUNCTION spawn_male_3_mutant{
temp.x=235;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_3_mutant);

}

FUNCTION spawn_male_4_mutant{
temp.x=335;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_4_mutant);

}

FUNCTION spawn_male_5_mutant{
temp.x=435;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_5_mutant);

}

FUNCTION spawn_male_6_mutant{
temp.x=535;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_6_mutant);

}

FUNCTION spawn_male_7_mutant{
temp.x=635;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<guard.mdl>,temp,male_7_mutant);

}

/// functions to set synonyms and fade in
FUNCTION male_fire_mutant{
syn_male_fire_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_water_mutant{
syn_male_water_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_3_mutant{
syn_male_3_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_4_mutant{
syn_male_4_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_5_mutant{
syn_male_5_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_6_mutant{
syn_male_6_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION male_7_mutant{
syn_male_7_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}


/// functions to remove the male mutant models
FUNCTION remove_male_mutants () {
remove_male_fire_mutant ();
remove_male_water_mutant ();
remove_male_3_mutant ();
remove_male_4_mutant ();
remove_male_5_mutant ();
remove_male_6_mutant ();
remove_male_7_mutant ();
}

FUNCTION remove_male_fire_mutant () {
syn_male_fire_mutant.TRANSPARENT = ON;
syn_male_fire_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_fire_mutant.ALPHA -= 5*TIME;
IF(syn_male_fire_mutant.ALPHA <=0)
{
REMOVE syn_male_fire_mutant;
//syn_male_fire_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_water_mutant () {
syn_male_water_mutant.TRANSPARENT = ON;
syn_male_water_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_water_mutant.ALPHA -= 5*TIME;
IF(syn_male_water_mutant.ALPHA <=0)
{
REMOVE syn_male_water_mutant;
//syn_male_water_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_3_mutant () {
syn_male_3_mutant.TRANSPARENT = ON;
syn_male_3_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_3_mutant.ALPHA -= 5*TIME;
IF(syn_male_3_mutant.ALPHA <=0)
{
REMOVE syn_male_3_mutant;
//syn_male_3_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_4_mutant () {
syn_male_4_mutant.TRANSPARENT = ON;
syn_male_4_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_4_mutant.ALPHA -= 5*TIME;
IF(syn_male_4_mutant.ALPHA <=0)
{
REMOVE syn_male_4_mutant;
//syn_male_4_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_5_mutant () {
syn_male_5_mutant.TRANSPARENT = ON;
syn_male_5_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_5_mutant.ALPHA -= 5*TIME;
IF(syn_male_5_mutant.ALPHA <=0)
{
REMOVE syn_male_5_mutant;
//syn_male_5_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_6_mutant () {
syn_male_6_mutant.TRANSPARENT = ON;
syn_male_6_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_6_mutant.ALPHA -= 5*TIME;
IF(syn_male_6_mutant.ALPHA <=0)
{
REMOVE syn_male_6_mutant;
//syn_male_6_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_male_7_mutant () {
syn_male_7_mutant.TRANSPARENT = ON;
syn_male_7_mutant.ALPHA = 100;
WHILE(1)
{
syn_male_7_mutant.ALPHA -= 5*TIME;
IF(syn_male_7_mutant.ALPHA <=0)
{
REMOVE syn_male_7_mutant;
//syn_male_7_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

/// FEMALE MUTANTS
/// functions to spawn the female mutant models
FUNCTION spawn_female_mutants () {
spawn_female_fire_mutant ();
spawn_female_water_mutant ();
spawn_female_3_mutant ();
spawn_female_4_mutant ();
spawn_female_5_mutant ();
spawn_female_6_mutant ();
spawn_female_7_mutant ();
}

FUNCTION spawn_female_fire_mutant{
temp.x=35;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_fire_mutant);

}

function spawn_female_water_mutant{
temp.x=135;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
create(<cbabe.mdl>,temp,female_water_mutant);
}

FUNCTION spawn_female_3_mutant{
temp.x=235;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_3_mutant);

}

FUNCTION spawn_female_4_mutant{
temp.x=335;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_4_mutant);

}

FUNCTION spawn_female_5_mutant{
temp.x=435;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_5_mutant);

}

FUNCTION spawn_female_6_mutant{
temp.x=535;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_6_mutant);

}

FUNCTION spawn_female_7_mutant{
temp.x=635;
temp.y=355;
temp.z=275;
vec_for_screen(temp,camera);
CREATE(<cbabe.mdl>,temp,female_7_mutant);

}

/// functions to set synonyms and fade in
FUNCTION female_fire_mutant{
syn_female_fire_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_water_mutant{
syn_female_water_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_3_mutant{
syn_female_3_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_4_mutant{
syn_female_4_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_5_mutant{
syn_female_5_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_6_mutant{
syn_female_6_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}

FUNCTION female_7_mutant{
syn_female_7_mutant = ME;
MY.TRANSPARENT = ON;
MY.ALPHA = 0;
WHILE(1)
{
MY.ALPHA += 5*TIME;
IF(MY.ALPHA >=100)
{
MY.TRANSPARENT = OFF;
RETURN;
}
WAIT(1);
}
}


/// functions to remove the female mutant models
FUNCTION remove_female_mutants () {
remove_female_fire_mutant ();
remove_female_water_mutant ();
remove_female_3_mutant ();
remove_female_4_mutant ();
remove_female_5_mutant ();
remove_female_6_mutant ();
remove_female_7_mutant ();
}

FUNCTION remove_female_fire_mutant () {
syn_female_fire_mutant.TRANSPARENT = ON;
syn_female_fire_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_fire_mutant.ALPHA -= 5*TIME;
IF(syn_female_fire_mutant.ALPHA <=0)
{
REMOVE syn_female_fire_mutant;
//syn_female_fire_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_water_mutant () {
syn_female_water_mutant.TRANSPARENT = ON;
syn_female_water_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_water_mutant.ALPHA -= 5*TIME;
IF(syn_female_water_mutant.ALPHA <=0)
{
REMOVE syn_female_water_mutant;
//syn_female_water_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_3_mutant () {
syn_female_3_mutant.TRANSPARENT = ON;
syn_female_3_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_3_mutant.ALPHA -= 5*TIME;
IF(syn_female_3_mutant.ALPHA <=0)
{
REMOVE syn_female_3_mutant;
//syn_female_3_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_4_mutant () {
syn_female_4_mutant.TRANSPARENT = ON;
syn_female_4_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_4_mutant.ALPHA -= 5*TIME;
IF(syn_female_4_mutant.ALPHA <=0)
{
REMOVE syn_female_4_mutant;
//syn_female_4_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_5_mutant () {
syn_female_5_mutant.TRANSPARENT = ON;
syn_female_5_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_5_mutant.ALPHA -= 5*TIME;
IF(syn_female_5_mutant.ALPHA <=0)
{
REMOVE syn_female_5_mutant;
//syn_female_5_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_6_mutant () {
syn_female_6_mutant.TRANSPARENT = ON;
syn_female_6_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_6_mutant.ALPHA -= 5*TIME;
IF(syn_female_6_mutant.ALPHA <=0)
{
REMOVE syn_female_6_mutant;
//syn_female_6_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

FUNCTION remove_female_7_mutant () {
syn_female_7_mutant.TRANSPARENT = ON;
syn_female_7_mutant.ALPHA = 100;
WHILE(1)
{
syn_female_7_mutant.ALPHA -= 5*TIME;
IF(syn_female_7_mutant.ALPHA <=0)
{
REMOVE syn_female_7_mutant;
//syn_female_7_mutant.INVISIBLE = ON;
RETURN;
}
WAIT(1);
}
}

/////////////////////////////////////////////////////
ON_1 m_m_from_f_m;
ON_2 f_m_from_m_m;

///////////////////////////////////
EDIT:
Oops, I forgot to put this in the code format. Actually it is easier to copy and paste this way.

Good luck

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/26/01 22:55

okay i will try this, I am calling the function to turn the models on and off from another function that is called by pressing the race and/or the male/female button.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/27/01 00:14

hey keebo This is still causing me the empty synonym errors.I dont understand why but it is.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/27/01 07:33

It works fine for me without any errors. Something in your code appears to be calling one of the functions before the synonym is set. When does this occur? Does it occur every time? Any other info would be helpful.

I would start a empty test level with only a position for the view, add this code and make sure it works on your system. It should work OK but if it does not then something is wrong with your setup. If it works OK, start by assigning the ON_1 and ON_2 functions to simple panel buttons. Continue adding your other code until an error occurs. Then you will know where the problem starts.

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/29/01 09:35

okay i got it to work like you suggested. this will make me go through my orignal code and make it more efficient too. I am having one problem still.

when the creation screens frist comes up. the male models are there weeeeee. the problem is this ---

if you click on the male button(male models are already displayed , synonyms are set.)frist. because the synonyms are set to male but the females synonyms are not set i am getting empty synonym error, now the only way I see to get around this is go ahead and create one set of females but make them invisible.

ooh i just realized something, if the females models are displayed and i click on the female button the empty synonym error will also occur.
ummm how would i get around this issue??? here is my function that turns on the male mutants.
FUNCTION turnon_models () {//male_mutants_from_female_mutants
{
if (gender_selected==1) // will need to check for the race
{
spawn_male_mutants ();
wait(1);
remove_female_mutants();
wait (1);
}
else { if (gender_selected==2) // will need to check for the race
{remove_male_mutants();
wait(1);
spawn_female_mutants ();
wait(1);
}
}
return;
}

to recap what the problem is if you click on the gender button of the current gender displayed then you will get the empty synonym error.

How do i get around this, maybe with a while???

Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/30/01 06:49

I noticed the error while I was testing the code too. I was thinking about checking a variable for which set of models was displayed and only change models if the value didn't equal the displayed models' value. But since you are using panel buttons, I would deactivate the button upon spawning so the user could not respawn them again causing an error.
Posted By: Anonymous

Re: 21 models avialbel during creation scrreen - 07/30/01 21:17

yea i could only have button shown, or just a variable that would be set
© 2024 lite-C Forums