Page 1 of 1
Coming soon : Entity scripts
Posted: Sat Jun 08, 2013 9:37 pm
by Mit
3 points to the first to decipher what this script code does :]
Code: Select all
$xpos = $gPlayerWorldX
$ypos = $gPlayerWorldY + 1000 // add 10m
$hEntity = EntityCreate( $gPlayerID, "PUBLIC", "" )
EntitySetModel( $hEntity, "agen-shaman.atm", "" )
EntitySetPosition( $hEntity, $xpos, $ypos, 0 )
EntitySetAnimation( $hEntity, "Gesture1", 1, 0 )
EntityAddToWorld( $hEntity )
Posted: Sat Jun 08, 2013 9:53 pm
by zaroba
Places the specified model 10 meters away from the player playing the specified gesture?
Posted: Sat Jun 08, 2013 10:29 pm
by Mit
3 points, congrats
Posted: Sun Jun 09, 2013 9:44 pm
by zaroba
Thinking of all kinds of ways these could be used.
To an extreme effect, a Minecraft TU with all the blocks being entities so players can collect them and build things out of them. TU can handle 100k 'global' entities, right? lol
A lesser design of that would be letting players collect wood logs by harvesting tree buildings and using them to literally build a house. Would need all kinds of detailed scripting though. Mainly for height and exact placement to allow stacking.
Or just use a few various house pieces so players can build modular homes. Hallways, various sized rooms, etc. If 'open' (ie, no roof) then furniture for the inside as well.
Posted: Mon Jun 10, 2013 6:21 pm
by morbydvisns
yep.
Posted: Tue Jun 11, 2013 9:56 pm
by zaroba
Ingame you had said there was a 'follow' type.
How close does it follow?
Maybe it could be used to add trailers to vehicles
Posted: Thu Jun 13, 2013 6:20 pm
by morbydvisns
Bet it has a variable to say how close.
Posted: Wed Sep 11, 2013 8:40 pm
by zaroba
bumpity bump.
if a global entity could have it's own vars and scripts, then one could pretty much script a full ai for an entity.
vars to store various entity specific data (if needed) and using player vars for player specific options. Entity var(s) to store the id(s) of the player(s) it's chatting with for msg %player% commands, playervars to store stuff like actions completed for the npc (like tasks in a tutorial or quests) or even the entities attitude towards the player based on how nice or mean they are to it. The entity could 'learn' about a player and respond to their dialogue and actions accordingly, having the player gain a reputation among npc entities. Could even have the entities randomly wonder about the map, checking various things (as if curious) based on actions performed by the active players on the world and even perform tasks based on various stimuli like buying materials and building houses if it detects none for sale in the town it's in
I guess if the entity couldn't have it's own var, one could use the setcontext thing to use a building to store vars.