Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 722 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
21 models avialbel during creation scrreen #5868
07/20/01 01:43
07/20/01 01:43

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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!


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


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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
}


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.

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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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);

}


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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.

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


Page 1 of 3 1 2 3

Moderated by  HeelX, Spirit 

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