Post: Confused...crate moveto problems
03-06-2016, 12:22 AM #1
seanhellen
Are you high?
(adsbygoogle = window.adsbygoogle || []).push({}); Hey all - I am working on another gamemode and I am trying to get moveto to work on a crate...on a quick test gsc I made up, moveto works fine, but when i try and do it on my gamemode, it wont work.

when i spawn, a crate spawns by using Crate = spawnEntity(origin, ang); which works fine.

Then i try doing Crate moveto(self.origin, 1); which should move the crate to me, but it won't. I have put a iprintln message in the function to double check my functions work and it does.

I then put self iprintln(Crate.origin); and it did nothing...as if the crate didnt exist. I really don't understand why...any thoughts? I am using this function;

    
SpawnCrate(origin,ang)
{
Crate = spawnEntity(origin, ang);
}
Last edited by seanhellen ; 03-09-2016 at 08:17 PM.
03-08-2016, 06:37 PM #2
seanhellen
Are you high?
changed a little...anyone?
03-08-2016, 08:56 PM #3
Loz
Vault dweller
Originally posted by seanhellen View Post
Hey all - I am working on another gamemode and I am trying to get moveto to work on a crate...on a quick test gsc I made up, moveto works fine, but when i try and do it on my gamemode, it wont work.

when i spawn, a crate spawns by using Crate = spawnEntity(origin, ang);/b] which works fine.

Then i try doing Crate moveto(self.origin, 1); which should move the crate to me, but it won't. I have put a iprintln message in the function to double check my functions work and it does.

I then put self iprintln(Crate.origin); and it did nothing...as if the crate didnt exist. I really don't understand why...any thoughts? I am using this function;

    
SpawnCrate(origin,ang)
{
Crate = spawnEntity(origin, ang);
}


return Crate;

The following user thanked Loz for this useful post:

itsSorrow
03-09-2016, 08:27 PM #4
seanhellen
Are you high?
Originally posted by Loz View Post
return Crate;


Hey...that didn't work either :( The full function is this (jwms ammocrate function);

    
spawnEntity(origin, angle)
{
entity = spawn("script_model", origin);
entity.angles = angle;
entity setModel("t6_wpn_supply_drop_ally");
return entity;
}
AmmoCrate(origin,ang)
{
Crate = spawnEntity(origin, ang);
return Crate;
spawnObjective(origin, "hud_ammo_refill", Crate);
level thread Ammo_Think(Crate);
}


I have also tried

    
AmmoCrate(origin,ang)
{
Crate = spawn("script_model", origin);
Crate.angles = ang;
Crate setmodel("t6_wpn_supply_drop_ally");
return Crate;
spawnObjective(origin, "hud_ammo_refill", Crate);
level thread Ammo_Think(Crate);
}

but that didn't work either...and the ammo function wouldn't work with it :(

Also, I tried the same function in a blank gsc for testing and it didn't work so it's not something I have do
Last edited by seanhellen ; 03-09-2016 at 08:39 PM.
03-10-2016, 02:42 AM #5
jwm614
NextGenUpdate Elite
Originally posted by seanhellen View Post
Hey...that didn't work either :( The full function is this (jwms ammocrate function);

    
spawnEntity(origin, angle)
{
entity = spawn("script_model", origin);
entity.angles = angle;
entity setModel("t6_wpn_supply_drop_ally");
return entity;
}
AmmoCrate(origin,ang)
{
Crate = spawnEntity(origin, ang);
return Crate;
spawnObjective(origin, "hud_ammo_refill", Crate);
level thread Ammo_Think(Crate);
}


I have also tried

    
AmmoCrate(origin,ang)
{
Crate = spawn("script_model", origin);
Crate.angles = ang;
Crate setmodel("t6_wpn_supply_drop_ally");
return Crate;
spawnObjective(origin, "hud_ammo_refill", Crate);
level thread Ammo_Think(Crate);
}

but that didn't work either...and the ammo function wouldn't work with it :(

Also, I tried the same function in a blank gsc for testing and it didn't work so it's not something I have do


You must login or register to view this content.
03-10-2016, 07:18 PM #6
seanhellen
Are you high?
Forgot i made that thread :embarrassed:
I used the func that jwm gave but it didnt work...i assume because there was no origin. Thing is I can see it/use the ammo function but it just doesnt wanna budge Happy
03-13-2016, 03:18 PM #7
seanhellen
Are you high?
Ok, it turned out all I needed was "self.Crate" instead of just "Crate"...how stupid do I feel :embarrassed:

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo