Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to scale model using c script? #305769
01/17/10 06:54
01/17/10 06:54
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
Can anyone please show me how to scale your mdl in SED? My level is too big for the model to be seen. I really would appreciate it if someone replies.


If you do not know where you are . . .
Ask a villager.
Re: how to scale model using c script? [Re: DirtyDhan] #305772
01/17/10 09:21
01/17/10 09:21
Joined: May 2006
Posts: 148
Latvia
MTD Offline
Member
MTD  Offline
Member

Joined: May 2006
Posts: 148
Latvia
You should post this in the "C-Script and WDL"
And there is always a manual for such problems wink

function assign_to_model()
{
my.scale_x=0.5;
my.scale_y=0.5;
my.scale_z=0.5;
}

Re: how to scale model using c script? [Re: DirtyDhan] #305775
01/17/10 09:55
01/17/10 09:55
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
You should post this in the "Gamestudio » Forums » Gamestudio » Starting with Gamestudio ".
Here is the method to gain this information:
1. Open your application eg. SED.
2. Open the built-in help.
3. Type in this word: scale.
4. Hit ENTER.

Re: how to scale model using c script? [Re: Aku_Aku] #305780
01/17/10 10:31
01/17/10 10:31
Joined: Jan 2010
Posts: 16
W
wacek Offline
Newbie
wacek  Offline
Newbie
W

Joined: Jan 2010
Posts: 16
Source form AUM70

Q: I have a hard time setting the proper size of the entities in my level; is there a possibility to change their size at runtime?

A: Here's an example that changes the size on the z axis for any entity that is touched with the mouse pointer. A panel displays the z scale, which can then be used in Wed.

Code:
BMAP* arrow_pcx = "arrow.pcx";
PANEL* size_pan =
{
       digits(100, 50, 3.3, *, 1, mouse_ent.scale_z);
       flags = visible;
}

function mouse_startup()
{  
  mouse_mode = 2;
  mouse_map = arrow_pcx;
  while (1)
  {  
       vec_set(mouse_pos, mouse_cursor);
       wait(1);
  }
}

function change_entities_startup()
{
       while (1)
       {
               if (mouse_ent) // if the mouse is touching an entity
               {
                       if (key_1) {mouse_ent.scale_z += 0.1 * time_step;}
                       if (key_2) {mouse_ent.scale_z -= 0.1 * time_step;}
               }
               wait (1);
       }
}

action players_code() // simple player and 1st person camera code
{ 
       player = my; // I'm the player
       set (my, INVISIBLE); // no need to see player's model in 1st person mode
       while (1)
       {
               // move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
               c_move (my, vector(10 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
               vec_set (camera.x, player.x); // use player's x and y for the camera as well
               camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)
               camera.pan -= 5 * mouse_force.x * time_step; // rotate the camera around by moving the mouse
               camera.tilt += 3 * mouse_force.y * time_step; // on its x and y axis
               player.pan = camera.pan; // the camera and the player have the same pan angle
               wait (1);
       }
}





Last edited by wacek; 01/17/10 10:34.
Re: how to scale model using c script? [Re: wacek] #305881
01/18/10 03:50
01/18/10 03:50
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
Hehe, many tnx for these replies. I'm really not good at programming. So I only scaled it in WED (T,T). I guess it working fine now.


If you do not know where you are . . .
Ask a villager.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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