What I've tried. Created a script_brushmodel and changed the texture to clip and then made the targetname clip1, clip2 and so on. Then in my SCRIPT.gsc I put in
That is how you would like something to an object; however, clips seem to disable themselves when they move (or atleast whenever I have attempt having moving clips). Players always seemed to be able to walk right through them
That is how you would like something to an object; however, clips seem to disable themselves when they move (or atleast whenever I have attempt having moving clips). Players always seemed to be able to walk right through them
hmmm... well I'm trying to have like a moving object that you can ride in... any tips
Last Edit: April 04, 2015, 04:06:07 am by GerardS0406
main() { //How long it will take the Model to reach destination time = 8; bus = getentarray("bus", "targetname"); origin1 = getent("origin1", "targetname"); origin2 = getent("origin2", "targetname"); origin3 = getent("origin3", "targetname"); origin4 = getent("origin4", "targetname"); players = get_players();
//Set Up Bus Trigger bus_trig1 = getEnt("bus1", "targetname"); bus_trig1 setHintString("Press and Hold &&1 to move Bus"); bus_trig1 setCursorHint("HINT_NOICON"); bus_trig1 UseTriggerRequireLookAt();
//Destination Point dest1 = getEnt("dest1","targetname");
main() { //How long it will take the Model to reach destination time = 8; bus = getentarray("bus", "targetname"); origin1 = getentarray("origin1", "targetname"); origin2 = getentarray("origin2", "targetname"); origin3 = getentarray("origin3", "targetname"); origin4 = getentarray("origin4", "targetname"); players = get_players();
//Set Up Bus Trigger bus_trig1 = getEnt("bus1", "targetname"); bus_trig1 setHintString("Press and Hold &&1 to move Bus"); bus_trig1 setCursorHint("HINT_NOICON"); bus_trig1 UseTriggerRequireLookAt();
//Destination Point dest1 = getEnt("dest1","targetname");
Looks like you don't understand what an array is. Arrays are multiple data types stored in a single variable such as a string, integer, entity, etc.
I would go into a detailed explanation of arrays but its like 4AM here and i'm a little tired. Just think of them as boxes that hold stuff in them(just about always of the same type). The box(array) itself isn't important, its the individual values that make up the array that matters. Your script is basically saying that each individual "origin" is its box when its only that individual entity.
Anyway, based off of the previous script provided, i made a version that properly uses arrays. It should work as long as i didn't screw up somewhere but either way you can use it to better understand arrays and how they work.
if(!isdefined(origins) || !isdefined(stick_trigger)) // Don't run code if nothing is defined { iprintln("No origins or stick trigger defined!"); return; } players = get_players(); for(i=0;i<players.size;i++) // Set the brushorigin before moving onto trigger function { players[i].brushorigin = origins[i]; // This should set the spot for each player } stick_trigger trig_think(); } trig_think() { self sethintstring("Press &&1 to start the ride"); self setCursorHint( "HINT_NOICON" ); who = undefined; self waittill("trigger", who); who player_tele();
} player_tele() { self SetOrigin(self.brushorigin.origin); if(isdefined(self.brushorigin.angles)) // The origin's angles probably aren't defined but if they are this will set them. { self SetPlayerAngles(self.brushorigin.angles); } self PlayerLinkTo(self.brushorigin); }
Looks like you don't understand what an array is. Arrays are multiple data types stored in a single variable such as a string, integer, entity, etc.
I would go into a detailed explanation of arrays but its like 4AM here and i'm a little tired. Just think of them as boxes that hold stuff in them(just about always of the same type). The box(array) itself isn't important, its the individual values that make up the array that matters. Your script is basically saying that each individual "origin" is its box when its only that individual entity.
Anyway, based off of the previous script provided, i made a version that properly uses arrays. It should work as long as i didn't screw up somewhere but either way you can use it to better understand arrays and how they work.
if(!isdefined(origins) || !isdefined(stick_trigger)) // Don't run code if nothing is defined { iprintln("No origins or stick trigger defined!"); return; } players = get_players(); for(i=0;i<players.size;i++) // Set the brushorigin before moving onto trigger function { players[i].brushorigin = origins[i]; // This should set the spot for each player } stick_trigger trig_think(); } trig_think() { self sethintstring("Press &&1 to start the ride"); self setCursorHint( "HINT_NOICON" ); who = undefined; self waittill("trigger", who); who player_tele();
} player_tele() { self SetOrigin(self.brushorigin.origin); if(isdefined(self.brushorigin.angles)) // The origin's angles probably aren't defined but if they are this will set them. { self SetPlayerAngles(self.brushorigin.angles); } self PlayerLinkTo(self.brushorigin); }
Thanks for the Tip
Last Edit: April 04, 2015, 03:10:59 pm by GerardS0406