13.11.2018, 14:08
(
Last edited by NaS; 13/11/2018 at 05:07 PM.
)
Quote:
|
That is a cool thing. I thought about it, and it could be done like the following:
pawn Code:
The same thing however can be done without the need of properties: pawn Code:
|
So if I want to give an Item health or whatever you can imagine, I add a "Health" Property, set its tag to Float and assign it a value.
When loading the items in the script, I have a function to search for a property and get its value, then do something with it depending on the Script I load it with.
So i don't define them in the script at all, but solely in the editor.
There should be enough "slots" to assign even complex properties. For example, I use the Extra IDs for Doors, Gates and moving Platforms which have a set of properties, eg. move Target Position and rotation (x,y,z and rx,ry,rz), move speed, whether or not a dynamic area is created to "trigger" them, the area's size and some other values to describe the type of movement.
With that I don't even need to touch the script when adding new doors, gates, etc and they can be configured in multiple ways so it looks like it was coded seperately.
It's probably a feature you don't want to implement early, but it's extremely useful in my opinion. When utilizing them properly you can truly build map resources for your gamemode with complex features without hardcoding them in the script.
You could also think about adding the attributes of existing SAMP Items as properties to the list, for example Picku Type or whether an Actor is invulnerable.
Or even go as far as adding any and all values you use for an Item into a dynamic property list. With that I mean the Items Position, Rotation and Model. Similar to how the Streamer Plugin has all the data available through Streamer_GetIntData etc. Hope you know what I mean

So far all the Editors had good features or were convenient to use, but implementing the maps was always either copy and paste or converting around map files.
With a good integration and being able to directly load stuff from the Map would be a huge selling point for me as that takes away a lot of unneccessary work AND allows for dynamic configuration of Items etc.
Also please consider allowing attached objects to objects as well. Even if you don't use YSF (which adds AttachPlayerObjectToObject) you can use these in the editor to create something similar to prefabs. You can calculate their real world position in the script based on the offsets quite easily, so they don't actually need to be attached ingame.
Anyway you'll probably focus on other more important things first, just wanted to give you some ideas.


