Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
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
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 2 of 6 1 2 3 4 5 6
Re: Script Factory [Re: Slin] #127650
05/02/07 21:23
05/02/07 21:23
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Well...if nobody else wants to get presents from such a skilled coder...here's my next wish

I have a day-night cycle depending on the sun_angle.pan (%360). Now I'd like to have an hour-day-month-year counter that depends on the sun_angle.pan (360' = one day...90'=noon, 270'=midnight)...Do you want to give it a go?

Re: Script Factory [Re: Loopix] #127651
05/02/07 22:32
05/02/07 22:32
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Jeez...on any othe day I could have thot of a dozen requests.

What a time to go brain-dead!!

Re: Script Factory [Re: JazzDude] #127652
05/03/07 00:23
05/03/07 00:23
Joined: Aug 2002
Posts: 572
Toronto
MadMark Offline
User
MadMark  Offline
User

Joined: Aug 2002
Posts: 572
Toronto
Okay, here comes one that I haven't been able to figure out for the life of me.

I have a spaceship model, and I move it through my level. When it gets to within 100 quants of the outside of a planet model, I would like it to orbit the planet, left to right, facing slightly towards the planet. I would like it to continue orbitting the sphere and present a menu to the player, allowing key input or mouse clicks on the menu, until the "X" key is pressed. Once pressed, the menu should disappear, the ship should smoothly turn away from the planet, escape orbit by 50 quants, and return steering to the player.

Problems that I have had are that the spheres are different sizes, and everything that I do seems to focus on the origin of the sphere and not its perimeter. I either end up inside the planet model, or way too far away.

Might be too much, but hey, you asked!

Cheers
Mark


People who live in glass houses shouldn't vacuum naked.
Re: Script Factory [Re: MadMark] #127653
05/03/07 01:06
05/03/07 01:06
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
lol, try using the min_x/max_x for finding the size, and then add an offset to it.

offset = 100;
distance = (my.max_x - my.min_x)/2 + offset;

This will return the distance [radius] from the origin of the model to use...


xXxGuitar511
- Programmer
Re: Script Factory [Re: Slin] #127654
05/03/07 01:17
05/03/07 01:17
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i have a request... can you make a forcefield bubble code that only appears around the body of your player when hit? i want to use as a primary health and keep the actual health as secondary in a 3rd person shooter. so the code has to decrease after every hit, i guess it should have a max of 100 hp. can you do this? by the way, how can i use this code with a plbiped01 code in the templates?

Re: Script Factory [Re: Blink] #127655
05/03/07 05:18
05/03/07 05:18
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
i also have a request, do you know how to do a quake3 style cheat code input system?


- aka Manslayer101
Re: Script Factory [Re: mpdeveloper_B] #127656
05/03/07 06:18
05/03/07 06:18
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
at my library wdl online is a cheat input code dunno what quake style means


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Script Factory [Re: Realspawn] #127657
05/03/07 11:51
05/03/07 11:51
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
@Loopix: Something like this should do it
Code:

define hours_a_day, 24;
define days_a_month, 30;
define months_a_year, 12;

define time_offset, 6;

var time_hour;
var time_day;
var time_month;
var time_year;

function TimeCounter()
{
var check;

while(1)
{
while(1)
{
time_hour = sun_angle.pan/(360/hours_a_day);
time_hour += time_offset;
time_hour %= hours_a_day;

if(time_hour > 0.9){check = 1;}
if(time_hour < 0.5 && check){check = 0; break;}

wait(1);
}

time_day += 1;

if(time_day == days_a_month)
{
time_day = 0;
time_month += 1;

if(time_month == months_a_year)
{
time_year += 1;
time_month = 0;
}
}

wait(1);
}
}



@Manslayer101: I don´t know either what you mean with quake3 style...

Re: Script Factory [Re: Slin] #127658
05/03/07 12:45
05/03/07 12:45
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
@Blink: Try this
Code:

function Shield()
{
my.passable = on;
my.transparent = on;
my.red = 0;
my.green = 0;
my.blue = 255;
my.light = on;

you = my.parent;
vec_set(my.scale_x,you.scale_x);
vec_scale(my.scale_x,my.skill3);

var MaxEnergy;
MaxEnergy = my.skill1;

var Temp1;

while(you)
{
vec_set(my.x,you.x);
vec_set(my.pan,you.pan);

if(you.skill2 > 0){my.skill1 += min(my.skill1+you.skill2,MaxEnergy); you.skill2 = 0;}
if(you.skill1 < 100 && my.skill1 > 0)
{
my.alpha = my.skill2;
Temp1 = min(my.skill1,100-you.skill1);
my.skill1 -= Temp1;
you.skill1 += Temp1;
}
if(my.alpha > 0){my.alpha -= time_step;}

wait(1);
you = my.parent;
}
}

string ModelFileName;
function Shield_Activate(Pointer,ShieldEnergy,ShieldAlpha,ShieldScale)
{
you = Pointer;
if(you)
{
str_for_entfile(ModelFileName,you);

you = ent_create(ModelFileName,nullvector,Shield);
you.parent = Pointer;
you.skill1 = ShieldEnergy;
you.skill2 = ShieldAlpha;
you.skill3 = ShieldScale;
}
}



Add this at the top of the plBiped01.wdl (make a backup of that file before...)
and write this at the end of the action PlBiped01:
Shield_Activate(my,100,40,1.13);
The players armor is the shield enegy to start with.

I wasn´t able to test this so if you get any errors, just post your error message here.

Re: Script Factory [Re: Slin] #127659
05/03/07 14:29
05/03/07 14:29
Joined: Feb 2007
Posts: 146
UK
robertbruce Offline
Member
robertbruce  Offline
Member

Joined: Feb 2007
Posts: 146
UK
hello,

I would like the following script if you wouldn't mind.

When an entity/bot with an id between 2 to 8 hits an invisible block in it's path then it will jump forward.

I posted this here:

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/749362/an/0/page/0#Post749362

thanks,

Rob

Page 2 of 6 1 2 3 4 5 6

Moderated by  adoado, checkbutton, mk_1, Perro 

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